Skip to main content

peaksjs-widget

ipywidget to interact with audio waveforms through peaks.js

preview

Installation

You can install using pip:

pip install peaksjs_widget

Shortcuts

you can interact with the waveform/widgets with following shortcuts:

  • Navigation:
    • Ctrl + wheel: zoom
    • SHIFT + dbl-click: reset zoom
    • SHIFT + wheel: scroll waveform
    • arrow left/right: move playhead left/right
    • SHIFT + arrow left/right: move playhead left/right a lot.
  • Controls:
    • dbl-click: play from there
    • SPACE BAR: play/pause
  • Segments:
    • alt + click: add segment
    • SHIFT + click on a segment: remove segment
    • Ctrl + alt + click on a segment: edit segment's label
  • Points:
    • Ctrl + click: add point
    • SHIFT + click on a point: remove point
    • Ctrl + alt + click on a point: edit point's label

you can also drag points and segments' boundaries with the mouse to edit their position

Development Installation

Create a dev environment:

conda create -n peaksjs_widget-dev -c conda-forge nodejs yarn python jupyterlab
conda activate peaksjs_widget-dev

Install the python. This will also build the TS package.

pip install -e ".[test]"

When developing your extensions, you need to manually enable your extensions with the lab frontend. This is done by the command:

jupyter labextension develop --overwrite .
yarn run build

How to see your changes

Typescript:

If you use JupyterLab to develop then you can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the widget.

# Watch the source directory in one terminal, automatically rebuilding when needed
yarn run watch
# Run JupyterLab in another terminal
jupyter lab

After a change wait for the build to finish and then refresh your browser and the changes should take effect.

Python:

If you make a change to the python code then you will need to restart the notebook kernel to have it take effect.

Updating the version

To update the version, install tbump and use it to bump the version. By default it will also create a tag.

pip install tbump
tbump <new-version>

Publish the package

on npm

npm login 
npm publish

on pypi

rm -rf dist/
pyproject-build .
twine upload dist/peaksjs* -u k-tonal

Metadata

Release files for peaksjs_widget 0.2.1

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

Source distribution (sdist)

Source distribution for peaksjs_widget 0.2.1
File Size Uploaded Provenance Actions
peaksjs_widget-0.2.1.tar.gz 196.1 kB Without provenance Details for peaksjs_widget-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for peaksjs_widget 0.2.1
File Interpreter ABI Platform Actions
peaksjs_widget-0.2.1-py3-none-any.whl Python 3 none any Details for peaksjs_widget-0.2.1-py3-none-any.whl

Total release size: 470.7 kB

Release files / peaksjs_widget-0.2.1.tar.gz

Download URL peaksjs_widget-0.2.1.tar.gz
Size 196.1 kB
Tags Source
SHA-256 checksum
How to use checksums
fc00a39be9c5cf2aba7aa647accc700e52db23266cd9162f5f7fa7824bbf6762
BLAKE2b-256 checksum
How to use checksums
b554cb71d9402086242192f7013d65eb7d2ba5ab4846ef301c1c7fc419d72466
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.24.0

Release files / peaksjs_widget-0.2.1-py3-none-any.whl

Download URL peaksjs_widget-0.2.1-py3-none-any.whl
Size 274.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
822841004f10f0c2d290c2103fb3cd2997f9a5d7f988d215fdafd2b730cb8cb8
BLAKE2b-256 checksum
How to use checksums
cabf5a15e995e3bc703a8e8eb408ffcda819fd5491684ef8e15cdfc003eaf62f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.24.0

Security for peaksjs_widget 0.2.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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