Metadata-Version: 2.4
Name: web3research
Version: 0.0.10
Summary: Python SDK for Web3Research Platform
Project-URL: Homepage, https://github.com/njublockchain/web3research-py
Project-URL: Repository, https://github.com/njublockchain/web3research-py
Project-URL: Documentation, https://github.com/njublockchain/web3research-py
Project-URL: Bug Tracker, https://github.com/njublockchain/web3research-py/issues
Author-email: Command <me@c0mm4nd.com>
License-Expression: MIT
License-File: LICENSE
Keywords: blockchain,ethereum,tron,web3,web3.py,web3research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: ~=3.8
Requires-Dist: base58<3,>=2.1.1
Requires-Dist: clickhouse-connect<0.9,>=0.8.17
Requires-Dist: web3~=7.12
Description-Content-Type: text/markdown

# Web3Research Python Toolkit

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

**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)
```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
from web3research.common import Address

# for internet
w3r = web3research.Web3Research(api_token=YOUT_APIKEY)

USDT_address = Address('0xdac17f958d2ee523a2206206994597c13d831ec7')

log = w3r.eth.events(
    where=f"address = {USDT_address}", 
    order_by={"blockNumber", True},
    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/). Auto-generated python API document is available  on https://web3research.readthedocs.io/.

## Development

### Release Process

This project uses `uv` for automated releases. Set up your PyPI tokens via environment variables or `.env` file:

```bash
# Using .env file (recommended)
echo 'PYPI_TOKEN=pypi-your-token-here' >> .env
python scripts/release.py patch  # or minor/major

# Using environment variables
export PYPI_TOKEN=pypi-your-token-here
python scripts/release.py patch
```

For TestPyPI: use `TEST_PYPI_TOKEN` and add `--test-pypi` flag.
