Singer tap for extracting data from Dune Analytics API
Project description
tap-dune
This is a Singer tap that produces JSON-formatted data following the Singer spec.
This tap:
- Pulls data from the Dune Analytics API
- Extracts data from specified Dune queries
- Produces Singer formatted data following the Singer spec
- Supports incremental replication using query parameters
Installation
pipx install poetry
git clone https://github.com/your-username/tap-dune.git
cd tap-dune
poetry install
Configuration
Accepted Config Options
A full list of supported settings and capabilities is available by running:
poetry run tap-dune --about
Config File Setup
-
Copy the example config file:
cp config.json.example config.json
-
Edit
config.jsonwith your settings:
{
"api_key": "YOUR_DUNE_API_KEY",
"query_id": "YOUR_QUERY_ID",
"performance": "medium",
"query_parameters": [
{
"key": "date_from",
"value": "2025-08-01",
"replication_key": true
}
],
"schema": {
"properties": {
"day": {"type": "string", "format": "date"},
"network": {"type": "string"},
"total_mana": {"type": "number"},
"total_usd": {"type": "number"}
}
}
}
Configuration Fields
| Field | Required | Description |
|---|---|---|
api_key |
Yes | Your Dune Analytics API key |
query_id |
Yes | The ID of the Dune query to execute |
performance |
No | Query execution performance tier: 'medium' (10 credits) or 'large' (20 credits). Defaults to 'medium' |
query_parameters |
No | Array of parameters to pass to your Dune query |
schema |
Yes | JSON Schema definition of your query's output fields |
Query Parameters
Each query parameter object can have:
key: Parameter name in your Dune queryvalue: Parameter valuereplication_key: Set totruefor the parameter that should be used for incremental replication
Schema Configuration
The schema section must define all fields that your Dune query returns. Each field should specify:
type: The data type ('string', 'number', 'integer', 'boolean', 'object', 'array')format(optional): Special format for string fields (e.g., 'date', 'date-time')
Source Authentication and Authorization
- Visit Dune Analytics
- Create an account and obtain an API key
- Add the API key to your config file
Usage
Basic Usage
-
Generate a catalog file:
poetry run tap-dune --config config.json --discover > catalog.json
-
Run the tap:
poetry run tap-dune --config config.json --catalog catalog.json
Incremental Replication
To use incremental replication:
- Mark one of your query parameters with
"replication_key": true - Ensure the parameter value is in a format that can be ordered (e.g., dates, timestamps)
- The tap will track the last value processed and resume from there in subsequent runs
Pipeline Usage
You can easily run tap-dune in a pipeline using Meltano or any other Singer-compatible tool.
Example with target-jsonl:
poetry run tap-dune --config config.json --catalog catalog.json | target-jsonl
Development
Initialize your Development Environment
pipx install poetry
poetry install
Testing
poetry run pytest
SDK Dev Guide
See the dev guide for more instructions on how to use the SDK to develop your own taps and targets.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tap_dune-0.1.0.tar.gz.
File metadata
- Download URL: tap_dune-0.1.0.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a98f9003a8e350576bc2080261574d6c002082dc70c0b4c137fda3b4e5648911
|
|
| MD5 |
733c3d24f7f10cbea47c2fc11f759857
|
|
| BLAKE2b-256 |
deee88d237028cfd4751fc731c728ce89217cea7785e54d3c3cd0f167b001094
|
File details
Details for the file tap_dune-0.1.0-py3-none-any.whl.
File metadata
- Download URL: tap_dune-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
afd9060895b16d31f573329e9db846ebfdfb0eaf379f12296035042b4468debd
|
|
| MD5 |
a3fdc3b3e5b8c680605453987e7828df
|
|
| BLAKE2b-256 |
cb0506a73dbad1bfd8e76db4dd96dd68ed67887e0acc0ec7a41a91cb50a8f00c
|