Skip to main content

CI PyPI - Version PyPI - Python Version

pydsscodec

Python bindings for the Rust dss-codec decoder.

pydsscodec decodes Olympus DSS and DS2 audio, including Grundig/PH9607 DSS, directly in Python through a native Rust extension. It mirrors the core dss-codec model: top-level decode and decrypt functions plus streaming decoders.

Features

  • Decode DSS SP, Grundig DSS SP, DS2 SP, DS2 QP, and DS2 QP7 files from paths or bytes
  • Normalize encrypted DS2 input back to plain container bytes
  • Inspect format, native sample rate, and encryption metadata without decoding
  • Stream decode in chunks without forcing a whole-file convenience path
  • Load native Rust code in-process instead of shelling out to a CLI
  • In our benchmark, achieved roughly 150x faster DSS decoding and 50x faster streamed DS2 decoding than the reference Python decoders

Installation

pip install pydsscodec

If a prebuilt wheel is not available for your platform, installation will build the Rust extension locally.

Prebuilt wheels are currently published for:

  • Linux x86_64
  • macOS arm64
  • Windows x86_64

Other platforms install from source and require Rust 1.85 or newer.

Usage

Decode a file:

from pydsscodec import decode_file

audio = decode_file("recording.ds2")
print(audio.format, audio.sample_rate, audio.native_rate, audio.duration_seconds)
print(audio.sample_count)

Decode in-memory bytes:

from pydsscodec import decode_bytes

audio = decode_bytes(data)

Decrypt encrypted DS2 input to plain container bytes:

from pydsscodec import decrypt_file

plain_ds2 = decrypt_file("encrypted.ds2", password="secret")

Stream decode in chunks:

from pydsscodec import DecryptingDecoderStreamer

decoder = DecryptingDecoderStreamer(password="secret")

with open("recording.ds2", "rb") as handle:
    while chunk := handle.read(4096):
        chunk_samples = decoder.push(chunk)
        # process chunk_samples here

final_samples = decoder.finish()

print(decoder.format(), decoder.native_rate(), len(final_samples))

Detect the container format without decoding:

from pydsscodec import detect_format

fmt = detect_format(data)
print(fmt)  # e.g. "dss_sp", "grundig_sp", "ds2_sp", "ds2_qp", or "ds2_qp7"

Inspect format and encryption metadata without decoding:

from pydsscodec import inspect_file

info = inspect_file("recording.ds2")
print(info.format, info.native_rate, info.encryption, info.encryption_mode)

API

Top-level functions:

  • decode_file(path, password=None) -> DecodedAudio
  • decode_bytes(data, password=None) -> DecodedAudio
  • decrypt_file(path, password=None) -> bytes
  • decrypt_bytes(data, password=None) -> bytes
  • detect_format(data) -> str | None
  • inspect_file(path) -> FileInfo
  • inspect_bytes(data) -> FileInfo

Streamer classes:

  • StreamingDecoder()
  • DecryptStreamer(password=None)
  • DecryptingDecoderStreamer(password=None)

Streamer methods mirror the Rust API:

  • push(data)
  • finish()
  • format()
  • native_rate()

Bulk decode returns a DecodedAudio object with:

  • samples: decoded mono samples as list[float]
  • sample_rate: sample rate of the returned samples
  • native_rate: original sample rate of the source codec
  • format: one of "dss_sp", "grundig_sp", "ds2_sp", "ds2_qp", or "ds2_qp7"
  • sample_count
  • duration_seconds

Inspection returns a FileInfo object with:

  • format: detected audio format
  • native_rate: native sample rate in Hz
  • encryption: "none", "ds2_aes128", "ds2_aes256", or "unknown"
  • encryption_mode: the numeric DS2 encryption mode, or None for plain input

Notes

  • The streaming classes are the preferred scalable interface for large inputs.
  • Bulk decode returns samples as a Python list.

Metadata

Release files for pydsscodec 0.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pydsscodec 0.1.8
File Size Uploaded Provenance
pydsscodec-0.1.8.tar.gz 2.5 MB With provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for pydsscodec 0.1.8
File Interpreter ABI Platform
pydsscodec-0.1.8-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
pydsscodec-0.1.8-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details
pydsscodec-0.1.8-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details

Total release size: 3.5 MB

Release files / pydsscodec-0.1.8.tar.gz

Download URL pydsscodec-0.1.8.tar.gz
Size 2.5 MB
Tags Source
SHA-256 checksum
How to use checksums
089dbf9283839058745794af9c6e4395212c4640481a18eb92fc10e4b0a88a9a
BLAKE2b-256 checksum
How to use checksums
44824c3580da6548e8d16ff5ceb47e1d3c5093e55f6f8062fd78ba570af26695
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 19, 2026.

Transparency log

Release files / pydsscodec-0.1.8-cp39-abi3-win_amd64.whl

Download URL pydsscodec-0.1.8-cp39-abi3-win_amd64.whl
Size 255.6 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
ae3a197445dd40c9d0c1ff13b9ced57b2735b4e93c13e4680f97d4c23078f02e
BLAKE2b-256 checksum
How to use checksums
5e8a86ac8437208c4cf6d0b3a4a5a4bf70bcc3f032f7b654d3630b52a83509da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 19, 2026.

Transparency log

Release files / pydsscodec-0.1.8-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pydsscodec-0.1.8-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 411.5 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
d7308c38c1e922bba1f20a35a1123d16b49364c051f51e1a25265e39bdb36a98
BLAKE2b-256 checksum
How to use checksums
0eaa295674bafc7497cedfc588302fc2d139d8310bd6c30ac3d0a427e6f9fdeb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 19, 2026.

Transparency log

Release files / pydsscodec-0.1.8-cp39-abi3-macosx_11_0_arm64.whl

Download URL pydsscodec-0.1.8-cp39-abi3-macosx_11_0_arm64.whl
Size 354.0 kB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c44054de2479f35e89e425a0e41ffc3eccb668783c28dfcac80eebe5cf1981ef
BLAKE2b-256 checksum
How to use checksums
3b4764f97c97a111ca4bb5eb27829111ea6fb49903dfefa56936e88bf9af6c46
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 19, 2026.

Transparency log

Security for pydsscodec 0.1.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 4 files in this release have been uploaded with provenance metadata.

Select from 4 files

Attestation for pydsscodec-0.1.8.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page