query-search


Namequery-search JSON
Version 0.0.2 PyPI version JSON
download
home_pageNone
SummaryA package to filter pipe outputs or text files like `grep` using sql syntax
upload_time2025-07-14 20:54:35
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 files, folders or pipe outputs(like `grep`) 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/55/15/ebd0ca8919b0c2929a5ac21884b6b2ce55d670f44afcb25882d5ae1e598d/query_search-0.0.2.tar.gz",
    "platform": null,
    "description": "## Terminal Query Search\n\nThis package lets you query files, folders or pipe outputs(like `grep`) 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.2",
    "project_urls": null,
    "split_keywords": [
        "terminal",
        "query",
        "search",
        "grep",
        "sql"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "3eee7664082cb74dd1cc509dd87721a81ee07d2858559e5a207767f4b57584d3",
                "md5": "f6a6ca191964528be93176476cd34ba4",
                "sha256": "7091abcfb5dccf64b539fd214ec0219d6b7d628f197b559452cb46053f9fa0a5"
            },
            "downloads": -1,
            "filename": "query_search-0.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f6a6ca191964528be93176476cd34ba4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 5867,
            "upload_time": "2025-07-14T20:54:33",
            "upload_time_iso_8601": "2025-07-14T20:54:33.970671Z",
            "url": "https://files.pythonhosted.org/packages/3e/ee/7664082cb74dd1cc509dd87721a81ee07d2858559e5a207767f4b57584d3/query_search-0.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "5515ebd0ca8919b0c2929a5ac21884b6b2ce55d670f44afcb25882d5ae1e598d",
                "md5": "0e0b1013844b848c1787dd05776eb85e",
                "sha256": "86831455366aac41dde631aebf3af032ff62177f6b90d14424b13c721b5d83b4"
            },
            "downloads": -1,
            "filename": "query_search-0.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "0e0b1013844b848c1787dd05776eb85e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 5501,
            "upload_time": "2025-07-14T20:54:35",
            "upload_time_iso_8601": "2025-07-14T20:54:35.109898Z",
            "url": "https://files.pythonhosted.org/packages/55/15/ebd0ca8919b0c2929a5ac21884b6b2ce55d670f44afcb25882d5ae1e598d/query_search-0.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-14 20:54:35",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "query-search"
}
        
Elapsed time: 2.20638s