Async Python SDK & CLI for the Hitachi Content Platform (HCP) Unified API — S3, IIIF, and Transkribus with resumable bulk transfers
Project description
rahcp
Async Python SDK & CLI for the Hitachi Content Platform (HCP) Unified API — S3-compatible object storage, IIIF image ingestion, and Transkribus exports, with resumable, parallel bulk transfers.
Everything ships in one package. Data never flows through an API server: the SDK uses presigned URLs for direct, parallel, crash-resumable transfers.
Install
pip install rahcp # client, CLI, IIIF, Transkribus, tracker
pip install "rahcp[validate]" # + pre-upload image validation (Pillow)
pip install "rahcp[etl]" # + NATS JetStream pipelines
pip install "rahcp[alto]" # + Transkribus PAGE->ALTO conversion (ocrd)
pip install "rahcp[postgres]" # + Postgres transfer-tracker backend
pip install "rahcp[all]" # everything
Quick start
Python
import asyncio
from pathlib import Path
from rahcp import HCPClient
async def main():
# reads HCP_ENDPOINT / HCP_USERNAME / HCP_PASSWORD / HCP_TENANT
async with HCPClient.from_env() as client:
await client.s3.upload("my-bucket", "data/file.jpg", Path("file.jpg"))
objects = await client.s3.list_objects("my-bucket", prefix="data/")
print(objects)
asyncio.run(main())
CLI
rahcp s3 upload-all my-bucket ./scans --workers 20 --include '*.jpg'
rahcp iiif download-batches batches.txt -o ./images/ --workers 10
rahcp transkribus upload 1944790 my-bucket --prefix medieval/ --archive-dir /data
rahcp ns list my-tenant
What's inside rahcp
| Module | Purpose |
|---|---|
rahcp_client |
Async HCP client — auth, S3, MAPI, presigned URLs, bulk up/download |
rahcp_tracker |
Resumable transfer state tracking (SQLite; Postgres via [postgres]) |
rahcp_iiif |
Parallel IIIF image downloader with resumable tracking |
rahcp_transkribus |
Transkribus collection exporter (PAGE/ALTO XML + images) |
rahcp_validate |
Pre-upload image validation ([validate]) |
rahcp.cli |
The rahcp command-line interface |
Import names are stable: from rahcp_client import HCPClient, from rahcp_iiif import download_batch, from rahcp_transkribus import export_collection.
Links
- Documentation: https://ai-riksarkivet.github.io/hcp/
- Source: https://github.com/AI-Riksarkivet/ra-hcp
Licensed under Apache-2.0.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rahcp-0.1.1.tar.gz.
File metadata
- Download URL: rahcp-0.1.1.tar.gz
- Upload date:
- Size: 79.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b2becf283d202c94cf1f50c6bca338d98b6724c432e1c647f5cc4313e27fbf0
|
|
| MD5 |
d800ce14a0996e8067639e3a89b0c55b
|
|
| BLAKE2b-256 |
9867f8cb38465d7f0a6ff84ef3ac25ab3917cc4375d1a7c8cca416fc2669a2bf
|
File details
Details for the file rahcp-0.1.1-py3-none-any.whl.
File metadata
- Download URL: rahcp-0.1.1-py3-none-any.whl
- Upload date:
- Size: 93.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46337834ea405e7f12702df2f4377854a126da930e9d7bbee7885c26c7785dbd
|
|
| MD5 |
58d7e6b8e612bd929ce250f72938055c
|
|
| BLAKE2b-256 |
6f050193a29bd0ddc806329370bf1c880f86307f117356db80dc42e9961dcee1
|