Skip to main content

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

  1. Add repository secret PYPI_API_TOKEN (value: your PyPI API token).
  2. Bump version in python/pyproject.toml.
  3. 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


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.4.tar.gz (13.1 kB view details)

Uploaded Source

Built Distribution

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

octoarms_sdk-0.2.4-py3-none-any.whl (23.1 kB view details)

Uploaded Python 3

File details

Details for the file octoarms_sdk-0.2.4.tar.gz.

File metadata

  • Download URL: octoarms_sdk-0.2.4.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for octoarms_sdk-0.2.4.tar.gz
Algorithm Hash digest
SHA256 7f60e767f96437ba94afc953f7807dc0a2e78429911f6f599ae55c77d6a03da5
MD5 a36323522e7bb03dc518d7160f7cfe18
BLAKE2b-256 53c957718a400384608646da4d99f1f99be3afc0b83387110e228ca0c4c3a64a

See more details on using hashes here.

File details

Details for the file octoarms_sdk-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: octoarms_sdk-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 23.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for octoarms_sdk-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1b77928d2a0b554d5d30f79cb2446ebb44e669d7e5fd65fa2124553b89adddff
MD5 0ff2f82e20e7946ec765358aee948375
BLAKE2b-256 55f200ff595d5a0b45cc13574b646519a309e3bd8a46bef075615dd93dcd5038

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 Pingdom Monitoring Sentry Error logging StatusPage Status page