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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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