py-multibase


Namepy-multibase JSON
Version 1.0.3 PyPI version JSON
download
home_pagehttps://github.com/multiformats/py-multibase
SummaryMultibase implementation for Python
upload_time2020-10-26 13:55:23
maintainer
docs_urlNone
authorDhruv Baldawa
requires_python
licenseMIT license
keywords multibase
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            py-multibase
------------

.. image:: https://img.shields.io/pypi/v/py-multibase.svg
        :target: https://pypi.python.org/pypi/py-multibase

.. image:: https://img.shields.io/travis/multiformats/py-multibase.svg?branch=master
        :target: https://travis-ci.org/multiformats/py-multibase?branch=master

.. image:: https://codecov.io/gh/multiformats/py-multibase/branch/master/graph/badge.svg
        :target: https://codecov.io/gh/multiformats/py-multibase

.. image:: https://readthedocs.org/projects/py-multibase/badge/?version=stable
        :target: https://py-multibase.readthedocs.io/en/stable/?badge=stable
        :alt: Documentation Status

`Multibase <https://github.com/multiformats/multibase>`_ implementation for Python

Multibase is a protocol for distinguishing base encodings and other simple string encodings, and for ensuring full compatibility with program interfaces.

It answers the question: Given data d encoded into string s, how can I tell what base d is encoded with?

Base encodings exist because transports have restrictions, use special in-band sequences, or must be human-friendly.
When systems chose a base to use, it is not always clear which base to use, as there are many tradeoffs in the decision.
Multibase is here to save programs and programmers from worrying about which encoding is best.

It solves the biggest problem: a program can use multibase to take input or produce output in whichever base is desired.

The important part is that the value is self-describing, letting other programs elsewhere know what encoding it is using.

* Free software: MIT license
* Documentation: https://py-multibase.readthedocs.io.
* Python versions: 3.5, 3.6

Installation
============

.. code-block:: shell

    $ pip install py-multibase


Sample Usage
============

.. code-block:: python

    >>> # encoding a buffer
    >>> from multibase import encode, decode
    >>> encode('base58btc', 'hello world')
    b'zStV1DL6CwTryKyV'
    >>> encode('base64', 'hello world')
    b'mGhlbGxvIHdvcmxk'
    >>> # decoding a multibase
    >>> decode('mGhlbGxvIHdvcmxk')
    b'hello world'
    >>> decode(b'zStV1DL6CwTryKyV')
    b'hello world'
    >>> decode(encode('base2', b'hello world'))
    b'hello world'


Supported codecs
================

* base2
* base8
* base10
* base16
* base16
* base16
* base32hex
* base32
* base32z
* base36
* base36upper
* base58flickr
* base58btc
* base64
* base64url


History
-------

1.0.3 (2020-10-26)
==================
* Add base36 and base36 upper encodings
* Fix issue with base16 encoding

1.0.0 (2018-10-19)
==================

* Re-implement encoding for base32 and base64, as the implementation was buggy
* Add extensive tests for all encodings

0.1.0 (2017-09-02)
==================

