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 filter files, folders or pipe outputs 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.4.tar.gz (5.5 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.4-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file query_search-0.0.4.tar.gz.

File metadata

  • Download URL: query_search-0.0.4.tar.gz
  • Upload date:
  • Size: 5.5 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.4.tar.gz
Algorithm Hash digest
SHA256 6d38123ded741f5eb77f6b2998f81e229223b60d7e584171849d0fcb09ffc1df
MD5 5971df2105d8c94e0727edcbc6cca4f9
BLAKE2b-256 620416aa480872928091f96f16aa435fd831f6d8813616b8dac91c8609c9ac05

See more details on using hashes here.

File details

Details for the file query_search-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: query_search-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 5.9 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 64e62b68c17bca5133ec15d3402b14cfcedbf7a6a3b0166fdc41c2b5033acc17
MD5 81616e1b4d6025e9a7dd577ec2ed2f18
BLAKE2b-256 a601c7494dc97ff19fa2ba076b6f661ab018019c9e6f68705a620cd9b762b795

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