Skip to main content

Enrich data using regular expressions

Project description

datasette-enrichments-re2

PyPI Changelog Tests License

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

datasette-enrichments-re2-0.1a0.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file datasette-enrichments-re2-0.1a0.tar.gz.

File metadata

File hashes

Hashes for datasette-enrichments-re2-0.1a0.tar.gz
Algorithm Hash digest
SHA256 82a94d81ec4c9e4ba9e9ae23359cff53839e89c759a0d3df27532e703a7d163e
MD5 cdc7f818b6967de69e20e3d643de874b
BLAKE2b-256 56de174321742b6af595208fed3c5f436bb721bf2b270ce2d1b9f0ca5e816bd6

See more details on using hashes here.

File details

Details for the file datasette_enrichments_re2-0.1a0-py3-none-any.whl.

File metadata

File hashes

Hashes for datasette_enrichments_re2-0.1a0-py3-none-any.whl
Algorithm Hash digest
SHA256 9cf578b2daf5dca66bbd70f474494088f0e2085d50602c2a9999c40a5899f894
MD5 2b2d3105f887e340c64d768122b879fb
BLAKE2b-256 558a183cd272d9bec193688f629bd6d739a378459befb39f22eafa4ad401ce7b

See more details on using hashes here.

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