Wichert Akkerman

Software design? Strange hacks? All of the above please!

Articles

Lingua 2 released

This new release was planned for a long time. I started working on it at the Pyramid NOLA sprint last February. Since I just finished a project and am looking for new work I had some time to finally finish Lingua 2.

Lingua is a Python package that helps you find translateable texts in your code, and generate POT-file for them. Previous versions handled this as an extractor plugin for Babel. With this release Babel is no longer used and Lingua now has a more powerful extraction framework itself.

Read more

Task queues

When writing a web application or REST backend I occasionally run into a common problem: sometimes I need to do things that will take a while: sending a push notification to mobile apps, generating emails or doing an expensive calculation. Doing this immediately would result in very long response times, which is not acceptable. That means I need a way to offload those to something

Read more

Allowing unicode ids in Zope

Back when Zope was written Python did not support unicode. This is still reflected in the policy for object ids in Zope: they must be pure ASCII. I recently started wondering what it would bring Zope a bit closer to the future and make it support UTF-8 ids. It turns out that this is doable without too much effort.

Read more

Developing for the browser

In a recent blog post Andy Mckay asked if javascript apps are ready for business. Having recently spent a fair amount of writing JavaScript I think I can answer that question. Unfortunately the answer at this point in time is a resounding no.

Read more

Sqlalchemy In Reverse

When using data in a relational database you often use an Object Relational Mapper (ORM) so you can pretend that you are only dealing with standard objects instead of having to deal with SQL directly. The ORM will then generate SQL automatically for you, and magically turn query results into objects again. For a recent project I had to do the exact reverse: turn a SQL expression into a SQLAlchemy construct.

Doing this required building a parser for SQL expressions to generate a syntax tree, and then converting the syntax tree into a SQLAlchemy expression.

Read more

Migration Frameworks

There is a growing number of migration toolkits for Python: Alembic, sqlalchemy-migrate, GenericSetup, zope.generations, south, etc. All of these focus on migrating a specific type of database, and some even on migration within a specific type of application (Zope or Django). They work very well, but when you need to deal with larger applications they no longer suffice.

Read more

New site

The server that had been serving this website died recently, so I had to migrate everything to a new machine. I also used this as an excuse to redo this website again, replacing my previous XML+XSLT approach with a static site generation. That means I can now manage content as simple textfiles instead of having to manually enter XML, so perhaps I might be updating this more than once per year now.

Read more