Skip to main content

icpay-bucket

Minimal client for ICPay Bucket — on-chain encrypted file storage on the Internet Computer.

pip install icpay-bucket

Quick start

from icpay_bucket import BucketClient

# Writes are authorized by a bucket API key (create it in the ICPay UI).
client = BucketClient(api_key="icp_cloud_…")

# Upload (single call, files up to ~1.85 MB)
result = client.upload_file(
    bucket_id="icp",
    path="/logo.webp",
    data=b"webp bytes…",
    content_type="image/webp",
)
if "err" in result:
    raise RuntimeError(result["err"])

# Public CDN URL — no call needed
url = client.public_url("icp", "/logo.webp")

# List files
listing = client.list_files("icp", page=0, page_size=20)
print([f["path"] for f in listing["ok"]["items"]])

# Delete with the API key
client.delete_file("icp", "/logo.webp")

API

  • upload_file(bucket_id, path, data, content_type, api_key?) — returns {"ok": file_id} | {"err": …}.
  • delete_file(bucket_id, path, api_key?) — returns {"ok": None} | {"err": …}.
  • list_files(bucket_id, page, page_size) — paginated file list.
  • download_file(bucket_id, path) — file bytes (public + private buckets).
  • get_public_file_url(bucket_id, path) — canister-provided CDN URL.
  • public_url(bucket_name, path) — CDN URL computed locally (no call).
  • public_file_url(canister_id, bucket_name, path) — same, standalone.

Writes are authorized by a bucket API key. Reads on public buckets work for any caller.

License

MIT

Download files

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

Source Distribution

icpay_bucket-1.0.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

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

icpay_bucket-1.0.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file icpay_bucket-1.0.0.tar.gz.

File metadata

  • Download URL: icpay_bucket-1.0.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for icpay_bucket-1.0.0.tar.gz
Algorithm Hash digest
SHA256 37f20f80355ce80836a29a0cdb6c046af844744e91011d52aa17e8e4a88bc552
MD5 1806a53321fec141cd5a41c67b197309
BLAKE2b-256 d6abcc455ffb8ee6ed11d0e2323cf5e1ab8e5118cd47e5305f73bc6b4387f539

See more details on using hashes here.

File details

Details for the file icpay_bucket-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: icpay_bucket-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for icpay_bucket-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 73631214aadc578e37078e40ed48d5786acfe87571d14569fc72c5f9c708761e
MD5 d542bc2e4d920542a1376e026ed4ff24
BLAKE2b-256 440f7dab34d030e1632e1efe78194e1bf312ac3ef8885fc8373bd9a75ed6f1dd

See more details on using hashes here.

Supported by

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