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

Uploaded Python 3

File details

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

File metadata

  • Download URL: query_search-0.0.1a2.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.1a2.tar.gz
Algorithm Hash digest
SHA256 1bac61efc7f1a306959bca321b60cf9aaf9d980b13858ea6df8ab7f51d0225b0
MD5 701b128db2874037ed42954b59deddd5
BLAKE2b-256 774932b3a152386d7853745f1c73e906711654de7223f88aa3d1ec927182f5dd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: query_search-0.0.1a2-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.1a2-py3-none-any.whl
Algorithm Hash digest
SHA256 199bd4a612ef53e6002dff6c0017f95c3772d5c539b0c8ec2dc4242b6e15b1a5
MD5 839e72b16cf3c1ef051460051d1ea8f9
BLAKE2b-256 89a16404ece23b1a0bddc6de0ed852d1025fe67b1237378ca9040550cdadb08d

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