Convert numbers from base 10 integers to base X strings and back again.
Copyright (c) 2010, 2011, 2012, 2015 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:
Install and Usage Instructions
You can use pip to install baseconv module:
$ pip install python-baseconv
>>> base20 = BaseConverter('0123456789abcdefghij') >>> base20.encode(1234) '31e' >>> base20.decode('31e') '1234' >>> base20.encode(-1234) '-31e' >>> base20.decode('-31e') '-1234' >>> base11 = BaseConverter('0123456789-', sign='$') >>> base11.encode('$1234') '$-22' >>> base11.decode('$-22') '$1234'
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.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.