Rapid Development, Python with Batteries

Feature image

It's a simple problem. I wanted to compare two sections of legislation and show the changes in a “redline” format, which is very familiar to lawyers.

The bottom panel shows the changes in redlines.

As this was not the central part of the project, I didn't want to spend too much time developing it. So, I tried assiduously to find a library in the vast Python ecosystem which could do such a thing. Strangely, I could not find anything similar. Maybe, everyone was okay with difflib, a module in the standard Python library.

However, I wasn't happy, and due to the nature of my project, it was a legitimate concern.

Notwithstanding my fairly mediocre programming skills, I managed to conjure up a module that builds on difflib. That adventure is the subject of the latest post on Love.Law.Robots:

So what difference does it make? Drawing red lines with PythonA little tweak to a standard python library transforms it into a tool used to show changes in text for lawyers.Love.Law.Robots.Houfu

In this case, Python provided me with the means to build my solution with as little code as possible. In the end, it's about the ecosystem and community. This is what “low code” or “no-code” should look like.

I was also surprised that there is no open-source library to convert changes into markdown this way. Well, there is one now:

GitHub – houfu/redlinesContribute to houfu/redlines development by creating an account on GitHub.GitHubhoufu

There's certainly a lot of space in the LegalTech for open-source ( i.e. there's hardly any open-source LegalTech). Unfortunately, while successful, fully-formed projects like docassemble are rare unicorns, what's essential is an ecosystem of low-level utilities to enable others to build a system.

It's hardly glorious, but it's there for the taking for an intrepid lawyer-coder.

Maybe, I should consider sharing with Open Source Legal. Although I reckon I need to hack on the solution more.

Happy coding!

#Newsletter

Author Portrait Love.Law.Robots. – A blog by Ang Hou Fu