Skip to content

Commit 3d4ce25

Browse files
author
Kotsias, Panagiotis-Christos
committed
Added more instructions
1 parent e1973fb commit 3d4ce25

File tree

1 file changed

+46
-5
lines changed

1 file changed

+46
-5
lines changed

README.md

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,29 @@
11
# etherscan-python
22

3-
A minimal python API for [etherscan.io](etherscan.io).
3+
A minimal, yet complete, python API for [etherscan.io](etherscan.io).
44

55
[![Build Status](https://travis-ci.com/pcko1/etherscan-python.svg?branch=master)](https://travis-ci.com/pcko1/etherscan-python)
66
[![codecov](https://codecov.io/gh/pcko1/etherscan-python/branch/master/graph/badge.svg)](https://codecov.io/gh/pcko1/etherscan-python)
77
[![Python 3.8](https://img.shields.io/badge/python-3.8-blue.svg)](https://www.python.org/downloads/release/python-385/)
8+
89
![GitHub](https://img.shields.io/github/license/pcko1/etherscan-python)
910

1011
___
1112

12-
Most of the free webhooks from the [Accounts](https://etherscan.io/apis#accounts), [Contracts](https://etherscan.io/apis#contracts), [Transactions](https://etherscan.io/apis#transactions) and [Tokens](https://etherscan.io/apis#tokens) modules are supported. Their example use-cases are summarized [here](https://api.etherscan.io/apis).
13+
All of the *free* GET endpoints from the following modules are provided:
14+
15+
* [Accounts](https://etherscan.io/apis#accounts)
16+
* [Contracts](https://etherscan.io/apis#contracts)
17+
* [Transactions](https://etherscan.io/apis#transactions)
18+
* [Blocks](https://etherscan.io/apis#blocks)
19+
* [GETH/Parity Proxy](https://etherscan.io/apis#proxy)
20+
* [Tokens](https://etherscan.io/apis#tokens)
21+
* [Gas Tracker](https://etherscan.io/apis#gastracker)
22+
* [Stats](https://etherscan.io/apis#stats)
1323

1424
## Installation
1525

16-
Before proceeding, you should register an account on etherscan.io and generate a personal API key to use.
26+
Before proceeding, you should register an account on [etherscan.io](etherscan.io) and generate a personal API key to use.
1727

1828
Assuming [conda](https://docs.conda.io/en/latest/miniconda.html) is already installed on your system, first create the environment:
1929

@@ -35,10 +45,14 @@ pip install .
3545

3646
## Run unittests
3747

48+
Test that everything looks OK on your end before proceeding:
49+
3850
``` bash
39-
bash run_tests.sh
51+
coverage run -m unittest discover && coverage report -m
4052
````
4153

54+
This will regenerate the logs under `logs/` with the most recent results and the timestamp of the execution.
55+
4256
## Usage
4357

4458
In `python` , create a client with your personal etherscan.io API key:
@@ -60,7 +74,34 @@ eth.get_eth_balance(address="0xddbd2b932c763ba5b1b7ae3b362eac3e8d40121a")
6074
> '40891631566070000000000'
6175
```
6276

63-
Examples (arguments and results) for all methods may be found as JSON files [here](https://github.com/pcko1/etherscan-python/tree/master/logs).
77+
## Examples
78+
79+
Examples (arguments and results) for all methods may be found as JSON files [here](https://github.com/pcko1/etherscan-python/tree/master/logs). For example, if you want to use the method `get_block_number_by_timestamp` , you can find the supported arguments and the format of its output in its respective [JSON file](logs/get_block_number_by_timestamp.json):
80+
81+
``` json
82+
{
83+
"method": "get_block_number_by_timestamp",
84+
"module": "blocks",
85+
"kwargs": {
86+
"timestamp": "1578638524",
87+
"closest": "before"
88+
},
89+
"log_timestamp": "2020-09-30-15:39:18",
90+
"res": "9251482"
91+
}
92+
```
93+
94+
where `kwargs` refer to the required arguments and `res` refers to the expected result if you run:
95+
96+
``` python
97+
eth.get_block_number_by_timestamp(timestamp="1578638524", closest="before")
98+
```
99+
100+
**Disclaimer**: Those examples blindly use the arguments originally showcased [here](https://api.etherscan.io/apis) and the selected wallets/contracts do not reflect any personal views. You should refer to the same source for additional information regarding specific argument values.
101+
102+
## Issues
103+
104+
For problems regarding installing or using the package please open an [issue](https://github.com/pcko1/etherscan-python/issues). If you think that a newly-added method is missing, also open an issue as a feature request and I will do my best to add it. Kindly avoid disclosing potentially sensitive information such as your API keys or your wallet addresses.
64105

65106
___
66107
Powered by [Etherscan.io APIs](https://etherscan.io/apis).

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy