Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

A code template processor

Project Description
The B Preprocessor
A code template processor

What is this?
This is a code templating pre-processor. In my work I often have to
write code which runs on multiple data files. The code has to be the
same, but the files differ in subtle ways: the number of files, the
format of the files, etc. Instead of writing one piece of code, then
tweaking it to work for each case, I write a B template, and put all
of the file-specific-subtleties into meta-data text files, and the B
pre-processor handles all of the case specific tweaking.

Why would I want this?
Everything is text files and python scripts. The output of the
preprocessor looks like normal code that was written from scratch.
I send code generated by the pre-processor to my boss all the time.
It makes him happy because it looks like code he writes; It makes
me happy because I don't have to be inefficient and write code his
The preprocessor uses simple ideas: replacement, iteration, files
are treated as strings, the template boilerplate is handled with
the same rules as everything else. You can do some crazy things
with a little creativity.

Why didn't you just learn to use one of the other template scripting
Frankly, I wrote the first version of this over the course of two
hours. I needed something which worked, and I needed it fast. It would
have taken me longer to learn something new, than to make something
Why B?
B comes before C! Most of my work coding is in C/C++. Now I can say
things like, "I wrote you A B C... ++ template for that." Actually, no,
thats a really limp joke.

when install with setuptools (or variant), an executable 'B' is added
to the user's path.
Release History

Release History

This version
History Node


History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
B_pp-1.1.tar.gz (8.6 kB) Copy SHA256 Checksum SHA256 Source May 23, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting