# Querify
![Build Status](https://github.com/badihio/querify/actions/workflows/deploy.yml/badge.svg)
Querify is a CLI tool that provides SQL interface for data sources.
It is useful for data manipulation using a standard interface for various data sources, and provides an SQL features that allows to query the data in a more convenient way, like `WHERE`, `GROUP BY`, `ORDER BY` and `LIMIT`.
## Installation
Use the package manager [pip](https://pip.pypa.io/en/stable/) to install foobar.
```bash
pip install sql-querify
```
## Usage
```bash
qy <query>
```
## Examples
#### List all tables
```bash
qy "SHOW tables"
```
| table_name |
| ------ |
| dirs |
| files |
| processes |
#### Describe a table
```bash
qy "DESC processes"
```
| field_name | data_type |
| ------ | ------ |
| pid| int |
| name| str|
| cmdline| str|
| status| str|
| username | str |
| cpu_pct | float|
| memory_pct | float |
| create_time| datetime |
#### Count processes by username
```bash
qy "SELECT username, COUNT(1) AS count FROM processes GROUP BY username ORDER BY count DESC"
```
| username | count |
| ------ | ------ |
| user1 |443 |
| root|215 |
#### Top 5 directories by size
```bash
qy "SELECT name, size_in_bytes/1024/1024 AS size_mb FROM dirs ORDER BY size_mb DESC LIMIT 5"
```
| name | size_mb |
| ------ | ------ |
| pydantic_core|4 |
| chardet|1 |
| distlib|1 |
| _vendor/rich/__pycache__ |1 |
| pip/_vendor/chardet|1 |
## Contributing
Pull requests are welcome. For major changes, please open an issue first
to discuss what you would like to change.
Raw data
{
"_id": null,
"home_page": "https://github.com/badihio/querify",
"name": "sql-querify",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.11",
"maintainer_email": null,
"keywords": "cli, sql, query",
"author": "Ohad Badihi",
"author_email": "badihio@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/7a/77/0ccd164660a0f22eb0954970c3b927efbe610aa4c13afdca38c648ec0425/sql_querify-0.1.2.tar.gz",
"platform": null,
"description": "# Querify\n![Build Status](https://github.com/badihio/querify/actions/workflows/deploy.yml/badge.svg)\n\nQuerify is a CLI tool that provides SQL interface for data sources.\nIt is useful for data manipulation using a standard interface for various data sources, and provides an SQL features that allows to query the data in a more convenient way, like `WHERE`, `GROUP BY`, `ORDER BY` and `LIMIT`.\n\n## Installation\nUse the package manager [pip](https://pip.pypa.io/en/stable/) to install foobar.\n\n```bash\npip install sql-querify\n```\n## Usage\n\n```bash\nqy <query>\n```\n\n## Examples\n#### List all tables\n```bash\nqy \"SHOW tables\"\n```\n| table_name |\n| ------ |\n| dirs | \n| files |\n| processes |\n\n#### Describe a table\n```bash\nqy \"DESC processes\"\n```\n| field_name | data_type |\n| ------ | ------ |\n| pid| int |\n| name| str|\n| cmdline| str|\n| status| str|\n| username | str |\n| cpu_pct | float|\n| memory_pct | float |\n| create_time| datetime |\n\n#### Count processes by username\n```bash\nqy \"SELECT username, COUNT(1) AS count FROM processes GROUP BY username ORDER BY count DESC\"\n```\n| username | count |\n| ------ | ------ |\n| user1 |443 |\n| root|215 |\n\n#### Top 5 directories by size\n```bash\nqy \"SELECT name, size_in_bytes/1024/1024 AS size_mb FROM dirs ORDER BY size_mb DESC LIMIT 5\"\n```\n| name | size_mb |\n| ------ | ------ |\n| pydantic_core|4 |\n| chardet|1 |\n| distlib|1 |\n| _vendor/rich/__pycache__ |1 |\n| pip/_vendor/chardet|1 |\n\n## Contributing\n\nPull requests are welcome. For major changes, please open an issue first\nto discuss what you would like to change.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "An SQL interface for your everyday data",
"version": "0.1.2",
"project_urls": {
"Homepage": "https://github.com/badihio/querify",
"Repository": "https://github.com/badihio/querify"
},
"split_keywords": [
"cli",
" sql",
" query"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b9958beabe92a522f6bc9ebd83dc66bc4a0fe81faa30d10499f0e3cfc1e6309b",
"md5": "aba4eba85d10620f08b99bb2c63e1e75",
"sha256": "0df7e04e5c92a4c3184814c5874ae3fa1a490bef5a7b2b5e47c4a84904d7fdc2"
},
"downloads": -1,
"filename": "sql_querify-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "aba4eba85d10620f08b99bb2c63e1e75",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.11",
"size": 20452,
"upload_time": "2024-07-21T14:08:51",
"upload_time_iso_8601": "2024-07-21T14:08:51.807029Z",
"url": "https://files.pythonhosted.org/packages/b9/95/8beabe92a522f6bc9ebd83dc66bc4a0fe81faa30d10499f0e3cfc1e6309b/sql_querify-0.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7a770ccd164660a0f22eb0954970c3b927efbe610aa4c13afdca38c648ec0425",
"md5": "656d0214bf711c35abef481bd4c41870",
"sha256": "dce1a875893ec36c3ac12e0404df980685eb9e4e76e6b1ea18f4232d663f6b5a"
},
"downloads": -1,
"filename": "sql_querify-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "656d0214bf711c35abef481bd4c41870",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.11",
"size": 17817,
"upload_time": "2024-07-21T14:08:53",
"upload_time_iso_8601": "2024-07-21T14:08:53.207881Z",
"url": "https://files.pythonhosted.org/packages/7a/77/0ccd164660a0f22eb0954970c3b927efbe610aa4c13afdca38c648ec0425/sql_querify-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-21 14:08:53",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "badihio",
"github_project": "querify",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "sql-querify"
}