No project description provided
Project description
Python IPFS CID
Computes IPFS CIDv0s exposed as a Python module.
This library computes the IPFS DAG of the input data and then returns the CID of the root node.
This returns the same CID as would be computed by ipfs add <file>
.
This library also computes the hash of the data after it has been converted to the DAG-PB format and processed, primarily for debugging and testing purposes.
Examples
from ipfs_cid_v0 import compute_cid
cid: str = compute_cid(b"1234") # Returns QmTPqcLhVnCtjoYuCZwPzfXcFrUviiPComTepHfEEaGf7g
from ipfs_cid_v0 import compute_hash
cid_hash: bytes = compute_hash(b"1234") # Returns b'\x12 K\x1b\x80\x9cr\xce\x0e\xf8\xd8\x15\xb9"\xeef\x04/\xc4\xaf\xe5\xc9G\xad\xd2\xa5,\xbcR\xd8\xb0\x19_\xa3'
from ipfs_cid_v0 import compute_hash_hex
cid_hash_hex: str = compute_hash_hex(b"1234") # Returns '12204b1b809c72ce0ef8d815b922ee66042fc4afe5c947add2a52cbc52d8b0195fa3'
Build
You must have rust/cargo installed. Then run:
pip install maturin
maturin develop --release
Install in your python environment if doesn't automatically get picked up:
python -m pip install ./target/wheels/ipfs_cid_v0-0.0.1-cp310-cp310-manylinux_2_34_x86_64.whl
Current limitations
- Only supports CID v0
- Only supports files, not directories
- Only supports the default IPFS block size (256 KiB)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file ipfs_cid_v0-0.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: ipfs_cid_v0-0.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19c57380f53bbc6567dab51d322917364299f762b7b0080b809f96c56048ee42 |
|
MD5 | a0093d391868ee2dd6a0da2b6be586bb |
|
BLAKE2b-256 | 349ba679116208ab4a1c71bc9ed60080237535ef1db6700979cb80caa95a980e |
File details
Details for the file ipfs_cid_v0-0.0.1-cp310-cp310-manylinux_2_34_x86_64.whl
.
File metadata
- Download URL: ipfs_cid_v0-0.0.1-cp310-cp310-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.10, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b5c97ac4afb73c70545d811dd92a74c517e54c4f7877d301ae7c33b13863bdf |
|
MD5 | f3955bd64a114a875d1c94cfe54e19bf |
|
BLAKE2b-256 | 81910a6190db86d85264861955207ab0be2b12a94207b7b0d5eac87940ceab48 |
File details
Details for the file ipfs_cid_v0-0.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: ipfs_cid_v0-0.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6fed1d7dd795025693b3c1aa24214f72a3922ba9a4d21349386b6a3b18dca39 |
|
MD5 | 8c421c2a79534f64f37c592e1bdd20e5 |
|
BLAKE2b-256 | 09d400f5a439bd93d4ee7374f53620f07b23ee994d344969aab4d7bf0812b3c7 |
File details
Details for the file ipfs_cid_v0-0.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: ipfs_cid_v0-0.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 617a9a0aee7b6f37b4893d074e62576ada7559793f90ef11c448c2e4e0010285 |
|
MD5 | d38c56b83f115df344008d2883038a61 |
|
BLAKE2b-256 | 9e476f33ecc77960c8c540e2209100c717a31a7c53a3105d345e4c78cbfd0bd5 |
File details
Details for the file ipfs_cid_v0-0.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: ipfs_cid_v0-0.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6f94174ae7b78fdf9a9a85c493622b0cb98a91208185a285d872fc4ede8cb0e |
|
MD5 | b9ba1aa65d9852e8726ef0478293be36 |
|
BLAKE2b-256 | d785d76c78c753220b7adbe09e4cf0da9744bb5dc10361d5f960e706434dcf73 |
File details
Details for the file ipfs_cid_v0-0.0.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: ipfs_cid_v0-0.0.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.7m, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | da7527db033edb32c0c3daf9cca9bfb4b3fc1a7bf398171c5cfcc00e46e27a6d |
|
MD5 | d6671ba640ed754e422e6091ec08e37f |
|
BLAKE2b-256 | a2504f04cfc5801e0ab73fe81adf1fb45b43001e36876a2c6a5a5d2f21f1357c |