Python C API

It is usually easier to write and debug Python scripts than do it in C/C++, while for heavy computation tasks, C or C++ programs can run much faster. A common strategy to get the best of both worlds is writing the computation kernels in C/C++ and binding Python APIs to invoke the computation kernels in Python scripts. Python C API exists exactly for the purpose of binding Python with C/C++.

I learnt Python C API recently, and this post records my practice of creating a Python package, txt2qr, that uses C library libqrencode. Txt2QR generates the QR code (in SVG format) of a given text, and is easily integrated into a Django app.

Read More

Abacus: Expenses Bookkeeping Tool

About a year ago, I started a side project for fun as well as the need to keep track of my daily expenses in my own way. The outcome, Abacus, is an expenses bookkeeping web service (still under active development, but in good shape), which I have been using for months.

Abacus uses Django as the website backend engine, providing webpages for users to record, view and manage their daily expenses transactions in groups. Additionally, Abacus also has a Telegram bot interface to accomplish the same bookkeeping actions in Telegram chat. Abacus is meant to be deployed on a home PC as a self-hosted web service for personal use.

Read More