Snippets of Python code, mostly in Flask.
A summary of how to serialize and deserialize from Python data structures into JSON-compatible strings, which is especially useful when working with API requests and responses.
A primer on bitwise operators in Python - left and right shifting, bitwise and / or / exclusive or, and complements.
An easy introduction to binary numbers, which will lead to a follow-up article on bit manipulation in Python.
Basic overview of parallel / concurrent programming, including comparisons between multiprocessing, multithreading, and asyncio (coroutines) in Python.
Using Python, a short example on how to delegate specified methods to another object, as compared to composition and inheritance.
How to use enums in your models to enforce value consistency.
A template file for using conditional arguments when running Python scripts from the command line.
I've always struggled to remember between these very similar methods in the SQLALchemy ORM - so I took some time out to research these and write it down.
A few notes on the code review process, and the steps I go through when reviewing.
Building model definitions for many-to-many relationships via a secondary table.
Sick of `alembic merge heads` slowing down your builds? Here's a short bash script I wrote to rename your migration files and update its down revision.
Dive into SQLAlchemy's little known `event.listen` method to automatically generate slugs when saving a model instance.
How to use the `do` Jinja extension to modify an existing dictionary in your view template.
A short snippet for creating a template filter, to present datetime objects in Jinja templates.
Want to store JSON-serialized data in your database? But sick of calling `json.loads()` and `json.dumps()` when dealing with this data in your Flask app? Read on!
How to fix alembic's "Multiple head revisions are present for given argument 'head'" error.
A small Python script to take action whenever a new file is uploaded to a directory or its contents change.
Review of 3 common Python-based data pipeline / workflow frameworks from AirBnb, Pinterest, and Spotify.
How to find slow sections in your Python code.