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
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file keyword_search-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: keyword_search-0.0.2-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b52754844c24f949d0519538339b228d245751930e154cacf5eb8e37eeea2fc |
|
MD5 | 81ee973c595aa0080c337bcae34da229 |
|
BLAKE2b-256 | e4eaa21ac222b14ec7621395447d83066b929152d60aacf02f8088317b080ac7 |