Skip to main content

Turn .mp3 URLs into an audio player in the Datasette interface

Project description

datasette-mp3-audio

PyPI Changelog Tests License

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


Download files

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

Source Distribution

datasette-mp3-audio-0.2.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

datasette_mp3_audio-0.2-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

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

Hashes for datasette-mp3-audio-0.2.tar.gz
Algorithm Hash digest
SHA256 e2bde11a81a21fbc64935d1ddb03a49e26abd48adefd5e06c945571c913af0a8
MD5 810b58b8cd5ee365d10571d01f45299d
BLAKE2b-256 73f0b2722cf1c6d14107e417fb69a3b5b65b10a43238a1009682b71714545166

See more details on using hashes here.

File details

Details for the file datasette_mp3_audio-0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for datasette_mp3_audio-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 81db086b632b3a0eec01c0c9bd755d27177c6c846d07e743ec3aedd179633c3c
MD5 c34a7d782740a6ce1dfababf94280a3e
BLAKE2b-256 8341e2aec5660d5146c0dbc45cf63c546599856ddf28ba2584aa97f96bf0b2ec

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page