datasette-youtube-embed by simonw

3 downloads this week        Star

README source code


PyPI Changelog Tests License

Turn YouTube URLs into embedded players in Datasette


Install this plugin in the same environment as Datasette.

datasette install datasette-youtube-embed


Once installed, any columns containing URLs that look like one of these:


Will be turned into YouTube embeds like this:

<lite-youtube videoid="xyz" params="start=30" style="min-width: 200px"></lite-youtube>

These will then be rendered using Lite YouTube Embed, which avoids loading the full YouTube embed until someone interacts with it.


To set up this plugin locally, first checkout the code. Then create a new virtual environment:

cd datasette-youtube-embed
python3 -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

pip install -e '.[test]'

To run the tests: