Coder Social home page Coder Social logo

duneanalytics's Introduction

Dune Analytics

Python 3.9

License

Build


Unofficial Python Library for Dune Analytics

The library can be used to fetch the table data from python backend.

Disclaimer: Use at your own risk!

It may not work for some/all urls.

This library doesn't run the query, rather it fetches the query result from the backend.


Charts Plotted:

Here are some examples of charts plotted in Googlesheet after fetching the data.


@balancerlabs / Balancer New/Old Traders

Balancer


@k06a / 1inch New/Old Users Per Day

1inch


@Bancor / Bancor Unique Protected Wallets Over Time

Bancor


Installation:

use pip to install:

pip install duneanalytics

Authentication:

You need to have username & password for Dune Analytics


Example usage:

from duneanalytics import DuneAnalytics

# initialize client
dune = DuneAnalytics('username', 'password')

# try to login
dune.login()

# fetch token
dune.fetch_auth_token()

# fetch query result id using query id
# query id for any query can be found from the url of the query:
# for example: 
# https://dune.com/queries/4494/8769 => 4494
# https://dune.com/queries/3705/7192 => 3705
# https://dune.com/queries/3751/7276 => 3751

result_id = dune.query_result_id(query_id=5508)

# fetch query result
data = dune.query_result(result_id)

For some queries above might not work specially if using v3. Try to use below in that case:
# for example: 
# https://dune.com/queries/1105079

result_id = dune.query_result_id_v3(query_id=1105079)

# fetch execution result
data = dune.get_execution_result(result_id)

duneanalytics's People

Contributors

itzmestar avatar lcfr-eth avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.