readonly implementation of fsspec for IPFS
Project description
ipfsspec
A readonly implementation of fsspec for IPFS.
Installation
You can install ipfsspec
directly from git with the following command:
pip install ipfsspec
Usage
This project is currently very rudimentaty. It is not yet optimized for efficiency and is not yet feature complete. However it should be enough to list directory contents and to retrieve files from ipfs://
resources via fsspec. A simple hello worlds would look like:
import fsspec
with fsspec.open("ipfs://QmZ4tDuvesekSs4qM5ZBKpXiZGun7S2CYtEZRB3DYXkjGx", "r") as f:
print(f.read())
The current implementation uses a HTTP gateway to access the data. It uses IPIP-280 to determine which gateway to use. If you have a current installation of an IPFS node (e.g. kubo, IPFS Desktop etc...), you should be fine. In case you want to use a different gateway, you can use any of the methods specified in IPIP-280, e.g.:
- create the file
~/.ipfs/gateway
with the gateway address as first line - define the environment variable
IPFS_GATEWAY
to the gateway address - create the file
/etc/ipfs/gateway
with the gateway address as first line
No matter which option you use, the gateway has to be specified as an HTTP(S) url, e.g.: http://127.0.0.1:8080
.
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 Distribution
Built Distribution
File details
Details for the file ipfsspec-0.5.3.tar.gz
.
File metadata
- Download URL: ipfsspec-0.5.3.tar.gz
- Upload date:
- Size: 12.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d90999b149c9e476e0459d92a70162e563583cda24b3359da036624326d36da4 |
|
MD5 | 0ac662c4beb17c68190b54112431e924 |
|
BLAKE2b-256 | eea4a0c937bd5bca1bd046fe357be8fda7888043599590437a8d6061ac268562 |
File details
Details for the file ipfsspec-0.5.3-py3-none-any.whl
.
File metadata
- Download URL: ipfsspec-0.5.3-py3-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a621803074e9e5b2ced2108e216035f40600a36487ed17a52314834e81633f11 |
|
MD5 | 12ff81896ac96a36378a41a519d21600 |
|
BLAKE2b-256 | 8fbedebced7701fecd4cc62d928672a3f32953b56549315760841f4944718d15 |