Skip to main content

icpay-bucket

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

Canister: 6vbhm-nqaaa-aaaan-q6muq-cai · Version: 1.1.1

Docs: Package guide · API reference

Requires ic-py>=1.0.1 and cbor2>=5.4.2,<6 (pinned for query compatibility).

Install

pip install icpay-bucket

Quick start

from icpay_bucket import BucketClient

client = BucketClient(api_key="icp_cloud_…")

result = client.upload_file("icp", "/hello.txt", b"hello world\n", "text/plain")
if "err" in result:
    raise RuntimeError(result["err"])

print(client.public_url("icp", "/hello.txt"))
print(client.list_files("icp", page=0, page_size=20))
client.delete_file("icp", "/hello.txt")

Authentication

Caller Access
Bucket owner (Internet Identity) All methods
Read API key list_files, download_file, get_file, file_exists, list_folder, search_files, get_file_metadata
Write API key Upload, move, copy, tags, metadata, chunked upload
Delete API key delete_file, bulk_delete_files

Pass api_key= per call or set BucketClient(api_key=…).

API reference

All methods return {"ok": …} or {"err": "…"}.

Buckets

Method Auth
get_bucket_price(capacity_gb) public
create_bucket(name, capacity_gb, visibility="Public") owner
get_bucket(bucket_id) owner
list_buckets() owner
get_bucket_cycle_status() public

Upload

Method Auth
upload_file(bucket_id, path, data, content_type, api_key?) write key / owner
begin_file_upload(bucket_id, path, content_type, total_size, api_key?) write key / owner
upload_file_chunk_indexed(upload_id, chunk_index, data) write key / owner
complete_file_upload(upload_id, api_key?) write key / owner
get_upload(upload_id) owner principal
cancel_upload(upload_id) owner principal

Read

Method Auth
download_file(bucket_id, path, api_key?) read key / owner
get_public_file_url(bucket_id, path) public
list_files(bucket_id, page=0, page_size=20, api_key?) read key / owner
get_file(bucket_id, path, api_key?) read key / owner
file_exists(bucket_id, path, api_key?) read key / owner
list_folder(bucket_id, prefix, page, page_size, api_key?) read key / owner
search_files(bucket_id, search_query, page, page_size, api_key?) read key / owner
get_file_metadata(bucket_id, path, api_key?) read key / owner
public_url(bucket_name, path) local helper

Write

Method Auth
move_file(bucket_id, source_path, destination_path, api_key?) write key / owner
copy_file(bucket_id, source_path, destination_path, api_key?) write key / owner
delete_file(bucket_id, path, api_key?) delete key / owner
set_file_tags(bucket_id, path, tags, api_key?) write key / owner
set_file_metadata(bucket_id, path, metadata, api_key?) write key / owner

Bulk (max 20)

Method Auth
bulk_delete_files(bucket_id, paths, api_key?) delete key / owner
bulk_move_files(bucket_id, operations, api_key?) write key / owner
bulk_copy_files(bucket_id, operations, api_key?) write key / owner

Bulk operations use {"source": "…", "destination": "…"} dicts.

Public CDN

https://6vbhm-nqaaa-aaaan-q6muq-cai.raw.icp0.io/cloud/{bucketName}{path}

Notes

  • Paths must use allowed extensions — use /file-copy.txt, not /file.txt.copy.
  • get_upload / cancel_upload need the bucket owner's Internet Identity principal.

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.1.1.tar.gz (7.3 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.1.1-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: icpay_bucket-1.1.1.tar.gz
  • Upload date:
  • Size: 7.3 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.1.1.tar.gz
Algorithm Hash digest
SHA256 33c654c3b4d70d10e994e48de30f3f344066dd585221f38f6a2624328a9d2587
MD5 fc6c81651ca8af62552f7482c7f5cd26
BLAKE2b-256 c6325e790213d3478599e7dba3f8799a7f888c30633a732cbac895e4c26f6e66

See more details on using hashes here.

File details

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

File metadata

  • Download URL: icpay_bucket-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.4 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.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7c83142333c043402ddec92f9bf214423ac7609870d80a5759d28532faffaaf8
MD5 c628514a4c24e6d54dba6313b8d978d9
BLAKE2b-256 0bc591271b84f25fb0f850ba4d4906dd68b40aec3965b36a515281a2f3db8b6b

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