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.1a1.tar.gz (4.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.1a1-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: query_search-0.0.1a1.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

Hashes for query_search-0.0.1a1.tar.gz
Algorithm Hash digest
SHA256 516b246674f8853c80db5f3e7df4c5dead8a543b2083f8df29047e4c10310cb9
MD5 b0ba327cf36cd1da165b38dc2aa8d46a
BLAKE2b-256 457972a34031be6084a58ec415b92a7fc3141c3ddfe89ec5f21e3e1018f37de9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: query_search-0.0.1a1-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

Hashes for query_search-0.0.1a1-py3-none-any.whl
Algorithm Hash digest
SHA256 ae340636b3ad873cb1ecedfd83bfeee8e6a353758d79fc65e48084d5d727f949
MD5 dfaf17604f68e1629f35f38fbcd85ae1
BLAKE2b-256 de9ab63036bdb2dc23e259e2baaf613159241afec3fcbcb6581c9fcf26dfe524

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