Flunn - Simple CBOR En/Decoder
Flunn is also a Python library providing CBOR [RFC7049] encoding and decoding with a traditional buffered and a streaming interface. (flunn is a fork of flynn)
Usage
The Flunn API is really simple and inspired by existing Python serialisation modules like json and pickle. The flunn module has four methods called dumps, dump, loads and load, where dumps will return the serialised input as bytes string, while dump will write the serialised input to a file descriptor. The same applies to loads and load.
>>> flunn.dumps([1, [2, 3]]) b'\x82\x01\x82\x02\x03' >>> flunn.loads(b'\x82\x01\x82\x02\x03') [1, [2, 3]]
Furthermore, Flunn supports generators and other iterables as input for streaming support:
>>> flunn.dumps(range(5)) b'\x9f\x00\x01\x02\x03\x04\xff' >>> flunn.loads(b'\x9f\x00\x01\x02\x03\x04\xff') [0, 1, 2, 3, 4]
Or to generate a map using an iterable:
>>> flunn.dumps(flunn.mapping(((a, a) for a in range(5))))
b'\xbf\x00\x00\x01\x01\x02\x02\x03\x03\x04\x04\xff'
>>> flunn.loads(b'\xbf\x00\x00\x01\x01\x02\x02\x03\x03\x04\x04\xff')
{0: 0, 1: 1, 2: 2, 3: 3, 4: 4}
Copyright / License
© 2015 Sokolov Yura aka funny_falcon © 2013 Fritz Conrad Grimpen
The code is licensed under the MIT license, provided in the COPYING file of the Flunn distribution.
Metadata
Release files for flunn 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| flunn-1.0.0.tar.gz | 5.2 kB | Without provenance | Details for flunn-1.0.0.tar.gz |
Release files / flunn-1.0.0.tar.gz
| Download URL | flunn-1.0.0.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
07678da9b286415b3e8c79d7b75c48bbc30b95d2255589d2482b1b9f0dee44c3
|
|
BLAKE2b-256 checksum How to use checksums |
929c94c21d5d724563bc7ef08a30bf553c7e913926312e7138084e5cbbc17d81
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for flunn 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.