Using Alembic to Migrate SQLAlchemy Databases

There are several advantages of using SQLAlchemy as a wrapper for an SQL database. These include stability with large numbers of data records, class/object-oriented approach, plug-and-play underlying databases. However, one under-documented disadvantage is poor change management. If you add a field or table you generally need to regenerate the entire database. This is a pain if … Continue reading Using Alembic to Migrate SQLAlchemy Databases

Quickpost: Adding a Custom Path to Conda Environment

I have a few Python applications in development in a custom 'projects' directory. I want to be able to run these using 'python -m [appname]'. The easiest way to do this is by adding a .pth file to the site-packages folder of my Python environment (for me '/[userdirpath]/anaconda3/envs/[projectname]/lib/python3.5/site-packages/'). For example, I added a file called 'custom.pth' that … Continue reading Quickpost: Adding a Custom Path to Conda Environment

Starting a Python Project with Anaconda

It just so happens that on a few systems I have been using Anaconda to allow painless Python coding. For example, on Windows or non-Debian Linux I have struggled to compile packages from source. Anaconda provides a useful wrapper for the main functionality that just works on these operating systems (on my Ubuntu machine or the … Continue reading Starting a Python Project with Anaconda

Quick Post: Structuring a Python Program

One thing I've found hard about programming in Python is the jump from small scripts or iPython (now Jupyter) notebooks to fully functional programs. Many examples and online tutorials only require a single ".py" file or a series of command line or notebook entries. However, as you get more advanced and start looking at complete Flash applications or … Continue reading Quick Post: Structuring a Python Program