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.8.tar.gz (15.0 kB 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.8-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: web3research-0.0.8.tar.gz
  • Upload date:
  • Size: 15.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.7 Linux/6.10.6-arch1-1

File hashes

Hashes for web3research-0.0.8.tar.gz
Algorithm Hash digest
SHA256 4e9bc957bd20123de950107ee6ea96a17022bcba7bc6fd8c1f40b3b7f38255c7
MD5 e7e1f59e0043cd51d040d410635d75d2
BLAKE2b-256 c3948df27c55c4ea09be757cf690437415c5b7cbcbdd418767214f70cbaf8bb5

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for web3research-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 310622dce3397f00833e7a2e50791afc48398ea6e318b2cb8ebce169da4f9a87
MD5 ecf5fa4b82e2420ce230884e779dc1cb
BLAKE2b-256 4444d7f916b160c700200a2f0c5ef128daf12c4d838ff8b5f9085a54c96e0c69

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