Skip to main content

Python SDK for Web3Research Platform

Project description

Web3Research Python Toolkit

web3research-py is the official python software development kit for leveraging datasets 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
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

You can read detailed guide on our document site. 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:

# 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.

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.10.tar.gz (3.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

web3research-0.0.10-py3-none-any.whl (24.9 kB view details)

Uploaded Python 3

File details

Details for the file web3research-0.0.10.tar.gz.

File metadata

  • Download URL: web3research-0.0.10.tar.gz
  • Upload date:
  • Size: 3.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.11

File hashes

Hashes for web3research-0.0.10.tar.gz
Algorithm Hash digest
SHA256 221c79b4820149b3d61e44674c3fb2ff469787d4c53e32bf447910540437c5a3
MD5 21401b8ed8e52a94cbf8384499e17b03
BLAKE2b-256 7b3dc43bb48aa08c37f30c6e5f087382466f6e04d95e9d749c23f7a563897004

See more details on using hashes here.

File details

Details for the file web3research-0.0.10-py3-none-any.whl.

File metadata

File hashes

Hashes for web3research-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 47333d4fa5b398460143891e803e69915384977f0d37f300c0039158474ed8a9
MD5 bf404a535d4ff1a608d54b158498c27e
BLAKE2b-256 73a0f9ba07cd2d2c4b61405d55604927e34b1a55b36a95396695f3f3f5c5b5fd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page