Python collector SDK for Chainbase task runtime
Project description
octoarms-sdk
Python SDK for task collectors running on the Chainbase task platform.
Install
pip install octoarms-sdk
Publish to PyPI
Local build and check
python -m pip install --upgrade build twine
python -m build
twine check dist/*
Manual upload
twine upload dist/*
GitHub Actions auto publish
- Add repository secret
PYPI_API_TOKEN(value: your PyPI API token). - Bump version in
python/pyproject.toml. - Create and push tag with
py-v*format, for example:
git tag py-v0.1.1
git push origin py-v0.1.1
Usage
from octoarms_sdk import (
TaskContext,
build_data_api_upsert_fn,
build_oss_upload_client,
build_podcast_extractor_client,
build_transcript_client,
)
upsert_fn = build_data_api_upsert_fn(
capability_endpoint="http://chainbase-block-scanner-fetcher-test-svc",
ephemeral_token="token-abc",
)
ctx = TaskContext(
run_id="123",
task_name="demo_task",
task_version="v0.1.0",
upsert=upsert_fn,
)
extractor = build_podcast_extractor_client(
capability_endpoint="http://chainbase-block-scanner-fetcher-test-svc",
ephemeral_token="token-abc",
)
audio = extractor.extract_audio(
platform="rss_feed",
episode_url="https://example.com/episode",
)
oss = build_oss_upload_client(
capability_endpoint="http://chainbase-block-scanner-fetcher-test-svc",
ephemeral_token="token-abc",
)
uploaded = oss.upload_object_bytes(
object_key="podcasts/demo.mp3",
content=b"audio bytes",
content_type="audio/mpeg",
)
transcripts = build_transcript_client(
capability_endpoint="http://chainbase-block-scanner-fetcher-test-svc",
ephemeral_token="token-abc",
)
job = transcripts.submit_transcript(url=str(uploaded["uri"]), language="en")
transcript = transcripts.wait_transcript(str(job["job_id"]))
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
octoarms_sdk-0.2.3.tar.gz
(10.8 kB
view details)
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 octoarms_sdk-0.2.3.tar.gz.
File metadata
- Download URL: octoarms_sdk-0.2.3.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e974ac32419a284c5756f90df5b9fc96d38804dff7c00c54a5557c499e2970d
|
|
| MD5 |
d841fd5e191bf8a4952ae8391fdea541
|
|
| BLAKE2b-256 |
750a37b9735983488453100c49dd23836667543461d3d41780ab7b8f166ce9ad
|
File details
Details for the file octoarms_sdk-0.2.3-py3-none-any.whl.
File metadata
- Download URL: octoarms_sdk-0.2.3-py3-none-any.whl
- Upload date:
- Size: 20.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e16db79166a80bb8693a6ee81c9bf20701049ef8b8de879c877bab302cfa41a
|
|
| MD5 |
346a95e29d6ad9f017e2fdf810e57741
|
|
| BLAKE2b-256 |
fcc7bb56d6a935481fe346ec8111452483a4ff7cf76b2bdcc3ab0e0e1c6aac0a
|