Skip to main content

Datasette SQL functions for very simple HTML operations

Project description

datasette-simple-html

PyPI Changelog Tests 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 &gt;. Uses html.escape(text, quote=True) from the Python standard library.

html_unescape(text)

Unescapes any HTML special characters, so &gt; becomes >. Also handles numeric entities, so &#x27; becomes '. Uses html.unescape(text) 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

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-simple-html-0.2.tar.gz (6.8 kB view hashes)

Uploaded Source

Built Distribution

datasette_simple_html-0.2-py3-none-any.whl (6.9 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