Skip to main content

A keyword search for CSV/Excel/Pandas

Project description

Keyword Search

A keyword search package for CSV/Excel/Pandas using boolean expressions.

  • It works by processing a query string with field indicator for Pandas Dataframe columns.

  • Currently, only .str.contains queries are performed.

  • Boolean operations (and, or, and not) are mantained during compilation, following Pandas sintax.

  • All further work is done by the Pandas DataFrame.query method.

Searched field should not contain spaces or :.

Examples:

((title:leptospira) and (abstract:vaccine))

Installation

$ pip install keyword-search

Using as a Python package

from keyword_search.query import keyword_search

df_results = keyword_search(df, "(title:Leptospirosis)")
print(df_results)

Using as a CLI application

$ keyword-query papers.csv "(title:leptospira) or (abstract:leptospira)" --delimiter ";" --output results.csv

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

keyword_search-0.0.2-py3-none-any.whl (3.6 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