Skip to main content

Python SDK for Filecoin Onchain Cloud (Synapse)

Project description

Pynapse

Python SDK for Filecoin Onchain Cloud (Synapse).

This project mirrors the JS SDK in FilOzone/synapse-sdk and references the Go implementation in data-preservation-programs/go-synapse for parity.

Status

Work in progress. Parity is being implemented in incremental commits.

Install (dev)

uv venv
uv pip install -e .[test]

PyPI package name: synapse-filecoin-sdk
Python import: pynapse

Install (PyPI)

pip install synapse-filecoin-sdk

Supported Networks

Both Filecoin Mainnet and Calibration testnet are supported:

from pynapse import AsyncSynapse

# Mainnet
synapse = await AsyncSynapse.create(
    rpc_url="https://api.node.glif.io/rpc/v1",
    chain="mainnet",
    private_key=PRIVATE_KEY
)

# Calibration testnet (for testing)
synapse = await AsyncSynapse.create(
    rpc_url="https://api.calibration.node.glif.io/rpc/v1",
    chain="calibration",
    private_key=PRIVATE_KEY
)

See QUICKSTART.md for a full tutorial using Calibration testnet.

CommP / PieceCID

pynapse uses stream-commp from go-fil-commp-hashhash for PieceCID calculation.

Install stream-commp

stream-commp is an external runtime dependency and is not installed by pip.

git clone https://github.com/filecoin-project/go-fil-commp-hashhash.git
cd go-fil-commp-hashhash/cmd/stream-commp
go build -o stream-commp .

Install it to your PATH (for example /usr/local/bin) or set:

export PYNAPSE_COMMP_HELPER=/absolute/path/to/stream-commp

Verify:

stream-commp --help

License

Dual-licensed under Apache-2.0 OR MIT. See LICENSE.md.

Publishing to PyPI

Publishing is automated via GitHub Actions in .github/workflows/publish-pypi.yml.

  1. In PyPI, create the project (or use an existing one) and configure a Trusted Publisher for this GitHub repository and workflow.
  2. In GitHub, optionally protect the pypi environment for manual approval.
  3. Tag a release and push the tag:
git tag v0.2.0
git push origin v0.2.0

The workflow builds the package, runs twine check, and publishes to PyPI via OIDC (no API token required).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

synapse_filecoin_sdk-0.2.0.tar.gz (233.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

synapse_filecoin_sdk-0.2.0-py3-none-any.whl (89.3 kB view details)

Uploaded Python 3

File details

Details for the file synapse_filecoin_sdk-0.2.0.tar.gz.

File metadata

  • Download URL: synapse_filecoin_sdk-0.2.0.tar.gz
  • Upload date:
  • Size: 233.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for synapse_filecoin_sdk-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6bd66a49eaaa09024fe639a6a701c76f0bc2aef754b5a7e8d4ef39b55f9b676a
MD5 a5a5309d71c1cf5a262d748ebf5e2093
BLAKE2b-256 58a6f1c3087904204f40539eaf230c71e40120947aee31ae5667764d61d226c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for synapse_filecoin_sdk-0.2.0.tar.gz:

Publisher: publish-pypi.yml on anjor/pynapse

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file synapse_filecoin_sdk-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for synapse_filecoin_sdk-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3c44ee39b850922e0953647904ac8df982efcb68ff968207e2bb5d70caf859af
MD5 e58e0db6c131cd2bb4b0811f1e8bc53e
BLAKE2b-256 c71e28557a4187304b32cd84cd1cff1fb57709201eefef9e48662c8f38bf298a

See more details on using hashes here.

Provenance

The following attestation bundles were made for synapse_filecoin_sdk-0.2.0-py3-none-any.whl:

Publisher: publish-pypi.yml on anjor/pynapse

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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