query-search


Namequery-search JSON
Version 0.0.4 PyPI version JSON
download
home_pageNone
SummaryA package to filter pipe outputs or text files like `grep` using sql syntax
upload_time2025-07-22 03:36:08
maintainerNone
docs_urlNone
authorDaniel Olson
requires_python>=3.10
licenseNone
keywords terminal query search grep sql
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## 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](#installation) <!-- - [Quick Start](#quick-start) -->
- [Learn by Example](#learn-by-example) 
- [Table Structure](#table-structure)
- [License](#license)

### Installation

`pip install query-search`

### Learn by Example

```shell
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')`)

<!--
### Replace Tool

A `qq replace` command was added because I often find myself 
wanting to replace a string like `#some_value = 'on'` to `some_value = 'off'`.

##### Example Usage

File Content:
```text
Hi kitty
```
Usage: `cat file.txt | qq replace "Hi" "Bye"`

Console Output:
```text
Bye kitty
```


*Note: if you are replacing a config file you may need to output into a temporary file as shell redirection truncates the output file before reading the input file. e.g.*
```bash
cat /etc/.../postgresql.conf | qq replace "#key = val" "key = val2" > ./postgresql.conf; cat ./postgresql.conf > /etc/.../postgresql.conf;rm ./postgresql.conf
```
-->
### License
* MIT License

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "query-search",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "terminal query search grep sql",
    "author": "Daniel Olson",
    "author_email": "daniel@orphos.cloud",
    "download_url": "https://files.pythonhosted.org/packages/62/04/16aa480872928091f96f16aa435fd831f6d8813616b8dac91c8609c9ac05/query_search-0.0.4.tar.gz",
    "platform": null,
    "description": "## Terminal Query Search\n\nThis package lets you query filter files, folders or pipe outputs using SQL syntax\n\nThis uses python's `sqlite3` module for querying\n\n### Table of Contents\n- [Installation](#installation) <!-- - [Quick Start](#quick-start) -->\n- [Learn by Example](#learn-by-example) \n- [Table Structure](#table-structure)\n- [License](#license)\n\n### Installation\n\n`pip install query-search`\n\n### Learn by Example\n\n```shell\ncat file.txt | qq \"where lower(line) like '%daniel%'\"\n# or\necho hello | qq \"select line from logs\"\n# or\necho hello | qq path:/path/to/some.sql\n# or\nqq \"where line like 'id: %'\" /path/to/my.txt\n# or \nqq \"select 'Line: ' || i as line_index, line from logs where line like 'id: %'\" /path/to/my.txt\n# or \nqq path:/path/to/some.sql /path/to/my.txt\n# or\nqq --folder /path/to/folder \"where line like '%important%'\"\n# or\nqq --folder /path/to/folder path:/path/to/some.sql\n```\n\n### Table Structure\n\n`CREATE TABLE logs (i int, line TEXT);`\n\n`i` Is the line index starting at `1`.\n\n`line` is the read stripped line (`line.strip('\\n')`)\n\n<!--\n### Replace Tool\n\nA `qq replace` command was added because I often find myself \nwanting to replace a string like `#some_value = 'on'` to `some_value = 'off'`.\n\n##### Example Usage\n\nFile Content:\n```text\nHi kitty\n```\nUsage: `cat file.txt | qq replace \"Hi\" \"Bye\"`\n\nConsole Output:\n```text\nBye kitty\n```\n\n\n*Note: if you are replacing a config file you may need to output into a temporary file as shell redirection truncates the output file before reading the input file. e.g.*\n```bash\ncat /etc/.../postgresql.conf | qq replace \"#key = val\" \"key = val2\" > ./postgresql.conf; cat ./postgresql.conf > /etc/.../postgresql.conf;rm ./postgresql.conf\n```\n-->\n### License\n* MIT License\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A package to filter pipe outputs or text files like `grep` using sql syntax",
    "version": "0.0.4",
    "project_urls": null,
    "split_keywords": [
        "terminal",
        "query",
        "search",
        "grep",
        "sql"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "a601c7494dc97ff19fa2ba076b6f661ab018019c9e6f68705a620cd9b762b795",
                "md5": "81616e1b4d6025e9a7dd577ec2ed2f18",
                "sha256": "64e62b68c17bca5133ec15d3402b14cfcedbf7a6a3b0166fdc41c2b5033acc17"
            },
            "downloads": -1,
            "filename": "query_search-0.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "81616e1b4d6025e9a7dd577ec2ed2f18",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 5886,
            "upload_time": "2025-07-22T03:36:08",
            "upload_time_iso_8601": "2025-07-22T03:36:08.168226Z",
            "url": "https://files.pythonhosted.org/packages/a6/01/c7494dc97ff19fa2ba076b6f661ab018019c9e6f68705a620cd9b762b795/query_search-0.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "620416aa480872928091f96f16aa435fd831f6d8813616b8dac91c8609c9ac05",
                "md5": "5971df2105d8c94e0727edcbc6cca4f9",
                "sha256": "6d38123ded741f5eb77f6b2998f81e229223b60d7e584171849d0fcb09ffc1df"
            },
            "downloads": -1,
            "filename": "query_search-0.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "5971df2105d8c94e0727edcbc6cca4f9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 5511,
            "upload_time": "2025-07-22T03:36:08",
            "upload_time_iso_8601": "2025-07-22T03:36:08.900113Z",
            "url": "https://files.pythonhosted.org/packages/62/04/16aa480872928091f96f16aa435fd831f6d8813616b8dac91c8609c9ac05/query_search-0.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-22 03:36:08",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "query-search"
}
        
Elapsed time: 1.10865s