Skip to main content

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

  1. Copy the example config file:

    cp config.json.example config.json
    
  2. Edit config.json with 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 query
  • value: Parameter value
  • replication_key: Set to true for 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

  1. Visit Dune Analytics
  2. Create an account and obtain an API key
  3. Add the API key to your config file

Usage

Basic Usage

  1. Generate a catalog file:

    poetry run tap-dune --config config.json --discover > catalog.json
    
  2. Run the tap:

    poetry run tap-dune --config config.json --catalog catalog.json
    

Incremental Replication

To use incremental replication:

  1. Mark one of your query parameters with "replication_key": true
  2. Ensure the parameter value is in a format that can be ordered (e.g., dates, timestamps)
  3. 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

tap_dune-0.1.0.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tap_dune-0.1.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

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

Hashes for tap_dune-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a98f9003a8e350576bc2080261574d6c002082dc70c0b4c137fda3b4e5648911
MD5 733c3d24f7f10cbea47c2fc11f759857
BLAKE2b-256 deee88d237028cfd4751fc731c728ce89217cea7785e54d3c3cd0f167b001094

See more details on using hashes here.

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

Hashes for tap_dune-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 afd9060895b16d31f573329e9db846ebfdfb0eaf379f12296035042b4468debd
MD5 a3fdc3b3e5b8c680605453987e7828df
BLAKE2b-256 cb0506a73dbad1bfd8e76db4dd96dd68ed67887e0acc0ec7a41a91cb50a8f00c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page