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

Uploaded Source

Built Distribution

web3research-0.0.6-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: web3research-0.0.6.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.6.tar.gz
Algorithm Hash digest
SHA256 e74804396fac67c636278c8273407a842baa31d37d9c44d9509fa05afa573cf8
MD5 af866dbde96b720da1ccba632569b54d
BLAKE2b-256 0347232da764b73acce348eda563d7b7372b1c7be1778672dc70255cf39018ac

See more details on using hashes here.

File details

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

File metadata

  • Download URL: web3research-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 17.9 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 0ee16018bed17aa76210454c88e2d0d8d9c3f0c5718fffed5b7a019a32d8b4c4
MD5 27edd1cfe68e7f8c4b35df52dc860d15
BLAKE2b-256 27ae846d8c14a95c928d1ef6303972854f757ccf3a365013206d3a5cda8727f2

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