Library provided tools used to search files concurrently.
Project description
Searchkit
Python library providing tools to perform searches on files in parallel.
Search Library
The following classes are provided:
FileSearcher
The main search engine. Register one or more SearchDef objects against one or more path then execute in parallel.
SearchDef
A simple search definition. Can be tagged to easily retrieve results.
SequenceSearchDef
A multi-line search definition that takes into account sequences by matching start, body and end.
SearchResultsCollection
A collection of search results that can be queried in a number of ways for easy retrieval.
Installation
searchkit is packaged in PyPI and can be installed as follows:
sudo apt install python3-pip
pip install searchkit
Example Usage
from searchkit import FileSearcher, SearchDef
with open('foo', 'w') as fd:
fd.write('the quick brown fox')
fs = FileSearcher()
fs.add(SearchDef(r'.+ \S+ (\S+) .+'), fd.name)
results = fs.run()
for r in results.find_by_path(fd.name):
print(r.get(1))
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
searchkit-0.1.17.tar.gz
(21.9 kB
view hashes)
Built Distribution
searchkit-0.1.17-py3-none-any.whl
(22.8 kB
view hashes)
Close
Hashes for searchkit-0.1.17-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 799e2fc6a962030715f77ae180a02b823be62135fc613d51095c3e93a58c3447 |
|
MD5 | 91b9edf1fd88f902e27148b9ae6a875b |
|
BLAKE2b-256 | 1b6e4aaf0e634f9589ef15338fe22a1a9b07565fd5495dc91c33e66917d5b52c |