| Name | dqdl JSON |
| Version |
0.2.0
JSON |
| download |
| home_page | None |
| Summary | Dune query result downloader |
| upload_time | 2024-08-10 20:58:11 |
| maintainer | None |
| docs_url | None |
| author | None |
| requires_python | >=3.12 |
| license | None |
| keywords |
|
| VCS |
 |
| bugtrack_url |
|
| requirements |
No requirements were recorded.
|
| Travis-CI |
No Travis.
|
| coveralls test coverage |
No coveralls.
|
# dqdl
dqdl ("Dune Query DownLoader") is a simple tool that downloads
[Dune](https://dune.com/) query result.
## Quickstart
Let's fetch the result of [query #3945714](https://dune.com/queries/3945714) –
a simple table that lists the number of smart contracts created on each chain
over the last 7 days.
First, install `dqdl` from PyPI:
```shell
pip install dqdl
```
Ensure that there is an `.env` file in the current working directory
with the following line in it:
```env
DUNE_API_KEY=YourDuneAPIKeyHere
```
(Need an API key? Sign up and log into [Dune](https://dune.com/),
then [create your own key](https://dune.com/settings/api).)
Then run:
```shell
dqdl 3945714
```
The result should be saved in `3945714.csv` in the current directory:
```
$ head -5 3945714.csv
blockchain,count
polygon,1376013.0
base,758165.0
optimism,588968.0
bnb,80817.0
```
## Usage
```
dqdl [-k SPEC] [-e FILE] [-E] [-o FILE] [-f FORMAT] QUERY
```
`QUERY` is the query number,
that is, the `XXXXXX` part in `https://dune.com/queries/XXXXXXX`.
### Specifying API key
`dqdl` requires a Dune API key
and by default reads one from the environment variable named `DUNE_API_KEY`.
Use `-k SPEC` to specify somewhere else to read the key; see
[openssl-passphrase-options(1)](https://docs.openssl.org/3.3/man1/openssl-passphrase-options/)
for the `SPEC` syntax.
### API key in `.env`
If the API key is from an environment variable (as in the default)
and the variable does not exist in the environment, `dqdl` looks it up in
a file named `.env` in the current directory—if one exists.
This "dotenv" file contains environment variables in the `NAME=VALUE` format,
one per line.
You can choose another file instead of `.env` with `-e FILE`.
Note: absence of this file is silently ignored, so beware typos!
If you want to avoid using the `.env` file even if one exists,
you can disable dotenv processing altogether with `-E`.
### Output location
The result is saved into a file named after the query number and the format,
e.g. `3945714.csv`.
The filename can be changed with `-o FILE` (`-o -` means stdout).
### Output format
By default, the output is saved in `csv`
([comma-separated values](https://en.wikipedia.org/wiki/Comma-separated_values))
format.
You can change the output format with `-f FORMAT`.
The `FORMAT` may be `csv` or `pqt`
([Apache Parquet](https://parquet.apache.org/)).
## Limitation
`dqdl` loads the entire query result in memory (for now),
and may fail if the result is too big to fit in memory.
Raw data
{
"_id": null,
"home_page": null,
"name": "dqdl",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.12",
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": "Eugene Kim <ek@karma3labs.com>",
"download_url": "https://files.pythonhosted.org/packages/ee/2f/82d1562a1422a6668c3e4d2c7bc843268faf3508719ff44934ef325c330f/dqdl-0.2.0.tar.gz",
"platform": null,
"description": "# dqdl\n\ndqdl (\"Dune Query DownLoader\") is a simple tool that downloads\n[Dune](https://dune.com/) query result.\n\n## Quickstart\n\nLet's fetch the result of [query #3945714](https://dune.com/queries/3945714) \u2013\na simple table that lists the number of smart contracts created on each chain\nover the last 7 days.\nFirst, install `dqdl` from PyPI:\n\n```shell\npip install dqdl\n```\n\nEnsure that there is an `.env` file in the current working directory\nwith the following line in it:\n\n```env\nDUNE_API_KEY=YourDuneAPIKeyHere\n```\n\n(Need an API key? Sign up and log into [Dune](https://dune.com/),\nthen [create your own key](https://dune.com/settings/api).)\n\nThen run:\n\n```shell\ndqdl 3945714\n```\n\nThe result should be saved in `3945714.csv` in the current directory:\n\n```\n$ head -5 3945714.csv \nblockchain,count\npolygon,1376013.0\nbase,758165.0\noptimism,588968.0\nbnb,80817.0\n```\n\n## Usage\n\n```\ndqdl [-k SPEC] [-e FILE] [-E] [-o FILE] [-f FORMAT] QUERY\n```\n\n`QUERY` is the query number,\nthat is, the `XXXXXX` part in `https://dune.com/queries/XXXXXXX`.\n\n### Specifying API key\n\n`dqdl` requires a Dune API key\nand by default reads one from the environment variable named `DUNE_API_KEY`.\n\nUse `-k SPEC` to specify somewhere else to read the key; see\n[openssl-passphrase-options(1)](https://docs.openssl.org/3.3/man1/openssl-passphrase-options/)\nfor the `SPEC` syntax.\n\n### API key in `.env`\n\nIf the API key is from an environment variable (as in the default)\nand the variable does not exist in the environment, `dqdl` looks it up in\na file named `.env` in the current directory\u2014if one exists.\nThis \"dotenv\" file contains environment variables in the `NAME=VALUE` format,\none per line.\n\nYou can choose another file instead of `.env` with `-e FILE`.\nNote: absence of this file is silently ignored, so beware typos!\n\nIf you want to avoid using the `.env` file even if one exists,\nyou can disable dotenv processing altogether with `-E`.\n\n### Output location\n\nThe result is saved into a file named after the query number and the format,\ne.g. `3945714.csv`.\nThe filename can be changed with `-o FILE` (`-o -` means stdout).\n\n### Output format\n\nBy default, the output is saved in `csv`\n([comma-separated values](https://en.wikipedia.org/wiki/Comma-separated_values))\nformat.\n\nYou can change the output format with `-f FORMAT`.\nThe `FORMAT` may be `csv` or `pqt`\n([Apache Parquet](https://parquet.apache.org/)).\n\n## Limitation\n\n`dqdl` loads the entire query result in memory (for now),\nand may fail if the result is too big to fit in memory.\n",
"bugtrack_url": null,
"license": null,
"summary": "Dune query result downloader",
"version": "0.2.0",
"project_urls": {
"Homepage": "https://github.com/Karma3Labs/dqdl",
"Issues": "https://github.com/Karma3Labs/dqdl/issues",
"Repository": "https://github.com/Karma3Labs/dqdl.git"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "3d389396f322314b74579a238259d3c898b0cafa446efc94a1ffb63e55199fb9",
"md5": "ad39e2363a60eadbdc473f70a4738195",
"sha256": "6119bf08235345938cddb67fc3a43df4cb80ec8c676e46090e4acf3965abd09d"
},
"downloads": -1,
"filename": "dqdl-0.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ad39e2363a60eadbdc473f70a4738195",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.12",
"size": 4444,
"upload_time": "2024-08-10T20:58:09",
"upload_time_iso_8601": "2024-08-10T20:58:09.780217Z",
"url": "https://files.pythonhosted.org/packages/3d/38/9396f322314b74579a238259d3c898b0cafa446efc94a1ffb63e55199fb9/dqdl-0.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "ee2f82d1562a1422a6668c3e4d2c7bc843268faf3508719ff44934ef325c330f",
"md5": "bac20bf5fcea0d0e010ce50d8d2c9299",
"sha256": "240ea7cf99a1ce107327e1a84b458d57994c41edd598604ec4f46774d87348dd"
},
"downloads": -1,
"filename": "dqdl-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "bac20bf5fcea0d0e010ce50d8d2c9299",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.12",
"size": 7489,
"upload_time": "2024-08-10T20:58:11",
"upload_time_iso_8601": "2024-08-10T20:58:11.304012Z",
"url": "https://files.pythonhosted.org/packages/ee/2f/82d1562a1422a6668c3e4d2c7bc843268faf3508719ff44934ef325c330f/dqdl-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-10 20:58:11",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Karma3Labs",
"github_project": "dqdl",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "dqdl"
}