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!

Convert numbers from base 10 integers to base X strings and back again.

Project Description

Copyright (c) 2010, 2011, 2012, 2015, 2017 Guilherme Gondim. All rights reserved.

Copyright (c) 2009 Simon Willison. All rights reserved.

Copyright (c) 2002 Drew Perttula. All rights reserved.

Python module to convert numbers from base 10 integers to base X strings and back again.
Drew Perttula, Simon Willison, Guilherme Gondim
Python Software Foundation License version 2
Project website:
References: ;

Install and Usage Instructions

You can use pip to install baseconv module:

$ pip install python-baseconv

Example usage:

>>> from baseconv import base2, base16, base36, base56, base58, base62, base64
>>> base2.encode(1234)
>>> base2.decode('10011010010')
>>> base64.encode(100000000000000000000000000000000000L)
>>> base64.decode('4q9XSiTDWYk7Z-W00000')

>>> from baseconv import BaseConverter
>>> myconv = BaseConverter('MyOwnAlphabet0123456')
>>> repr(myconv)
"BaseConverter('MyOwnAlphabet0123456', sign='-')"
>>> myconv.encode('1234')
>>> myconv.decode('wy1')
>>> myconv.encode(-1234)
>>> myconv.decode('-wy1')
>>> altsign = BaseConverter('abcd-', sign='$')
>>> repr(altsign)
"BaseConverter('abcd-', sign='$')"
>>> altsign.encode(-1000000)
>>> altsign.decode('$cc-aaaaaa')

License information

See the file “LICENSE” for terms & conditions for usage, and a DISCLAIMER OF ALL WARRANTIES.

This baseconv distribution contains no GNU General Public Licensed (GPLed) code, just like prior baseconv distributions.

All trademarks referenced herein are property of their respective holders.


The Django Project includes a copy of this module on django.utils.baseconv.

Release History

Release History

This version
History Node


History Node


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
python-baseconv-1.2.0.tar.gz (5.0 kB) Copy SHA256 Checksum SHA256 Source Apr 2, 2017

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