# datasette-simple-html
[![PyPI](https://img.shields.io/pypi/v/datasette-simple-html.svg)](https://pypi.org/project/datasette-simple-html/)
[![Changelog](https://img.shields.io/github/v/release/simonw/datasette-simple-html?include_prereleases&label=changelog)](https://github.com/simonw/datasette-simple-html/releases)
[![Tests](https://github.com/simonw/datasette-simple-html/workflows/Test/badge.svg)](https://github.com/simonw/datasette-simple-html/actions?query=workflow%3ATest)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/simonw/datasette-simple-html/blob/main/LICENSE)
Datasette SQL functions for very simple HTML operations
## Installation
Install this plugin in the same environment as Datasette.
datasette install datasette-simple-html
## Usage
This plugin provides the following SQL functions:
### html_strip_tags(text)
Returns the text with any `<...>` tags removed.
### html_escape(text)
Escapes any HTML special characters in the text, e.g. `>` becomes `>`. Uses [html.escape(text, quote=True)](https://docs.python.org/3/library/html.html#html.escape) from the Python standard library.
### html_unescape(text)
Unescapes any HTML special characters, so `>` becomes `>`. Also handles numeric entities, so `'` becomes `'`. Uses [html.unescape(text)](https://docs.python.org/3/library/html.html#html.unescape) from the Python standard library.
## Development
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
cd datasette-simple-html
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-simple-html",
"name": "datasette-simple-html",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "",
"author": "Simon Willison",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/63/d0/5862c7090f9faf1c5e193b44cbbbd0bb3f5facb667d93b98cab03205eac7/datasette-simple-html-0.2.tar.gz",
"platform": null,
"description": "# datasette-simple-html\n\n[![PyPI](https://img.shields.io/pypi/v/datasette-simple-html.svg)](https://pypi.org/project/datasette-simple-html/)\n[![Changelog](https://img.shields.io/github/v/release/simonw/datasette-simple-html?include_prereleases&label=changelog)](https://github.com/simonw/datasette-simple-html/releases)\n[![Tests](https://github.com/simonw/datasette-simple-html/workflows/Test/badge.svg)](https://github.com/simonw/datasette-simple-html/actions?query=workflow%3ATest)\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/simonw/datasette-simple-html/blob/main/LICENSE)\n\nDatasette SQL functions for very simple HTML operations\n\n## Installation\n\nInstall this plugin in the same environment as Datasette.\n\n datasette install datasette-simple-html\n\n## Usage\n\nThis plugin provides the following SQL functions:\n\n### html_strip_tags(text)\n\nReturns the text with any `<...>` tags removed.\n\n### html_escape(text)\n\nEscapes any HTML special characters in the text, e.g. `>` becomes `>`. Uses [html.escape(text, quote=True)](https://docs.python.org/3/library/html.html#html.escape) from the Python standard library.\n\n### html_unescape(text)\n\nUnescapes any HTML special characters, so `>` becomes `>`. Also handles numeric entities, so `'` becomes `'`. Uses [html.unescape(text)](https://docs.python.org/3/library/html.html#html.unescape) from the Python standard library.\n\n## Development\n\nTo set up this plugin locally, first checkout the code. Then create a new virtual environment:\n\n cd datasette-simple-html\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": "Datasette SQL functions for very simple HTML operations",
"version": "0.2",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "66ac4c2af864b63b83365b05e9916ee49b995ddd527c33996eca634c450a93d8",
"md5": "e124c0fcea5a0b5dfbbd5117f6cbf923",
"sha256": "bc6f2502bf935a16cda2c1d622ed8c4386bc830877f982409580658c20b5507a"
},
"downloads": -1,
"filename": "datasette_simple_html-0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e124c0fcea5a0b5dfbbd5117f6cbf923",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 6852,
"upload_time": "2023-03-12T17:31:55",
"upload_time_iso_8601": "2023-03-12T17:31:55.975489Z",
"url": "https://files.pythonhosted.org/packages/66/ac/4c2af864b63b83365b05e9916ee49b995ddd527c33996eca634c450a93d8/datasette_simple_html-0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "63d05862c7090f9faf1c5e193b44cbbbd0bb3f5facb667d93b98cab03205eac7",
"md5": "5e8cd49e81f313dbd94cc0ff6ee8a3cf",
"sha256": "09c05feff154d40415b61eb4adb7be8d473cb21f32563c10a961c19dcfcb8089"
},
"downloads": -1,
"filename": "datasette-simple-html-0.2.tar.gz",
"has_sig": false,
"md5_digest": "5e8cd49e81f313dbd94cc0ff6ee8a3cf",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 6806,
"upload_time": "2023-03-12T17:31:57",
"upload_time_iso_8601": "2023-03-12T17:31:57.538972Z",
"url": "https://files.pythonhosted.org/packages/63/d0/5862c7090f9faf1c5e193b44cbbbd0bb3f5facb667d93b98cab03205eac7/datasette-simple-html-0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-03-12 17:31:57",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "simonw",
"github_project": "datasette-simple-html",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "datasette-simple-html"
}