dqdl
dqdl ("Dune Query DownLoader") is a simple tool that downloads Dune query result.
Quickstart
Let's fetch the result of query #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:
pip install dqdl
Ensure that there is an .env file in the current working directory
with the following line in it:
DUNE_API_KEY=YourDuneAPIKeyHere
(Need an API key? Sign up and log into Dune, then create your own key.)
Then run:
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)
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)
format.
You can change the output format with -f FORMAT.
The FORMAT may be csv or pqt
(Apache Parquet).
Limitation
dqdl loads the entire query result in memory (for now),
and may fail if the result is too big to fit in memory.
Metadata
Release files for dqdl 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| dqdl-0.2.0.tar.gz | 7.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dqdl-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.9 kB
Release files / dqdl-0.2.0.tar.gz
| Download URL | dqdl-0.2.0.tar.gz |
|---|---|
| Size | 7.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
240ea7cf99a1ce107327e1a84b458d57994c41edd598604ec4f46774d87348dd
|
|
BLAKE2b-256 checksum How to use checksums |
ee2f82d1562a1422a6668c3e4d2c7bc843268faf3508719ff44934ef325c330f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.32.3
|
Release files / dqdl-0.2.0-py3-none-any.whl
| Download URL | dqdl-0.2.0-py3-none-any.whl |
|---|---|
| Size | 4.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6119bf08235345938cddb67fc3a43df4cb80ec8c676e46090e4acf3965abd09d
|
|
BLAKE2b-256 checksum How to use checksums |
3d389396f322314b74579a238259d3c898b0cafa446efc94a1ffb63e55199fb9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.32.3
|
Security for dqdl 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.