Python SDK for Web3Research Platform
Project description
Web3Research Python Toolkit
web3research-py
is the official python software development kit for all dashboards on Web3Research Platform
Installation
From pypi (stable)
pip install -U web3research
From github (latest)
pip install -U git+https://github.com/njublockchain/web3research-py
Usage
Example: fetch and parse a USDT Transfer Event
import os
import web3
import web3research
from web3research.evm import SingleEventDecoder
# for internet
w3r = web3research.Web3Research(api_token=YOUT_APIKEY)
clean_USDT_address = '0xdac17f958d2ee523a2206206994597c13d831ec7'.removeprefix('0x')
log = w3r.eth.events(
f"address = unhex('{clean_USDT_address}')", limit=1
)[0]
w3 = web3.Web3()
abi = {
"anonymous": False,
"inputs": [
{"indexed": True, "name": "from", "type": "address"},
{"indexed": True, "name": "to", "type": "address"},
{"indexed": False, "name": "value", "type": "uint256"},
],
"name": "Transfer",
"type": "event",
}
decoder = SingleEventDecoder(w3, event_abi=abi)
result = decoder.decode(log)
print(result)
More practical examples are shown on web3research-py-examples
You can read detailed guide on our document site
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
web3research-0.0.2.tar.gz
(6.8 kB
view details)
Built Distribution
File details
Details for the file web3research-0.0.2.tar.gz
.
File metadata
- Download URL: web3research-0.0.2.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.3 Linux/5.15.146.1-microsoft-standard-WSL2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26362a2877f864a1d82f976dc08b6e984fff0aebe84a2b14fd4a930cd7ba840b |
|
MD5 | d825c6b0c9f77a087f914f3c3ba13bd6 |
|
BLAKE2b-256 | ff737d29433f69f2e5dae3c6330c55b7ea1830ffa85900c5cae30a619b93cd6f |
File details
Details for the file web3research-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: web3research-0.0.2-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.3 Linux/5.15.146.1-microsoft-standard-WSL2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69a153ea21621e1404ed96fe07075beeddd18e33664a3b67ec1597deff591d1e |
|
MD5 | 2ed9b8335c59a8a132875fae6bb392bb |
|
BLAKE2b-256 | b294d6e846fb8214827756ecf27a12070087b46412df631e3b24609a413dda3b |