Metadata-Version: 2.1
Name: web3research
Version: 0.0.3
Summary: Python SDK for Web3Research Platform
Home-page: https://github.com/njublockchain/web3research-py
License: MIT
Keywords: web3,web3research,blockchain,ethereum,tron,web3.py
Author: NJU Blockchain
Author-email: admin@nju.im
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: clickhouse-connect-micropip (>=0.7.10,<0.8.0)
Requires-Dist: web3-micropip (>=0.0.1,<0.0.2)
Project-URL: Bug Tracker, https://github.com/njublockchain/web3research-py/issues
Project-URL: Documentation, https://github.com/njublockchain/web3research-py
Project-URL: Repository, https://github.com/njublockchain/web3research-py
Description-Content-Type: text/markdown

# Web3Research Python Toolkit

`web3research-py` is the official python software development kit for all dashboards on [Web3Research Platform](http://web3resear.ch)

## Installation

From pypi (stable)
```bash
pip install -U web3research
```

From github (latest)
```bash
pip install -U git+https://github.com/njublockchain/web3research-py
```

## Usage

Example: fetch and parse a USDT Transfer Event

```python
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](http://github.com/njublockchain/web3research-py-examples)

You can read detailed guide on [our document site](https://doc.web3resear.ch/)

