makkus.dag-cbor


Namemakkus.dag-cbor JSON
Version 0.3.3 PyPI version JSON
download
home_pagehttps://github.com/hashberg-io/dag-cbor
SummaryPython implementation of the DAG-CBOR codec.
upload_time2023-11-10 12:32:02
maintainer
docs_urlNone
authorhashberg
requires_python>=3.8
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            dag-cbor: A Python implementation of the `DAG-CBOR codec <https://ipld.io/specs/codecs/dag-cbor/spec/>`_
========================================================================================================

.. image:: https://img.shields.io/badge/python-3.7+-green.svg
    :target: https://docs.python.org/3.7/
    :alt: Python versions

.. image:: https://img.shields.io/pypi/v/dag-cbor.svg
    :target: https://pypi.python.org/pypi/dag-cbor/
    :alt: PyPI version

.. image:: https://img.shields.io/pypi/status/dag-cbor.svg
    :target: https://pypi.python.org/pypi/dag-cbor/
    :alt: PyPI status

.. image:: http://www.mypy-lang.org/static/mypy_badge.svg
    :target: https://github.com/python/mypy
    :alt: Checked with Mypy
    
.. image:: https://readthedocs.org/projects/dag-cbor/badge/?version=latest
    :target: https://dag-cbor.readthedocs.io/en/latest/?badge=latest
    :alt: Documentation Status

.. image:: https://github.com/hashberg-io/dag-cbor/actions/workflows/python-pytest.yml/badge.svg
    :target: https://github.com/hashberg-io/dag-cbor/actions/workflows/python-pytest.yml
    :alt: Python package status

.. image:: https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square
    :target: https://github.com/RichardLitt/standard-readme
    :alt: standard-readme compliant


This is a fully compliant Python implementation of the `DAG-CBOR codec <https://ipld.io/specs/codecs/dag-cbor/spec/>`_, a subset of the `Concise Binary Object Representation (CBOR) <https://cbor.io/>`_ supporting the `IPLD Data Model <https://ipld.io/docs/data-model/>`_ and enforcing a unique (strict) encoded representation of items.


.. contents::


Install
-------

You can install the latest release from `PyPI <https://pypi.org/project/dag-cbor/>`_ as follows:

.. code-block:: console

    $ pip install --upgrade dag-cbor


Usage
-----

We suggest you import DAG-CBOR as follows:

>>> import dag_cbor

Below are some basic usage examples, to get you started: for detailed documentation, see https://dag-cbor.readthedocs.io/


Encoding and decoding
^^^^^^^^^^^^^^^^^^^^^

>>> dag_cbor.encode({'a': 12, 'b': 'hello!'})
b'\xa2aa\x0cabfhello!'
>>> dag_cbor.decode(b'\xa2aa\x0cabfhello!')
{'a': 12, 'b': 'hello!'}


Random DAG-CBOR data
^^^^^^^^^^^^^^^^^^^^

>>> import pprint # pretty-printing
>>> custom_opts = dict(min_codepoint=0x41, max_codepoint=0x5a, include_cid=False)
>>> with dag_cbor.random.options(**custom_opts):
...     for d in dag_cbor.random.rand_dict(3):
...             pprint.pp(d)
...
{'BIQPMZ': b'\x85\x1f\x07/\xcc\x00\xfc\xaa',
 'EJEYDTZI': {},
 'PLSG': {'G': 'JFG',
          'HZE': -61.278,
          'JWDRKRGZ': b'-',
          'OCCKQPDJ': True,
          'SJOCTZMK': False},
 'PRDLN': 39.129,
 'TUGRP': None,
 'WZTEJDXC': -69.933}
{'GHAXI': 39.12,
 'PVUWZLC': 4.523,
 'TDPSU': 'TVCADUGT',
 'ZHGVSNSI': [-57, 9, -78.312]}
{'': 11, 'B': True, 'FWD': {}, 'GXZBVAR': 'BTDWMGI', 'TDICHC': 87}



API
---

For the full API documentation, see https://dag-cbor.readthedocs.io/


Contributing
------------

Please see `<CONTRIBUTING.md>`_.


License
-------

