A simple framework for interacting with Dune Analytics official API service.
Project description
Dune Client
A python framework for interacting with Dune Analytics' officially supported API service.
Installation
Import as a project dependency
pip install dune-client
Example Usage
Export your DUNE_API_KEY
(or place it in a .env
file - as in
here .env.sample.
import dotenv
import os
from dune_client.types import QueryParameter
from dune_client.client import DuneClient
from dune_client.query import Query
query = Query(
name="Sample Query",
query_id=1215383,
params=[
QueryParameter.text_type(name="TextField", value="Word"),
QueryParameter.number_type(name="NumberField", value=3.1415926535),
QueryParameter.date_type(name="DateField", value="2022-05-04 00:00:00"),
QueryParameter.enum_type(name="EnumField", value="Option 1"),
],
)
print("Results available at", query.url())
dotenv.load_dotenv()
dune = DuneClient(os.environ["DUNE_API_KEY"])
results = dune.refresh(query)
For a more elaborate example, visit dune-alerts
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dune_client-0.0.4.tar.gz
(16.5 kB
view hashes)
Built Distribution
Close
Hashes for dune_client-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6bbc15f7e44b749b34bdb14909c593341ff6a56bc6bf584a59fc92c2b3ed072 |
|
MD5 | 377071a803ec228f965da79139cf21d6 |
|
BLAKE2b-256 | dac261b5e8dd2e9d4b955732f70048a38a7f094369f3c2720ede2e4fd5e1f9a7 |