# datasette-youtube-embed
[![PyPI](https://img.shields.io/pypi/v/datasette-youtube-embed.svg)](https://pypi.org/project/datasette-youtube-embed/)
[![Changelog](https://img.shields.io/github/v/release/simonw/datasette-youtube-embed?include_prereleases&label=changelog)](https://github.com/simonw/datasette-youtube-embed/releases)
[![Tests](https://github.com/simonw/datasette-youtube-embed/workflows/Test/badge.svg)](https://github.com/simonw/datasette-youtube-embed/actions?query=workflow%3ATest)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/simonw/datasette-youtube-embed/blob/main/LICENSE)
Turn YouTube URLs into embedded players in Datasette
## Installation
Install this plugin in the same environment as Datasette.
datasette install datasette-youtube-embed
## Usage
Once installed, any columns containing URLs that look like one of these:
- `https://www.youtube.com/watch?v=xyz`
- `https://www.youtube.com/watch?v=xyz&start=30`
- `https://www.youtube.com/watch?v=xyz&start=30&end=50`
Will be turned into YouTube embeds like this:
```html
<lite-youtube videoid="xyz" params="start=30" style="min-width: 200px"></lite-youtube>
```
These will then be rendered using [Lite YouTube Embed](https://github.com/paulirish/lite-youtube-embed), which avoids loading the full YouTube embed until someone interacts with it.
## Development
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:
pytest
Raw data
{
"_id": null,
"home_page": "https://github.com/simonw/datasette-youtube-embed",
"name": "datasette-youtube-embed",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "",
"author": "Simon Willison",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/6c/9c/69309d38e27ac5db3db3665733ec90f81d41ad17482e5b3296225dee774b/datasette-youtube-embed-0.1.tar.gz",
"platform": null,
"description": "# datasette-youtube-embed\n\n[![PyPI](https://img.shields.io/pypi/v/datasette-youtube-embed.svg)](https://pypi.org/project/datasette-youtube-embed/)\n[![Changelog](https://img.shields.io/github/v/release/simonw/datasette-youtube-embed?include_prereleases&label=changelog)](https://github.com/simonw/datasette-youtube-embed/releases)\n[![Tests](https://github.com/simonw/datasette-youtube-embed/workflows/Test/badge.svg)](https://github.com/simonw/datasette-youtube-embed/actions?query=workflow%3ATest)\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/simonw/datasette-youtube-embed/blob/main/LICENSE)\n\nTurn YouTube URLs into embedded players in Datasette\n\n## Installation\n\nInstall this plugin in the same environment as Datasette.\n\n datasette install datasette-youtube-embed\n\n## Usage\n\nOnce installed, any columns containing URLs that look like one of these:\n\n- `https://www.youtube.com/watch?v=xyz`\n- `https://www.youtube.com/watch?v=xyz&start=30`\n- `https://www.youtube.com/watch?v=xyz&start=30&end=50`\n\nWill be turned into YouTube embeds like this:\n\n```html\n<lite-youtube videoid=\"xyz\" params=\"start=30\" style=\"min-width: 200px\"></lite-youtube>\n```\nThese will then be rendered using [Lite YouTube Embed](https://github.com/paulirish/lite-youtube-embed), which avoids loading the full YouTube embed until someone interacts with it.\n\n## Development\n\nTo set up this plugin locally, first checkout the code. Then create a new virtual environment:\n\n cd datasette-youtube-embed\n python3 -m venv venv\n source venv/bin/activate\n\nNow install the dependencies and test dependencies:\n\n pip install -e '.[test]'\n\nTo run the tests:\n\n pytest\n",
"bugtrack_url": null,
"license": "Apache License, Version 2.0",
"summary": "Turn YouTube URLs into embedded players in Datasette",
"version": "0.1",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d3c058b3d4b7bedac73e4e3b7e374026e589710dbb8ad047f6a8888da1c4bea4",
"md5": "c2dd42b24cd3a231a256a16d1ed067a3",
"sha256": "6a80574693c2c9ac8b21d6ceaa0d22f2b4ba4802807297bfb34b45c29ac81c6e"
},
"downloads": -1,
"filename": "datasette_youtube_embed-0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c2dd42b24cd3a231a256a16d1ed067a3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 11185,
"upload_time": "2023-01-27T20:10:28",
"upload_time_iso_8601": "2023-01-27T20:10:28.155292Z",
"url": "https://files.pythonhosted.org/packages/d3/c0/58b3d4b7bedac73e4e3b7e374026e589710dbb8ad047f6a8888da1c4bea4/datasette_youtube_embed-0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6c9c69309d38e27ac5db3db3665733ec90f81d41ad17482e5b3296225dee774b",
"md5": "90eb45ad9a0a4a95484bff65eedfe110",
"sha256": "ef525cf1ff032504d476b18d35084f623bb714161affe6d1db0332db427489e7"
},
"downloads": -1,
"filename": "datasette-youtube-embed-0.1.tar.gz",
"has_sig": false,
"md5_digest": "90eb45ad9a0a4a95484bff65eedfe110",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 10144,
"upload_time": "2023-01-27T20:10:29",
"upload_time_iso_8601": "2023-01-27T20:10:29.714118Z",
"url": "https://files.pythonhosted.org/packages/6c/9c/69309d38e27ac5db3db3665733ec90f81d41ad17482e5b3296225dee774b/datasette-youtube-embed-0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-01-27 20:10:29",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "simonw",
"github_project": "datasette-youtube-embed",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "datasette-youtube-embed"
}