Skip to main content

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.3.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

web3research-0.0.3-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: web3research-0.0.3.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.3 Linux/6.8.8-arch1-1

File hashes

Hashes for web3research-0.0.3.tar.gz
Algorithm Hash digest
SHA256 ffb099b542a81f890fbd741142e728bbe2d78ecef2be7099644d10549ef8b031
MD5 15f224245e5ca345b5d67e34645cab0c
BLAKE2b-256 b3d40d1d69dbf2d2afafb09b4d8271e49bfb801c3993e7636e6a2656b2fa3a18

See more details on using hashes here.

File details

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

File metadata

  • Download URL: web3research-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.3 Linux/6.8.8-arch1-1

File hashes

Hashes for web3research-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a7c02d5c01a47ff180869ffaa829ee08cc90eef05f9b1b7f5ff6fe9e5d865905
MD5 d18e4b5aee5fa3836b2ef1c091449ae2
BLAKE2b-256 78b5595152042ec91d858f17d65577889ee4e3392e5e5d2fbc3bd818f3420732

See more details on using hashes here.

Supported by

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