A package to filter pipe outputs or text files like `grep` using sql syntax
Project description
Terminal Query Search
This package lets you query files, folders or pipe outputs(like grep) using SQL syntax
This uses python's sqlite3 module for querying
Table of Contents
Installation
pip install query-search
Learn by Example
cat file.txt | qq "where lower(line) like '%daniel%'"
# or
echo hello | qq "select line from logs"
# or
echo hello | qq path:/path/to/some.sql
# or
qq "where line like 'id: %'" /path/to/my.txt
# or
qq "select 'Line: ' || i as line_index, line from logs where line like 'id: %'" /path/to/my.txt
# or
qq path:/path/to/some.sql /path/to/my.txt
# or
qq --folder /path/to/folder "where line like '%important%'"
# or
qq --folder /path/to/folder path:/path/to/some.sql
Table Structure
CREATE TABLE logs (i int, line TEXT);
i Is the line index starting at 1.
line is the read stripped line (line.strip('\n'))
License
- MIT License
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file query_search-0.0.1.tar.gz.
File metadata
- Download URL: query_search-0.0.1.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c2a1024457e9c05cc3ad313c634dd4eba259b73cf2fe87d61761a129b9e54d5
|
|
| MD5 |
d3ccd7d1a5ae110ad1b3d64974bcb3f7
|
|
| BLAKE2b-256 |
337bf29299bdb8c6d9814a4804bc9d5fec511a873d1365b26dd9e8b50466c47c
|
File details
Details for the file query_search-0.0.1-py3-none-any.whl.
File metadata
- Download URL: query_search-0.0.1-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
305c99b31f0a6ef16608f9a82699b803b21c72c64cd4370bb88cade512c1c5b3
|
|
| MD5 |
f56597ad9a373a376e3eab9318b4c3fc
|
|
| BLAKE2b-256 |
e1b99134178c7fca502c5c9782b4f9ff5cec5f31cdeea13cbe376721273b954d
|