Skip to main content

Python reference implementation of the Sonic Field akousma sonic-memory protocol (part of Earworm).

Project description

akousma (Python)

Reference implementation of the Sonic Field akousma sonic-memory protocol. Consumed by oída, germ (backend), and algophony (pipelines) so all three share one memory layer with one lineage model.

Spec: earworm/docs/akousma_spec_v1.md · Store: earworm/docs/akousmata-store.md

Install

pip install -e ~/workspace/earworm/packages/py-akousma

Use

import akousma

# Build + validate a record
rec = akousma.new_akousma(
    audio={"asset_id": "asset_1", "content_hash": "sha256:...", "duration_seconds": 10.0},
    originating_app="oida", source_type="recorded", origin="live-input",
    listening={"oida.signal": {"class": "music-like"}},
)
assert akousma.is_valid(rec)

# Shared store (defaults to ~/workspace/akousmata, or $AKOUSMATA_PATH)
with akousma.AkousmataStore() as store:
    uri = store.put_audio(open("clip.wav", "rb").read())   # content-addressed
    rec["audio"]["uri"] = uri
    store.put(rec)

    child = akousma.new_akousma(
        audio={"asset_id": "asset_2"}, originating_app="germ",
        source_type="generated", origin="generated",
        parent_akousma_ids=[rec["akousma_id"]], operation="transform", prompt="make it metallic",
    )
    store.put(child)
    store.ancestors(child["akousma_id"])   # -> [rec["akousma_id"]]  (germ lineage explorer)
    store.query(originating_app="oida")    # -> [rec]                (algophony batch)

The bundled akousma/akousma.schema.json is the canonical schema, kept in sync with earworm/packages/core/schemas/akousma.schema.json.

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

akousma-0.4.0.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

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

akousma-0.4.0-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file akousma-0.4.0.tar.gz.

File metadata

  • Download URL: akousma-0.4.0.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for akousma-0.4.0.tar.gz
Algorithm Hash digest
SHA256 3d4dcec9d761e22d6108bdaf42ffb4a6ba7d080fb9567f2d0b3980c7d66bbe10
MD5 f6dadcc69da86b6b47f322e595149d73
BLAKE2b-256 34e95b40398b42a0ecaaaa409083e696790657926ec6746eeb27eb1198c7f9f1

See more details on using hashes here.

Provenance

The following attestation bundles were made for akousma-0.4.0.tar.gz:

Publisher: python-release.yml on sonicfieldlabs/oida

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file akousma-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: akousma-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for akousma-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4f70a24b874a274c82a8574e2247f4468d06774210dbc6730765fa919583adf3
MD5 2bf00328ae8e4a38ba4e7715631103af
BLAKE2b-256 868545daa17bce0aeb02b3f3f2cb56332253db8c0ffa2255d22ed7c10605b0a3

See more details on using hashes here.

Provenance

The following attestation bundles were made for akousma-0.4.0-py3-none-any.whl:

Publisher: python-release.yml on sonicfieldlabs/oida

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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