Skip to main content

sonoscope

Installation

pip install sonoscope

or with uv:

uv add sonoscope

Usage

import numpy as np
from sonoscope import Sonoscope

# 1. From local file path (no HTTP server required, syncs via binary traitlets)
widget = Sonoscope.from_file("my_audio.wav")

# 2. From NumPy array and sample rate
sr = 22050
y = np.sin(2 * np.pi * 440 * np.linspace(0, 5, sr * 5, endpoint=False))
widget = Sonoscope.from_array(y, sample_rate=sr, cmap="plasma", frequency_scale="mel")

# 3. From remote URL
widget = Sonoscope.from_url("https://example.com/sample.mp3")

# Display in notebook
widget

Development

We recommend using uv for development. It will automatically manage virtual environments and dependencies for you.

uv run jupyter lab example.ipynb

Alternatively, create and manage your own virtual environment:

python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
jupyter lab example.ipynb

The widget front-end code bundles it's JavaScript dependencies. After setting up Python, make sure to install these dependencies locally:

npm install

While developing, you can run the following in a separate terminal to automatically rebuild JavaScript as you make changes:

npm run dev

Open example.ipynb in JupyterLab, VS Code, or your favorite editor to start developing. Changes made in js/ will be reflected in the notebook.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sonoscope-0.1.0.tar.gz (63.6 kB view details)

Uploaded Source

Built Distribution

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

sonoscope-0.1.0-py3-none-any.whl (64.3 kB view details)

Uploaded Python 3

File details

Details for the file sonoscope-0.1.0.tar.gz.

File metadata

  • Download URL: sonoscope-0.1.0.tar.gz
  • Upload date:
  • Size: 63.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for sonoscope-0.1.0.tar.gz
Algorithm Hash digest
SHA256 540ce7c82e37470b9eae2867f76bf774192648727e3e2812cc7aade6d2221671
MD5 13ce72cf10ec7e34991fca1683283cea
BLAKE2b-256 65ec737fb67c31784a44c502c8dd69d259455797267a9ce66d870dbc2a71119e

See more details on using hashes here.

Provenance

The following attestation bundles were made for sonoscope-0.1.0.tar.gz:

Publisher: release.yml on mbsantiago/sonoscope

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

File details

Details for the file sonoscope-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: sonoscope-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 64.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for sonoscope-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 14672469a99aeaa4abb5d42c3c0c80269897034e13d830392414108c7f7fce2e
MD5 2ebd54f17c38812cee07e44968b4428d
BLAKE2b-256 12f82d19a44e186b5207519ed504157510148482d450b623ccd5c45c8d4ecd96

See more details on using hashes here.

Provenance

The following attestation bundles were made for sonoscope-0.1.0-py3-none-any.whl:

Publisher: release.yml on mbsantiago/sonoscope

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