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.1.tar.gz (9.0 kB view hashes)

Uploaded Source

Built Distribution

datasette_enrichments_re2-0.1-py3-none-any.whl (8.8 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