Configurable Datasette plugin running ripgrep
Project description
datasette-ripgrep
Configurable Datasette plugin running ripgrep
Demo
Try this plugin out at https://ripgrep.datasette.io/-/ripgrep - where you can run regular expression searches across the source code of Datasette and all of the datasette-*
plugins belonging to the simonw GitHub user.
Installation
Install this plugin in the same environment as Datasette.
$ datasette install datasette-ripgrep
The rg
executable needs to be installed such that it can be run by this tool.
Usage
This plugin requires configuration: it needs to a path
setting so that it knows where to run searches:
{
"plugins": {
"datasette-ripgrep": {
"path": "/path/to/your/files"
}
}
}
The plugin will add an interface at /-/ripgrep
for running searches.
Configuration
The "path"
configuration is required. Optional extra configuration options are:
time_limit
- floating point number. Therg
process will be terminated if it takes longer than this limit. The default is one second,1.0
.max_lines
- integer. Therg
process will be terminated if it returns more than this number of lines. The default is2000
.
Development
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
cd datasette-ripgrep
python3 -mvenv venv
source venv/bin/activate
Or if you are using pipenv
:
pipenv shell
Now install the dependencies and tests:
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_ripgrep-0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82e07e4a9f18261fcd9249f5e4cd41cb3b8402a56f8ce3be6d1991d04ee2fc17 |
|
MD5 | 6e4b7a4c676d8c40046d42b82774dc9d |
|
BLAKE2b-256 | bbca7904a5b32cff5ad956ff1263fe62d564cb11e4b7cb153fc7cb6f0ac3323e |