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
WARNING: This package is not built for Web3Research dashboards, which means that you might not be able to run on the Python Cards.
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.4.tar.gz
(7.2 kB
view details)
Built Distribution
File details
Details for the file web3research-0.0.4.tar.gz
.
File metadata
- Download URL: web3research-0.0.4.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.4 Linux/6.9.6-arch1-1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07dba275971b168655e31d5c51ab59162c955ba5c3b840a3009a2a2cb5ea2b32 |
|
MD5 | cd5247a0fb6582515bab8989173c79ae |
|
BLAKE2b-256 | 5fb3b54d18923838062176c25692de9f27861db1c94fb41f577d3f8be322a681 |
File details
Details for the file web3research-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: web3research-0.0.4-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.4 Linux/6.9.6-arch1-1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59238a0b4bb5e401af7397542fd26f5165927f610055a4facf46c991b02652f8 |
|
MD5 | 4086c773e80ff98b01ee56c637bc9889 |
|
BLAKE2b-256 | 10ecc79c0360221416e00d135514be3931058bef74363146a9cb5e4b63b6fa01 |