../projects/

projects

The following is a selection of spare time projects of mine. Most of my professional work is on closed-source proprietary software; these repositories are not wholly representative of professional-quality code, although parts of them are probably up to scratch.

contingency

contingency image

Things are what they are, but they don't have to be.

Provision for future eventualities. The absence of certainty.

I've been working on a simulation project in my spare time that I've called 'contingency'.

info

space_game

⚠️ Note: This has not been maintained for some time and will not run unmodified. It is awaiting a weekend or so of 'dusting off'.

github

space_game

A space game written in Python. It's currently a very simple arcade space shooter.

features

single-header C libraries in Python

github slides

This is a presentation I did on a technique I used for consuming single header C libraries from Python in a personal project, utilising the hard work of other people so that I did not have to do any!

Given a single-header dependency with no existing binding, you can easily create (and build, and package) one by feeding the header directly to cffi, with some simple text transformations to remove problematic syntax.

nuklear-cffi

⚠️ Note: This has not been maintained for some time and will not run unmodified. It is awaiting a weekend or so of 'dusting off'.

github

A semi-automatic Python binding for the nuklear C library.

The core of this is a python program that parses the nuklear.h header for declarations and passes this to the 'cffi' Python binding generator.

Declarations are extracted using a C preprocessor followed by some simple ad hoc text transformations. The 'pcpp' preprocessor is used. This is a C preprocessor written in Python, so the preprocessing step doesn't actually require a C compiler to be installed.

However, the process of generating the Python binding requires a C compiler.

Some code for interfacing nuklear with pygame is provided under pynk.nkpygame.