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.1.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.1-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: icpay_bucket-1.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 903d87472a804cae67258717e0a0bedbeb5d940a5d36c93ac96ead0f29cd39f3
MD5 dcecc98e6198368a203253a705e1b94a
BLAKE2b-256 933a20c8a9afd5734910b419fb171ba5eda7cb604be93fa5e8bbc5eeca4b2a1a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: icpay_bucket-1.0.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 93849f761e5a13c6ab0351dddae6ec6318818727b4b2a691243d3ce298262902
MD5 37680a24cacc592e4e7ae636613b2346
BLAKE2b-256 f741abc3e746728b97e95b88a7e4310fdbc8ed6ec59382a919d12e97b1efa007

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