Enrich data using regular expressions
Project description
datasette-enrichments-re2
Enrich data using regular expressions
Installation
Install this plugin in the same environment as Datasette.
datasette install datasette-enrichments-re2
Usage
This enrichment allows you to run a regular expression against a column and perform one of the following:
- Execute a search and replace against that column
- Extract the first matching result and store that in the specified column (adding a column if necessary)
- Extract all matching results and store them as a JSON array in the specified column. If the regular expression uses named capture groups this will be an array of objects, otherwise it will be an array of strings.
- Execute a regular expression with named capture groups and store the results in multiple columns, one for each of those named groups
Development
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
cd datasette-enrichments-re2
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
File details
Details for the file datasette-enrichments-re2-0.1.tar.gz
.
File metadata
- Download URL: datasette-enrichments-re2-0.1.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9fc84c940cca541ab5b697356cdb162a6fc1d46d2097431ceb4e74b3af8d6b5e |
|
MD5 | fab41c7ae909398554efcf2ca894cb69 |
|
BLAKE2b-256 | f2f8c6251040335b85a5179133fb81d38bc5a388f757cf1c37848363f90de52f |
File details
Details for the file datasette_enrichments_re2-0.1-py3-none-any.whl
.
File metadata
- Download URL: datasette_enrichments_re2-0.1-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08a854ee3d9359e31e9760af036f66c9cc0a47a04bbc79f3aa477be802ce6ca3 |
|
MD5 | d6ad6e03d94504f7ce482de1c9a02bec |
|
BLAKE2b-256 | 7b622faf00138b8700a71522f851513d7b4f646114b777236939c04a45d01c5c |