Skip to main content
Warning: You are using the test version of PyPI. This is a pre-production deployment of Warehouse. Changes made here affect the production instance of TestPyPI (
Help us improve Python packaging - Donate today!

Brainfuck to Python AST compilation and integration

Project Description - seamless usage of Brainfuck in Python code
========================================================= compiles Brainfuck programs to Python AST, enabling the
integration of industial-strength Brainfuck programs with Python code. Example:

>>> import brainfuck
>>> hello = brainfuck.to_function("""
>>> hello()
'Hello World!\n'

For convenience, an import hook is also provided:

>>> brainfuck.install_import_hook()
>>> # Note: programs is a python package (with
# and a brainfuck file named
>>> from programs import rot13
>>> rot13.rot13("brainfuck")
>>> # The module can also be called directly
>>> rot13("foobar")


$ pip install brainfuck


$ git clone
$ cd brainfuck
$ python install

OR just copy ```` somewhere in your PYTHONPATH.

Platform support

Latest versions of Python 2, 3 and PyPy are supported and tested. Other Python
versions that have support for the ``ast`` module should work too, but are not

Unit tests

Run tests with ``$ python``


- Optimizations for the brainfuck-generated AST (this is a big one!)
- More tests
- Running tests with tox
- Python AST to brainfuck compilation (may take some time)


MIT (programs in the programs-directory may be licensed differently)

Release History

This version
History Node


Download Files

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

File Name & Hash SHA256 Hash Help Version File Type Upload Date
(8.1 kB) Copy SHA256 Hash SHA256
py2.py3 Wheel Apr 8, 2015
(6.8 kB) Copy SHA256 Hash SHA256
Source Apr 8, 2015

Supported By

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 Google Google Cloud Servers DreamHost DreamHost Log Hosting