python-baseconv


Namepython-baseconv JSON
Version 1.2.2 PyPI version JSON
download
home_pagehttps://github.com/semente/python-baseconv
SummaryConvert numbers from base 10 integers to base X strings and back again.
upload_time2019-04-04 19:28:57
maintainer
docs_urlNone
authorGuilherme Gondim
requires_python
licensePython Software Foundation License
keywords converter numbers math
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            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``.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/semente/python-baseconv",
    "name": "python-baseconv",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "converter numbers math",
    "author": "Guilherme Gondim",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/33/d0/9297d7d8dd74767b4d5560d834b30b2fff17d39987c23ed8656f476e0d9b/python-baseconv-1.2.2.tar.gz",
    "platform": "",
    "description": "baseconv\n========\n\n.. image:: https://badge.fury.io/py/python-baseconv.svg\n    :target: http://badge.fury.io/py/python-baseconv\n\n.. image:: https://travis-ci.org/semente/python-baseconv.svg?branch=master\n    :target: https://travis-ci.org/semente/python-baseconv\n\n.. image:: https://coveralls.io/repos/semente/python-baseconv/badge.png?branch=master\n    :target: https://coveralls.io/r/semente/python-baseconv?branch=master\n\nCopyright (c) 2010, 2011, 2012, 2015, 2017 Guilherme Gondim.\nAll rights reserved.\n\nCopyright (c) 2009 Simon Willison.\nAll rights reserved.\n\nCopyright (c) 2002 Drew Perttula.\nAll rights reserved.\n\n**Description:**\n    Python module to convert numbers from base 10 integers to base X strings and back again.\n**Author(s):**\n    Drew Perttula, Simon Willison, Guilherme Gondim\n**License:**\n    Python Software Foundation License version 2\n**Project website:**\n    https://github.com/semente/python-baseconv\n**References:**\n    http://www.djangosnippets.org/snippets/1431/ ;\n    http://code.activestate.com/recipes/111286/\n\nInstall and Usage Instructions\n------------------------------\n\nYou can use ``pip`` to install ``baseconv`` module::\n\n    $ pip install python-baseconv\n\nExample usage::\n\n  >>> from baseconv import base2, base16, base36, base56, base58, base62, base64\n  >>> base2.encode(1234)\n  '10011010010'\n  >>> base2.decode('10011010010')\n  '1234'\n  >>> base64.encode(100000000000000000000000000000000000L)\n  '4q9XSiTDWYk7Z-W00000'\n  >>> base64.decode('4q9XSiTDWYk7Z-W00000')\n  '100000000000000000000000000000000000'\n\n  >>> from baseconv import BaseConverter\n  >>> myconv = BaseConverter('MyOwnAlphabet0123456')\n  >>> repr(myconv)\n  \"BaseConverter('MyOwnAlphabet0123456', sign='-')\"\n  >>> myconv.encode('1234')\n  'wy1'\n  >>> myconv.decode('wy1')\n  '1234'\n  >>> myconv.encode(-1234)\n  '-wy1'\n  >>> myconv.decode('-wy1')\n  '-1234'\n  >>> altsign = BaseConverter('abcd-', sign='$')\n  >>> repr(altsign)\n  \"BaseConverter('abcd-', sign='$')\"\n  >>> altsign.encode(-1000000)\n  '$cc-aaaaaa'\n  >>> altsign.decode('$cc-aaaaaa')\n  '-1000000'\n\n\nLicense information\n-------------------\n\nSee the file \"LICENSE\" for terms & conditions for usage, and a\nDISCLAIMER OF ALL WARRANTIES.\n\nThis baseconv distribution contains no GNU General Public Licensed (GPLed)\ncode, just like prior baseconv distributions.\n\nAll trademarks referenced herein are property of their respective\nholders.\n\nDjango\n------\n\nThe Django Project includes a copy of this module on ``django.utils.baseconv``.\n",
    "bugtrack_url": null,
    "license": "Python Software Foundation License",
    "summary": "Convert numbers from base 10 integers to base X strings and back again.",
    "version": "1.2.2",
    "project_urls": {
        "Download": "https://github.com/semente/python-baseconv/releases",
        "Homepage": "https://github.com/semente/python-baseconv"
    },
    "split_keywords": [
        "converter",
        "numbers",
        "math"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "33d09297d7d8dd74767b4d5560d834b30b2fff17d39987c23ed8656f476e0d9b",
                "md5": "af36e57309031a6f6dfca61d1598f0d8",
                "sha256": "0539f8bd0464013b05ad62e0a1673f0ac9086c76b43ebf9f833053527cd9931b"
            },
            "downloads": -1,
            "filename": "python-baseconv-1.2.2.tar.gz",
            "has_sig": false,
            "md5_digest": "af36e57309031a6f6dfca61d1598f0d8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4929,
            "upload_time": "2019-04-04T19:28:57",
            "upload_time_iso_8601": "2019-04-04T19:28:57.170968Z",
            "url": "https://files.pythonhosted.org/packages/33/d0/9297d7d8dd74767b4d5560d834b30b2fff17d39987c23ed8656f476e0d9b/python-baseconv-1.2.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2019-04-04 19:28:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "semente",
    "github_project": "python-baseconv",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "lcname": "python-baseconv"
}
        
Elapsed time: 1.22063s