# datasette-sqlite-url-lite
[![PyPI](https://img.shields.io/pypi/v/datasette-sqlite-url-lite.svg)](https://pypi.org/project/datasette-sqlite-url-lite/)
[![Changelog](https://img.shields.io/github/v/release/simonw/datasette-sqlite-url-lite?include_prereleases&label=changelog)](https://github.com/simonw/datasette-sqlite-url-lite/releases)
[![Tests](https://github.com/simonw/datasette-sqlite-url-lite/workflows/Test/badge.svg)](https://github.com/simonw/datasette-sqlite-url-lite/actions?query=workflow%3ATest)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/simonw/datasette-sqlite-url-lite/blob/main/LICENSE)
A pure Python alternative to [sqlite-url](https://github.com/asg017/sqlite-url) ready to be used in [Datasette Lite](https://lite.datasette.io/)
## Installation
Install this plugin in the same environment as Datasette.
datasette install datasette-sqlite-url-lite
Or add it to Datasette Lite with `https://lite.datasette.io/?install=datasette-sqlite-url-lite`.
## Usage
This plugin adds the following SQL functions:
```sql
select url_valid('https://sqlite.org'); -- 1
select url_scheme('https://www.sqlite.org/vtab.html#usage'); -- 'https'
select url_host('https://www.sqlite.org/vtab.html#usage'); -- 'www.sqlite.org'
select url_path('https://www.sqlite.org/vtab.html#usage'); -- '/vtab.html'
select url_fragment('https://www.sqlite.org/vtab.html#usage'); -- 'usage'
```
## Development
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
cd datasette-sqlite-url-lite
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-sqlite-url-lite",
"name": "datasette-sqlite-url-lite",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "",
"author": "Simon Willison",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/59/82/b6b54a4573cdb0b8a437fb74615624d537b6cf92f0164e0eb13647d1574f/datasette-sqlite-url-lite-0.1.tar.gz",
"platform": null,
"description": "# datasette-sqlite-url-lite\n\n[![PyPI](https://img.shields.io/pypi/v/datasette-sqlite-url-lite.svg)](https://pypi.org/project/datasette-sqlite-url-lite/)\n[![Changelog](https://img.shields.io/github/v/release/simonw/datasette-sqlite-url-lite?include_prereleases&label=changelog)](https://github.com/simonw/datasette-sqlite-url-lite/releases)\n[![Tests](https://github.com/simonw/datasette-sqlite-url-lite/workflows/Test/badge.svg)](https://github.com/simonw/datasette-sqlite-url-lite/actions?query=workflow%3ATest)\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/simonw/datasette-sqlite-url-lite/blob/main/LICENSE)\n\nA pure Python alternative to [sqlite-url](https://github.com/asg017/sqlite-url) ready to be used in [Datasette Lite](https://lite.datasette.io/)\n\n## Installation\n\nInstall this plugin in the same environment as Datasette.\n\n datasette install datasette-sqlite-url-lite\n\nOr add it to Datasette Lite with `https://lite.datasette.io/?install=datasette-sqlite-url-lite`.\n\n## Usage\n\nThis plugin adds the following SQL functions:\n\n```sql\nselect url_valid('https://sqlite.org'); -- 1\nselect url_scheme('https://www.sqlite.org/vtab.html#usage'); -- 'https'\nselect url_host('https://www.sqlite.org/vtab.html#usage'); -- 'www.sqlite.org'\nselect url_path('https://www.sqlite.org/vtab.html#usage'); -- '/vtab.html'\nselect url_fragment('https://www.sqlite.org/vtab.html#usage'); -- 'usage'\n```\n\n## Development\n\nTo set up this plugin locally, first checkout the code. Then create a new virtual environment:\n\n cd datasette-sqlite-url-lite\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": "A pure Python alternative to sqlite-url ready to be used in Datasette Lite",
"version": "0.1",
"project_urls": {
"CI": "https://github.com/simonw/datasette-sqlite-url-lite/actions",
"Changelog": "https://github.com/simonw/datasette-sqlite-url-lite/releases",
"Homepage": "https://github.com/simonw/datasette-sqlite-url-lite",
"Issues": "https://github.com/simonw/datasette-sqlite-url-lite/issues"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a792eb9280ceb81a5935a176c175807bad91285d5aca8c49cf40ccc5ab699bb0",
"md5": "9996735dcd3b4a5e012ee71a498c3574",
"sha256": "f502b4529ceddb151e10b9779ca801699b6bf84a44e88130d880d958d3695ead"
},
"downloads": -1,
"filename": "datasette_sqlite_url_lite-0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9996735dcd3b4a5e012ee71a498c3574",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 6892,
"upload_time": "2023-05-26T14:50:36",
"upload_time_iso_8601": "2023-05-26T14:50:36.936821Z",
"url": "https://files.pythonhosted.org/packages/a7/92/eb9280ceb81a5935a176c175807bad91285d5aca8c49cf40ccc5ab699bb0/datasette_sqlite_url_lite-0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5982b6b54a4573cdb0b8a437fb74615624d537b6cf92f0164e0eb13647d1574f",
"md5": "18188838b60882ad44e59a96ad902f4d",
"sha256": "c906348faf14b7a18b71238c7f8b60f2da5ad5ead95c49a904794014026a8b23"
},
"downloads": -1,
"filename": "datasette-sqlite-url-lite-0.1.tar.gz",
"has_sig": false,
"md5_digest": "18188838b60882ad44e59a96ad902f4d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 6765,
"upload_time": "2023-05-26T14:50:38",
"upload_time_iso_8601": "2023-05-26T14:50:38.665943Z",
"url": "https://files.pythonhosted.org/packages/59/82/b6b54a4573cdb0b8a437fb74615624d537b6cf92f0164e0eb13647d1574f/datasette-sqlite-url-lite-0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-05-26 14:50:38",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "simonw",
"github_project": "datasette-sqlite-url-lite",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "datasette-sqlite-url-lite"
}