Skip to main content
PyCon US is happening May 14th-22nd in Pittsburgh, PA USA.  Learn more

An IPLD implementation in Python

Project description

https://img.shields.io/pypi/v/py-ipld.svg https://img.shields.io/travis/bigchaindb/py-ipld.svg https://img.shields.io/codecov/c/github/bigchaindb/py-ipld/master.svg

py-ipld

Python implementation of the IPLD specification.

Status

This is a Work-in-Progress. For TODOs, see: #1

Installation

$ pip install ipld  # (not yet)

Usage

In the Python REPL:

>>> from ipld import marshal, multihash, unmarshal
>>>
>>> file = {
... 'name': 'hello.txt',
... 'size': 11
... }
>>>
>>> marshalled = marshal(file)
>>>
>>> multihash(marshalled)
'QmQtX5JVbRa25LmQ1LHFChkXWW5GaWrp7JpymN4oPuBSmL'
>>>
>>> unmarshal(marshal(file)) == file
True

That’s it. No readthedocs, no private methods :boom:.

Tests

Only relevant, if you want to help developing.

$ pip install -e .[dev]
$ py.test -v

Acknowledgements

Thanks to the contributors over at BigchainDB for letting me take their setup structure.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page