File python-py-multibase.spec of Package python-py-multibase

#
# spec file for package python-py-multibase
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/


%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name:           python-py-multibase
Version:        1.0.3
Release:        0
License:        MIT
Summary:        Multibase implementation for Python
Url:            https://github.com/multiformats/py-multibase
Group:          Development/Languages/Python
Source:         https://files.pythonhosted.org/packages/source/p/py-multibase/py-multibase-%{version}.tar.gz
Patch0:         notest.patch
#Git-Clone:     https://github.com/multiformats/py-multibase
BuildRequires:  python-rpm-macros
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module setuptools}
BuildRequires:  %{python_module pytest}
BuildRequires:  fdupes
Requires:       python-baseconv
Requires:       python-morphys
BuildArch:      noarch

%python_subpackages

%description
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
* base58flickr
* base58btc
* base64
* base64url

%prep
%setup -q -n py-multibase-%{version}
%patch0 -p1

%build
%python_build

%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}

%files %{python_files}
%{python_sitelib}/*

%changelog
openSUSE Build Service is sponsored by