Python Data Serialization Comparison

Date Tags python

Did a quick comparison of some data serialization options for Python. My requirements for the serialization format were the following:

  • Input data is typically either a list or a dictionary.
  • Interoperability is important and must be compatible with at least C.
  • A human readable format is desirable but not necessary.

Based on the requirements, I took a look at the following Python packages:

more ...

Python Gotcha - Globals And Namespaces

Date Tags python

After several years of regular Python use, I really admire that things work how I expect about 90% of the time. To be fair, the other 10% is typically user error. It is easy to overlook nuances in a language, even if you should know better.

I ran into this gotcha in Python recently: when importing a global variable from a module explicitly by name, that variable will be bound to the local namespace. If …

more ...

Thoughts On Writing BakeScale

Recently, I wrote a simple web app called BakeScale which converts common cooking and baking ingredients between weight and volume. I am not a web developer by profession so rather than using the new hotness I used slightly older versions of Bootstrap and jQuery since I have some prior experience with both; just a few quick thoughts on these two web development tools.

While jQuery seems to be falling out of favor with the web …

more ...

Directory Information Please

Sometimes a directory structure needs a little extra information. Even the most well thought-out directory names lack the expressiveness of a few short remarks. My solution for these cases has been to add a file named __dir_info__.txt to a directory requiring additional details. This file provides an explanation of the directory's purpose, which typically starts with This directory contains ..., and is formatted using AsciiDoc.

Let's look at an example:

= foobar
:date: 5 January 2015 …
more ...

Generating Documents With Jinja2 and YAML

Date Tags python

Quick example of generating documents by rendering data from a YAML file through a Jinja2 template. The target output is Latex vhistory data (revs.tex) which will be included in main document (main.tex). The output is generated by a Python script ( from YAML data (revs.yaml).

import yaml
from jinja2 import Template

# For this example, assume that stdout will be redirected to `revs.tex`.
# In the template, the `{#--#}` entries are used to …
more ...

gArchiver Demo

Date Tags software

Made a quick video to demonstrate some of the features of gArchiver:

I use gArchiver frequently and it has proven invaluable. The ability to quickly add metadata to a zip file is handy. Here are a couple of typical use cases:

  • Keeping track of where files came from. When I need to keep a local copy of a received file, its useful to make a quick note of who sent it.
  • Grouping files together as …
more ...

Comment Groups

Date Tags software

Sometimes normal leading comments just aren't enough, instead a visual method of grouping blocks of code together is needed. The following pattern seems to work very well:

<comment-symbol>{-- <group-text> --

Here is an example in C:

/*{-- Some grouped variables. --*/
/* Maintains foo-y stuff. */
int foo = 1;
/* Maintains bar-y stuff. */
int bar = 2;

Here is an example in Python:

#{-- Some cool code here. --
foo = 1
bar = 2

Multi-line example in JavaScript:

//{-- Big long explanation of a …
more ...

Doctrine Goals

This past weekend, I started a side project named Doctrine. It is a desktop application that simplifies viewing the rendered output of an AsciiDoc text file. A quick demo video is shown below:

The motivation behind Doctrine is to streamline the user experience when writing documents in plain text markup. Currently I am only focusing on AsciiDoc but compatibility with other formats (Markdown, ReStructuredText, etc) could be added in the future (integration with Pandoc is …

more ...

Hi, I am Jeff Rimko!
A computer engineer and software developer in the greater Pittsburgh, Pennsylvania area.