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

cd packages/py-akousma
pip install -e .

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)

# Optional v1.4 accountable-listening index. The full producer report remains
# namespaced in `listening`; the auditum keeps attribution and references.
rec["auditum"] = akousma.auditum(listenings=[{
    "listening_id": "lst_1",
    "listener_id": "oida",
    "listener_type": "agent",
    "created_at": rec["created_at"],
    "report_namespace": "oida.signal",
    "contract": "akouo/v0.8",
}])

# Shared store (platform application-data directory, 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)
    store.query(has_auditum=True)          # accountable v1.4 records
    store.query(has_disagreement=True)     # plural hearings with preserved differences

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.5.0.tar.gz (19.3 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.5.0-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for akousma-0.5.0.tar.gz
Algorithm Hash digest
SHA256 08934629b146703fdb4c8c49358ae8dcac6e705e6d8def4ea3084d5d7c2ea4f1
MD5 2ca847361f1fbfd6a6e91e46ac683cb2
BLAKE2b-256 af66a9d5aa7a8a48fbec79b9867a469b97f8427bca489fa870d06903bc47b6e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for akousma-0.5.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.5.0-py3-none-any.whl.

File metadata

  • Download URL: akousma-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 16.2 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.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 18c018b736fdde5c5b84cbded48e7ccd2a8a6b71000a1979b4d99ab124c09021
MD5 f5c7edb6d7065f8dbbcbde929862a89a
BLAKE2b-256 6ffc1712085b4fde70ce72e6495953f931d4b222f81c3616f811d180d6d01df0

See more details on using hashes here.

Provenance

The following attestation bundles were made for akousma-0.5.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