Datasette SQL functions for very simple HTML operations
Project description
datasette-simple-html
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) 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) 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for datasette-simple-html-0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | adabf13802b1f4b6ba0abcc23a17af8f91343db3e0057e92377efd6e804cc57d |
|
MD5 | 44629d9dc5348e8b851b427e56b02064 |
|
BLAKE2b-256 | db2b89c10a44ddc181066bd37a4a7b8b241cd6c49616f921b0ea18e576384701 |
Hashes for datasette_simple_html-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90e90ddfccdbbc589b94a0ac73a2e6c953b45bc6b29b415919d5da2fd7d01a05 |
|
MD5 | ddf4d3fc751f8345eddd2db4538c9311 |
|
BLAKE2b-256 | 02030179120566c3c26bb872c5442fa358180dfd06cb2d24507abfa83bffd427 |