Skip to main content

rebus - Generate base64-encoded strings consisting of alphanumeric symbols only.

Project description

Generate base64-encoded strings consisting of alphanumeric symbols only.

Why did I make this app?

Recently I have been working on implementing of a Google Authenticator app for Plone (which I did for my beloved company - Goldmund, Wyldebeast & Wunderliebe).

For generating of a bar code image, I needed a base32 encoded string. While Android devices could perfectly scan all bar-code image that I would generate, Apple devices would raise errors on bar code images which were generated using strings that contain one or more “=” characters.

The solution found was to add a number of \n at the end of the string to be encoded.

If you happen to experience similar problems, you know what to do.


  • Python 2.6.8+, 2.7.+, 3.3.+


Install latest stable version from PyPI:

$ pip install rebus

…or latest stable version from GitHub:

$ pip install -e git+

…or latest stable version from BitBucket:

$ pip install -e hg+

Usage and examples

Using rebus is damn easy. Whenever you would want to use base64.b32encode or base64.b64encode, replace base64 with rebus.


Required imports

>>> import rebus

b32encode string

>>> rebus.b32encode('abcdefg')

b64encode string

>>> rebus.b64encode('abcdefg')


>>> rebus.urlsafe_b64encode('abcdefg')


It’s possible to decode string, encoded with rebus to their original values.

Required imports

>>> import rebus

b32decode string

>>> rebus.b32decode('MFRGGZDFMZTQUCQK')

b64decode string

>>> rebus.b64decode('YWJjZGVmZwoK')


>>> rebus.urlsafe_b64decode('YWJjZGVmZwoK')


GPL 2.0/LGPL 2.1


For any issues contact me at the e-mail given in the Author section.


Artur Barseghyan <>

Project details

Download files

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

Source Distribution

rebus-0.2.tar.gz (20.9 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page