{"id":15909166,"url":"https://github.com/dnouri/qck","last_synced_at":"2025-06-19T07:04:31.600Z","repository":{"id":220147838,"uuid":"750880188","full_name":"dnouri/qck","owner":"dnouri","description":"Qck 🦆👩‍💻 (pronounced \"quack\") is a CLI script to conveniently run DuckDB SQL scripts with support for Jina templating","archived":false,"fork":false,"pushed_at":"2024-04-15T15:46:20.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-19T07:03:55.112Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dnouri.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-31T14:04:35.000Z","updated_at":"2024-01-31T14:05:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"3dfef6c4-168d-4af1-b46c-699a199f24bc","html_url":"https://github.com/dnouri/qck","commit_stats":null,"previous_names":["dnouri/qck"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/dnouri/qck","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnouri%2Fqck","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnouri%2Fqck/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnouri%2Fqck/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnouri%2Fqck/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dnouri","download_url":"https://codeload.github.com/dnouri/qck/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnouri%2Fqck/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260705803,"owners_count":23049487,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-06T14:42:04.576Z","updated_at":"2025-06-19T07:04:26.579Z","avatar_url":"https://github.com/dnouri.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Qck 🦆👩‍💻\n\nQck (pronounced \"quack\") is a CLI script to conveniently run\n[DuckDB](https://duckdb.org/) SQL scripts with support for\n[Jina](https://jinja.palletsprojects.com/) templating.\n\n## 🛠️ Installation\n\nUse `pip install qck` to install.  This will make available the `qck`\nscript.\n\n## 🚀 Usage\n\nRun `qck --help` to view the built-in documentation.\n\nRunning `qck` with just a SQL file will execute the query and print\nthe results to the terminal:\n\n```bash\nqck myquery.sql\n```\n\nThe default is to `LIMIT` the output to 100 lines.  You can override\nthis with the `--limit` option:\n\n```bash\nqck myquery.sql --limit 10  # will only print 10 rows\n```\n\nTo execute a query and write the result to a Parquet file, use\n`--to-parquet`:\n\n```bash\nqck myquery.sql --to-parquet myresult.parquet\n```\n\nYou can also call `qck` from within Python:\n\n```python\nfrom qck import qck\nrs = qck(\"myquery.sql\")\nrs.to_parquet(\"myresult.parquet\")\n```\n\nFor a full list of arguments to `qck`, please refer to the\n[source](qck.py).\n\n## 🖋️ Templating\n\nQck can interpret SQL files as Jinja templates, enabling the use of\ncontrol structures like for loops within SQL files. Additionally, Qck\nintroduces a special variable, `import`, in templates, enabling access\nto arbitrary Python functions. For instance, consider the following\nexample, where we import the `glob` function and utilize it to list\nfiles to query from:\n\n```jinja\n{% for fname in import('glob.glob')('data/*xlsx') %}\nSELECT\n    \"Value\" AS value,\n    \"Région\" AS region,\nFROM\n    st_read('{{ fname }}')\n{% if not loop.last %}\nUNION ALL\n{% endif %}\n{% endfor %}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdnouri%2Fqck","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdnouri%2Fqck","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdnouri%2Fqck/lists"}