Skip to main content

IPFS Pay-to-Pin Python SDK (ipfs-pay-to-pin-client)

Python client library for pinning files to IPFS via the standard 402 Payment Required microUSDC gateway on Algorand.

Installation

pip install ipfs-pay-to-pin-client

Usage

from ipfs_pay_to_pin_client import IpfsPayToPinClient

# Initialize client with Gateway URL and Algorand 25-word mnemonic
client = IpfsPayToPinClient(
    gateway_url="https://your-pay-to-pin-gateway.com",
    sender_mnemonic="your twenty five word algorand account mnemonic phrase goes here..."
)

# Pin a file with optional max price safety limit (in USDC)
response = client.pin_file("path/to/my-file.pdf", max_price_usdc=1.0)
print(f"Pinned CID: {response.cid}")
print(f"Pin Expires At: {response.pin_expires_at}")

# Pin raw bytes directly
raw_data = b"Hello, decentralized storage!"
response = client.pin_bytes(raw_data, filename="hello.txt")

# Check status of an existing CID
status = client.get_status(response.cid)
print(status)

Features

  • Automatic x402 402 Payment Required challenge handler
  • Algorand microUSDC settlement
  • Account rekey detection for security
  • Maximum price ceiling enforcement (max_price_usdc)

Download files

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

Source Distribution

ipfs_pay_to_pin_client-0.2.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

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

ipfs_pay_to_pin_client-0.2.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ipfs_pay_to_pin_client-0.2.0.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for ipfs_pay_to_pin_client-0.2.0.tar.gz
Algorithm Hash digest
SHA256 21d1f20c457796f1cbfa4f09cd58417005dc16bca7bdea53d9da4b236cb385f0
MD5 7061b8be9c7113e3eccb8e014c69417a
BLAKE2b-256 9759955b6783deb07a852ef68ae74c1fe9a0aa3e730b7da2d5817ff3eff4fd3c

See more details on using hashes here.

Provenance

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

Publisher: post-release.yml on IcanBENCHurCAT/ipfs-pay-to-pin

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

File details

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

File metadata

File hashes

Hashes for ipfs_pay_to_pin_client-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3f8d4c7eb371013fe3b014e1792b67158fdf0b781e38e6d7e52583d88d8b8324
MD5 038a42ff63db7f63c3479ab3a434ca89
BLAKE2b-256 207dc896b8ff8f6a743d463f6b53ea9c68ea0a248422cf2954ade85d1f8c48d2

See more details on using hashes here.

Provenance

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

Publisher: post-release.yml on IcanBENCHurCAT/ipfs-pay-to-pin

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