web3research


Nameweb3research JSON
Version 0.0.7 PyPI version JSON
download
home_pagehttps://github.com/njublockchain/web3research-py
SummaryPython SDK for Web3Research Platform
upload_time2024-12-04 19:13:14
maintainerNone
docs_urlNone
authorNJU Blockchain
requires_python<4.0,>=3.8
licenseMIT
keywords web3 web3research blockchain ethereum tron web3.py
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Web3Research Python Toolkit

`web3research-py` is the official python software development kit for leveraging datasets on [Web3Research Platform](http://web3resear.ch)

**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)
```bash
pip install -U web3research
```

From github (latest)
```bash
pip install -U git+https://github.com/njublockchain/web3research-py
```

## Usage

Example: fetch and parse a USDT Transfer Event

```python
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](http://github.com/njublockchain/web3research-py-examples)

You can read detailed guide on [our document site](https://doc.web3resear.ch/). Auto-generated python API document is available  on https://web3research.readthedocs.io/.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/njublockchain/web3research-py",
    "name": "web3research",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8",
    "maintainer_email": null,
    "keywords": "web3, web3research, blockchain, ethereum, tron, web3.py",
    "author": "NJU Blockchain",
    "author_email": "admin@nju.im",
    "download_url": "https://files.pythonhosted.org/packages/78/1e/f1edca638328f6af3f883011438e8c37e80f4a46acbb7d3f2e17c648e280/web3research-0.0.7.tar.gz",
    "platform": null,
    "description": "# Web3Research Python Toolkit\n\n`web3research-py` is the official python software development kit for leveraging datasets on [Web3Research Platform](http://web3resear.ch)\n\n**WARNING**: This package is not built for Web3Research dashboards, which means that you might not be able to run on the Python Cards.\n\n## Installation\n\nFrom pypi (stable)\n```bash\npip install -U web3research\n```\n\nFrom github (latest)\n```bash\npip install -U git+https://github.com/njublockchain/web3research-py\n```\n\n## Usage\n\nExample: fetch and parse a USDT Transfer Event\n\n```python\nimport os\nimport web3\nimport web3research\nfrom web3research.evm import SingleEventDecoder\nfrom web3research.common import Address\n\n# for internet\nw3r = web3research.Web3Research(api_token=YOUT_APIKEY)\n\nUSDT_address = Address('0xdac17f958d2ee523a2206206994597c13d831ec7')\n\nlog = w3r.eth.events(\n    where=f\"address = {USDT_address}\", \n    order_by={\"blockNumber\", True},\n    limit=1\n)[0]\n\nw3 = web3.Web3()\n\nabi = {\n    \"anonymous\": False,\n    \"inputs\": [\n        {\"indexed\": True, \"name\": \"from\", \"type\": \"address\"},\n        {\"indexed\": True, \"name\": \"to\", \"type\": \"address\"},\n        {\"indexed\": False, \"name\": \"value\", \"type\": \"uint256\"},\n    ],\n    \"name\": \"Transfer\",\n    \"type\": \"event\",\n}\ndecoder = SingleEventDecoder(w3, event_abi=abi)\nresult = decoder.decode(log)\nprint(result)\n\n```\n\nMore practical examples are shown on [web3research-py-examples](http://github.com/njublockchain/web3research-py-examples)\n\nYou can read detailed guide on [our document site](https://doc.web3resear.ch/). Auto-generated python API document is available  on https://web3research.readthedocs.io/.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python SDK for Web3Research Platform",
    "version": "0.0.7",
    "project_urls": {
        "Bug Tracker": "https://github.com/njublockchain/web3research-py/issues",
        "Documentation": "https://github.com/njublockchain/web3research-py",
        "Homepage": "https://github.com/njublockchain/web3research-py",
        "Repository": "https://github.com/njublockchain/web3research-py"
    },
    "split_keywords": [
        "web3",
        " web3research",
        " blockchain",
        " ethereum",
        " tron",
        " web3.py"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1a5163b91ad9fa98def6e33c71d71a6cae5ef0b21c2f8b777acc7a23e8e772b3",
                "md5": "664fe843fa886badce692577c61778e0",
                "sha256": "34226fa0c3dbe4a0cb5385f7b6fc18258e7ba22eb86e8e9b89cdd4ce530ee9b0"
            },
            "downloads": -1,
            "filename": "web3research-0.0.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "664fe843fa886badce692577c61778e0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 18031,
            "upload_time": "2024-12-04T19:13:12",
            "upload_time_iso_8601": "2024-12-04T19:13:12.139910Z",
            "url": "https://files.pythonhosted.org/packages/1a/51/63b91ad9fa98def6e33c71d71a6cae5ef0b21c2f8b777acc7a23e8e772b3/web3research-0.0.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "781ef1edca638328f6af3f883011438e8c37e80f4a46acbb7d3f2e17c648e280",
                "md5": "cb4522c98967e133d49c036d983d3b68",
                "sha256": "2894a5259521660fd278f11eed7f4effc03ea05db0a757708da95f1c87ce9a5f"
            },
            "downloads": -1,
            "filename": "web3research-0.0.7.tar.gz",
            "has_sig": false,
            "md5_digest": "cb4522c98967e133d49c036d983d3b68",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 14590,
            "upload_time": "2024-12-04T19:13:14",
            "upload_time_iso_8601": "2024-12-04T19:13:14.185089Z",
            "url": "https://files.pythonhosted.org/packages/78/1e/f1edca638328f6af3f883011438e8c37e80f4a46acbb7d3f2e17c648e280/web3research-0.0.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-04 19:13:14",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "njublockchain",
    "github_project": "web3research-py",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "web3research"
}
        
Elapsed time: 0.37012s