Turn .mp3 URLs into an audio player in the Datasette interface
Project description
datasette-mp3-audio
Turn .mp3 URLs into an audio player in the Datasette interface
Installation
Install this plugin in the same environment as Datasette.
datasette install datasette-mp3-audio
Demo
Try this plugin at https://scotrail.datasette.io/scotrail/announcements
The demo uses ScotRail train announcements from matteason/scotrail-announcements-june-2022.
Usage
Once installed, any cells with a value that ends in .mp3
and starts with either http://
or /
or https://
will be turned into an embedded HTML audio element like this:
<audio controls src="... value ...">Audio not supported</audio>
A "Play X MP3s on this page" button will be added to athe top of any table page listing more than one MP3.
Development
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
cd datasette-mp3-audio
python3 -m venv venv
source venv/bin/activate
Now install the dependencies and test dependencies:
pip install -e '.[test]'
To run the tests:
pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file datasette-mp3-audio-0.2.tar.gz
.
File metadata
- Download URL: datasette-mp3-audio-0.2.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2bde11a81a21fbc64935d1ddb03a49e26abd48adefd5e06c945571c913af0a8 |
|
MD5 | 810b58b8cd5ee365d10571d01f45299d |
|
BLAKE2b-256 | 73f0b2722cf1c6d14107e417fb69a3b5b65b10a43238a1009682b71714545166 |
File details
Details for the file datasette_mp3_audio-0.2-py3-none-any.whl
.
File metadata
- Download URL: datasette_mp3_audio-0.2-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81db086b632b3a0eec01c0c9bd755d27177c6c846d07e743ec3aedd179633c3c |
|
MD5 | c34a7d782740a6ce1dfababf94280a3e |
|
BLAKE2b-256 | 8341e2aec5660d5146c0dbc45cf63c546599856ddf28ba2584aa97f96bf0b2ec |