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 details)

Uploaded Python 3

File details

Details for the file keyword_search-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for keyword_search-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1b52754844c24f949d0519538339b228d245751930e154cacf5eb8e37eeea2fc
MD5 81ee973c595aa0080c337bcae34da229
BLAKE2b-256 e4eaa21ac222b14ec7621395447d83066b929152d60aacf02f8088317b080ac7

See more details on using hashes here.

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