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

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

Uploaded Source

Built Distribution

web3research-0.0.5-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: web3research-0.0.5.tar.gz
  • Upload date:
  • Size: 14.5 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

Hashes for web3research-0.0.5.tar.gz
Algorithm Hash digest
SHA256 dc5b276a83d6a0c0d7e238a67f7f8a2c9acb604dc1bab4ed51ccc9c922d427a6
MD5 3f72a31dacc113bfcbc5b3667a625d8d
BLAKE2b-256 ad7a41e145ca5dfe4551234da041fd5f682d1aa1991ed3b571bdeb26e6017459

See more details on using hashes here.

File details

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

File metadata

  • Download URL: web3research-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 17.8 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

Hashes for web3research-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 4b298f163d149285a645ba9b2f310670fcccf0b0a8e7880bffb4752b4a3f599e
MD5 42912c0c7493bf7726e54d9fb45617c0
BLAKE2b-256 981606bbbe330878ee52bbf5b7fc543d8648a1dfdc0604bfb80fef4fbbb4be8f

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