`MIT © Hashberg Ltd. <LICENSE>`_

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/hashberg-io/dag-cbor",
    "name": "makkus.dag-cbor",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "",
    "author": "hashberg",
    "author_email": "sg495@users.noreply.github.com",
    "download_url": "https://files.pythonhosted.org/packages/2a/ba/cac7047b52bca77bb1d9c6a6a39a291ece17b1a7c46d8150bb315a0401b6/makkus.dag-cbor-0.3.3.tar.gz",
    "platform": null,
    "description": "dag-cbor: A Python implementation of the `DAG-CBOR codec <https://ipld.io/specs/codecs/dag-cbor/spec/>`_\n========================================================================================================\n\n.. image:: https://img.shields.io/badge/python-3.7+-green.svg\n    :target: https://docs.python.org/3.7/\n    :alt: Python versions\n\n.. image:: https://img.shields.io/pypi/v/dag-cbor.svg\n    :target: https://pypi.python.org/pypi/dag-cbor/\n    :alt: PyPI version\n\n.. image:: https://img.shields.io/pypi/status/dag-cbor.svg\n    :target: https://pypi.python.org/pypi/dag-cbor/\n    :alt: PyPI status\n\n.. image:: http://www.mypy-lang.org/static/mypy_badge.svg\n    :target: https://github.com/python/mypy\n    :alt: Checked with Mypy\n    \n.. image:: https://readthedocs.org/projects/dag-cbor/badge/?version=latest\n    :target: https://dag-cbor.readthedocs.io/en/latest/?badge=latest\n    :alt: Documentation Status\n\n.. image:: https://github.com/hashberg-io/dag-cbor/actions/workflows/python-pytest.yml/badge.svg\n    :target: https://github.com/hashberg-io/dag-cbor/actions/workflows/python-pytest.yml\n    :alt: Python package status\n\n.. image:: https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square\n    :target: https://github.com/RichardLitt/standard-readme\n    :alt: standard-readme compliant\n\n\nThis is a fully compliant Python implementation of the `DAG-CBOR codec <https://ipld.io/specs/codecs/dag-cbor/spec/>`_, a subset of the `Concise Binary Object Representation (CBOR) <https://cbor.io/>`_ supporting the `IPLD Data Model <https://ipld.io/docs/data-model/>`_ and enforcing a unique (strict) encoded representation of items.\n\n\n.. contents::\n\n\nInstall\n-------\n\nYou can install the latest release from `PyPI <https://pypi.org/project/dag-cbor/>`_ as follows:\n\n.. code-block:: console\n\n    $ pip install --upgrade dag-cbor\n\n\nUsage\n-----\n\nWe suggest you import DAG-CBOR as follows:\n\n>>> import dag_cbor\n\nBelow are some basic usage examples, to get you started: for detailed documentation, see https://dag-cbor.readthedocs.io/\n\n\nEncoding and decoding\n^^^^^^^^^^^^^^^^^^^^^\n\n>>> dag_cbor.encode({'a': 12, 'b': 'hello!'})\nb'\\xa2aa\\x0cabfhello!'\n>>> dag_cbor.decode(b'\\xa2aa\\x0cabfhello!')\n{'a': 12, 'b': 'hello!'}\n\n\nRandom DAG-CBOR data\n^^^^^^^^^^^^^^^^^^^^\n\n>>> import pprint # pretty-printing\n>>> custom_opts = dict(min_codepoint=0x41, max_codepoint=0x5a, include_cid=False)\n>>> with dag_cbor.random.options(**custom_opts):\n...     for d in dag_cbor.random.rand_dict(3):\n...             pprint.pp(d)\n...\n{'BIQPMZ': b'\\x85\\x1f\\x07/\\xcc\\x00\\xfc\\xaa',\n 'EJEYDTZI': {},\n 'PLSG': {'G': 'JFG',\n          'HZE': -61.278,\n          'JWDRKRGZ': b'-',\n          'OCCKQPDJ': True,\n          'SJOCTZMK': False},\n 'PRDLN': 39.129,\n 'TUGRP': None,\n 'WZTEJDXC': -69.933}\n{'GHAXI': 39.12,\n 'PVUWZLC': 4.523,\n 'TDPSU': 'TVCADUGT',\n 'ZHGVSNSI': [-57, 9, -78.312]}\n{'': 11, 'B': True, 'FWD': {}, 'GXZBVAR': 'BTDWMGI', 'TDICHC': 87}\n\n\n\nAPI\n---\n\nFor the full API documentation, see https://dag-cbor.readthedocs.io/\n\n\nContributing\n------------\n\nPlease see `<CONTRIBUTING.md>`_.\n\n\nLicense\n-------\n\n`MIT \u00a9 Hashberg Ltd. <LICENSE>`_\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Python implementation of the DAG-CBOR codec.",
    "version": "0.3.3",
    "project_urls": {
        "Bug Tracker": "https://github.com/hashberg-io/dag-cbor/issues",
        "Homepage": "https://github.com/hashberg-io/dag-cbor"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "576d5780e1cf4eea9c0d2799552a6e0476bc69b1f9324acc229f0dbfe74c1145",
                "md5": "7a7d5b0a7df34b25af5cb15bb5673be6",
                "sha256": "e9ef58c618b76694e61bf9b7f311e1f9c08c130df0c64947342dcbeb1377ca77"
            },
            "downloads": -1,
            "filename": "makkus.dag_cbor-0.3.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7a7d5b0a7df34b25af5cb15bb5673be6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 25323,
            "upload_time": "2023-11-10T12:32:00",
            "upload_time_iso_8601": "2023-11-10T12:32:00.391566Z",
            "url": "https://files.pythonhosted.org/packages/57/6d/5780e1cf4eea9c0d2799552a6e0476bc69b1f9324acc229f0dbfe74c1145/makkus.dag_cbor-0.3.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2abacac7047b52bca77bb1d9c6a6a39a291ece17b1a7c46d8150bb315a0401b6",
                "md5": "a60f2faeb34f0172d95ae60fcc46c9ed",
                "sha256": "ac46dfc8510879841e526a2ac0f6d2d237066ee17b30ee830dc205c05b3cd920"
            },
            "downloads": -1,
            "filename": "makkus.dag-cbor-0.3.3.tar.gz",
            "has_sig": false,
            "md5_digest": "a60f2faeb34f0172d95ae60fcc46c9ed",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 52318,
            "upload_time": "2023-11-10T12:32:02",
            "upload_time_iso_8601": "2023-11-10T12:32:02.527647Z",
            "url": "https://files.pythonhosted.org/packages/2a/ba/cac7047b52bca77bb1d9c6a6a39a291ece17b1a7c46d8150bb315a0401b6/makkus.dag-cbor-0.3.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-10 12:32:02",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "hashberg-io",
    "github_project": "dag-cbor",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "tox": true,
    "lcname": "makkus.dag-cbor"
}
        
Elapsed time: 0.32868s