* First release on PyPI.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/multiformats/py-multibase",
    "name": "py-multibase",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "multibase",
    "author": "Dhruv Baldawa",
    "author_email": "dhruv@dhruvb.com",
    "download_url": "https://files.pythonhosted.org/packages/58/9c/8b1b78e900f5e94b1d48359efffcaa1ba9ddd0448e6aac94d4d27dbd67b7/py-multibase-1.0.3.tar.gz",
    "platform": "",
    "description": "py-multibase\n------------\n\n.. image:: https://img.shields.io/pypi/v/py-multibase.svg\n        :target: https://pypi.python.org/pypi/py-multibase\n\n.. image:: https://img.shields.io/travis/multiformats/py-multibase.svg?branch=master\n        :target: https://travis-ci.org/multiformats/py-multibase?branch=master\n\n.. image:: https://codecov.io/gh/multiformats/py-multibase/branch/master/graph/badge.svg\n        :target: https://codecov.io/gh/multiformats/py-multibase\n\n.. image:: https://readthedocs.org/projects/py-multibase/badge/?version=stable\n        :target: https://py-multibase.readthedocs.io/en/stable/?badge=stable\n        :alt: Documentation Status\n\n`Multibase <https://github.com/multiformats/multibase>`_ implementation for Python\n\nMultibase is a protocol for distinguishing base encodings and other simple string encodings, and for ensuring full compatibility with program interfaces.\n\nIt answers the question: Given data d encoded into string s, how can I tell what base d is encoded with?\n\nBase encodings exist because transports have restrictions, use special in-band sequences, or must be human-friendly.\nWhen systems chose a base to use, it is not always clear which base to use, as there are many tradeoffs in the decision.\nMultibase is here to save programs and programmers from worrying about which encoding is best.\n\nIt solves the biggest problem: a program can use multibase to take input or produce output in whichever base is desired.\n\nThe important part is that the value is self-describing, letting other programs elsewhere know what encoding it is using.\n\n* Free software: MIT license\n* Documentation: https://py-multibase.readthedocs.io.\n* Python versions: 3.5, 3.6\n\nInstallation\n============\n\n.. code-block:: shell\n\n    $ pip install py-multibase\n\n\nSample Usage\n============\n\n.. code-block:: python\n\n    >>> # encoding a buffer\n    >>> from multibase import encode, decode\n    >>> encode('base58btc', 'hello world')\n    b'zStV1DL6CwTryKyV'\n    >>> encode('base64', 'hello world')\n    b'mGhlbGxvIHdvcmxk'\n    >>> # decoding a multibase\n    >>> decode('mGhlbGxvIHdvcmxk')\n    b'hello world'\n    >>> decode(b'zStV1DL6CwTryKyV')\n    b'hello world'\n    >>> decode(encode('base2', b'hello world'))\n    b'hello world'\n\n\nSupported codecs\n================\n\n* base2\n* base8\n* base10\n* base16\n* base16\n* base16\n* base32hex\n* base32\n* base32z\n* base36\n* base36upper\n* base58flickr\n* base58btc\n* base64\n* base64url\n\n\nHistory\n-------\n\n1.0.3 (2020-10-26)\n==================\n* Add base36 and base36 upper encodings\n* Fix issue with base16 encoding\n\n1.0.0 (2018-10-19)\n==================\n\n* Re-implement encoding for base32 and base64, as the implementation was buggy\n* Add extensive tests for all encodings\n\n0.1.0 (2017-09-02)\n==================\n\n* First release on PyPI.\n",
    "bugtrack_url": null,
    "license": "MIT license",
    "summary": "Multibase implementation for Python",
    "version": "1.0.3",
    "project_urls": {
        "Homepage": "https://github.com/multiformats/py-multibase"
    },
    "split_keywords": [
        "multibase"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "78217b6b3bba9c702daf6991f2bd89c92db6fa899a444fab24ba5b99f1f486f7",
                "md5": "eb43141c3a7cbe8b82813a0672f6da58",
                "sha256": "2677c1fafcc0ae15ddb9c7f444c5becc2530b3889124fd4fa2959ddfefb8c15b"
            },
            "downloads": -1,
            "filename": "py_multibase-1.0.3-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "eb43141c3a7cbe8b82813a0672f6da58",
            "packagetype": "bdist_wheel",
            "python_version": "3.8",
            "requires_python": null,
            "size": 6378,
            "upload_time": "2020-10-26T13:55:26",
            "upload_time_iso_8601": "2020-10-26T13:55:26.500181Z",
            "url": "https://files.pythonhosted.org/packages/78/21/7b6b3bba9c702daf6991f2bd89c92db6fa899a444fab24ba5b99f1f486f7/py_multibase-1.0.3-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "589c8b1b78e900f5e94b1d48359efffcaa1ba9ddd0448e6aac94d4d27dbd67b7",
                "md5": "3ce5b4279ecc89089a6c878c5ccad4ea",
                "sha256": "d28a20efcbb61eec28f55827a0bf329c7cea80fffd933aecaea6ae8431267fe4"
            },
            "downloads": -1,
            "filename": "py-multibase-1.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "3ce5b4279ecc89089a6c878c5ccad4ea",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 23376,
            "upload_time": "2020-10-26T13:55:23",
            "upload_time_iso_8601": "2020-10-26T13:55:23.399525Z",
            "url": "https://files.pythonhosted.org/packages/58/9c/8b1b78e900f5e94b1d48359efffcaa1ba9ddd0448e6aac94d4d27dbd67b7/py-multibase-1.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2020-10-26 13:55:23",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "multiformats",
    "github_project": "py-multibase",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "tox": true,
    "lcname": "py-multibase"
}
        
Elapsed time: 0.08730s