Skip to main content

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


Download files

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

Source Distribution

query_search-0.0.1a3.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

query_search-0.0.1a3-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file query_search-0.0.1a3.tar.gz.

File metadata

  • Download URL: query_search-0.0.1a3.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for query_search-0.0.1a3.tar.gz
Algorithm Hash digest
SHA256 846a7978a423974aec644b442510691dce9678114b078fcb7be998e50baddd40
MD5 068ba35e32eff06a8b203f314d0803fe
BLAKE2b-256 5ba154edf2b070fd822a1ae63773ce927cc3e062f868a7fb663398b33ca45307

See more details on using hashes here.

File details

Details for the file query_search-0.0.1a3-py3-none-any.whl.

File metadata

  • Download URL: query_search-0.0.1a3-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for query_search-0.0.1a3-py3-none-any.whl
Algorithm Hash digest
SHA256 ab21fecfafa30c2f120477932772a78b9428d9be2bf22efa56e9009b013b3064
MD5 b33283a05fd48e1c40ef183c0e862b0f
BLAKE2b-256 d918fdb3e970b5d1f3b0b3d61c0174f236aec7535c9b4382e9318137929a68fe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page