Skip to main content

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


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

Uploaded Source

Built Distribution

searchkit-0.1.19-py3-none-any.whl (22.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