Skip to content

Commit 4eff4f8

Browse files
committed
readme update
1 parent 661f3ae commit 4eff4f8

File tree

1 file changed

+64
-2
lines changed

1 file changed

+64
-2
lines changed

README.md

Lines changed: 64 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,64 @@
1-
# duneanalytics
2-
Unofficial Python Library for Dune Analytics
1+
# Dune Analytics
2+
3+
[![Python 3.5](https://img.shields.io/badge/python-3.5-blue.svg)](https://www.python.org/downloads/release/python-350/)
4+
[![Python 3.6](https://img.shields.io/badge/python-3.6-blue.svg)](https://www.python.org/downloads/release/python-360/)
5+
[![Python 3.7](https://img.shields.io/badge/python-3.7-blue.svg)](https://www.python.org/downloads/release/python-370/)
6+
[![Python 3.8](https://img.shields.io/badge/python-3.8-blue.svg)](https://www.python.org/downloads/release/python-380/)
7+
[![Python 3.9](https://img.shields.io/badge/python-3.9-blue.svg)](https://www.python.org/downloads/release/python-390/)
8+
9+
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
10+
11+
-------
12+
13+
### Unofficial Python Library for [Dune Analytics](https://duneanalytics.com/)
14+
15+
The library can be used to fetch the table data from `python` backend.
16+
17+
#### Disclaimer: Use at your own risk!
18+
It may not work for some/all urls.
19+
20+
This library doesn't run the query, rather it fetches the query result from the backend.
21+
22+
### Installation:
23+
24+
use pip to install:
25+
26+
```
27+
pip install duneanalytics
28+
```
29+
30+
-----------
31+
32+
### Authentication:
33+
34+
You need to have `username` & `password` for [Dune Analytics](https://duneanalytics.com/)
35+
36+
-----------
37+
38+
### Example usage:
39+
40+
```
41+
from duneanalytics import DuneAnalytics
42+
43+
# initialize client
44+
dune = DuneAnalytics('username', 'password')
45+
46+
# try to login
47+
dune.login()
48+
49+
# fetch token
50+
dune.fetch_auth_token()
51+
52+
# fetch query result id using query id
53+
# query id for any query can be found from the url of the query:
54+
# for example:
55+
# https://duneanalytics.com/queries/4494/8769 => 4494
56+
# https://duneanalytics.com/queries/3705/7192 => 3705
57+
# https://duneanalytics.com/queries/3751/7276 => 3751
58+
59+
result_id = dune.query_result_id(query_id=5508)
60+
61+
# fetch query result
62+
data = dune.query_result(result_id)
63+
```
64+

0 commit comments

Comments
 (0)