110 lines
3.3 KiB
Plaintext
110 lines
3.3 KiB
Plaintext
Metadata-Version: 2.1
|
|
Name: python-baseconv
|
|
Version: 1.2.2
|
|
Summary: Convert numbers from base 10 integers to base X strings and back again.
|
|
Home-page: https://github.com/semente/python-baseconv
|
|
Download-URL: https://github.com/semente/python-baseconv/releases
|
|
Author: Drew Perttula, Guilherme Gondim, Simon Willison
|
|
Maintainer: Guilherme Gondim
|
|
License: Python Software Foundation License
|
|
Keywords: converter numbers math
|
|
Classifier: Development Status :: 5 - Production/Stable
|
|
Classifier: Intended Audience :: Developers
|
|
Classifier: License :: OSI Approved :: Python Software Foundation License
|
|
Classifier: Operating System :: OS Independent
|
|
Classifier: Programming Language :: Python
|
|
Classifier: Programming Language :: Python :: 2.7
|
|
Classifier: Programming Language :: Python :: 3
|
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
License-File: LICENSE
|
|
|
|
baseconv
|
|
========
|
|
|
|
.. image:: https://badge.fury.io/py/python-baseconv.svg
|
|
:target: http://badge.fury.io/py/python-baseconv
|
|
|
|
.. image:: https://travis-ci.org/semente/python-baseconv.svg?branch=master
|
|
:target: https://travis-ci.org/semente/python-baseconv
|
|
|
|
.. image:: https://coveralls.io/repos/semente/python-baseconv/badge.png?branch=master
|
|
:target: https://coveralls.io/r/semente/python-baseconv?branch=master
|
|
|
|
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.
|
|
|
|
**Description:**
|
|
Python module to convert numbers from base 10 integers to base X strings and back again.
|
|
**Author(s):**
|
|
Drew Perttula, Simon Willison, Guilherme Gondim
|
|
**License:**
|
|
Python Software Foundation License version 2
|
|
**Project website:**
|
|
https://github.com/semente/python-baseconv
|
|
**References:**
|
|
http://www.djangosnippets.org/snippets/1431/ ;
|
|
http://code.activestate.com/recipes/111286/
|
|
|
|
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)
|
|
'10011010010'
|
|
>>> base2.decode('10011010010')
|
|
'1234'
|
|
>>> base64.encode(100000000000000000000000000000000000L)
|
|
'4q9XSiTDWYk7Z-W00000'
|
|
>>> base64.decode('4q9XSiTDWYk7Z-W00000')
|
|
'100000000000000000000000000000000000'
|
|
|
|
>>> from baseconv import BaseConverter
|
|
>>> myconv = BaseConverter('MyOwnAlphabet0123456')
|
|
>>> repr(myconv)
|
|
"BaseConverter('MyOwnAlphabet0123456', sign='-')"
|
|
>>> myconv.encode('1234')
|
|
'wy1'
|
|
>>> myconv.decode('wy1')
|
|
'1234'
|
|
>>> myconv.encode(-1234)
|
|
'-wy1'
|
|
>>> myconv.decode('-wy1')
|
|
'-1234'
|
|
>>> altsign = BaseConverter('abcd-', sign='$')
|
|
>>> repr(altsign)
|
|
"BaseConverter('abcd-', sign='$')"
|
|
>>> altsign.encode(-1000000)
|
|
'$cc-aaaaaa'
|
|
>>> altsign.decode('$cc-aaaaaa')
|
|
'-1000000'
|
|
|
|
|
|
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.
|
|
|
|
Django
|
|
------
|
|
|
|
The Django Project includes a copy of this module on ``django.utils.baseconv``.
|