# 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/67/55/e7a4c90fff305ff44151e8438cc557de34618b7575a972b23152ebc687e0/web3research-0.0.9.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.9",
"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": "e5f368c6e7903f6535501eccf0342c3ce2b817e3c61f6681a1bec1b56578845a",
"md5": "375649ee820a66e6c8f38fa86d0d05da",
"sha256": "f8d407e80b9b6da01f57d86c0ec1bceddc25a45cf83f71513d31b5d4733fd6c1"
},
"downloads": -1,
"filename": "web3research-0.0.9-py3-none-any.whl",
"has_sig": false,
"md5_digest": "375649ee820a66e6c8f38fa86d0d05da",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8",
"size": 19062,
"upload_time": "2025-01-04T14:25:49",
"upload_time_iso_8601": "2025-01-04T14:25:49.300977Z",
"url": "https://files.pythonhosted.org/packages/e5/f3/68c6e7903f6535501eccf0342c3ce2b817e3c61f6681a1bec1b56578845a/web3research-0.0.9-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6755e7a4c90fff305ff44151e8438cc557de34618b7575a972b23152ebc687e0",
"md5": "86622e1d686b4f962eb460e7f118b310",
"sha256": "687b37e1fb32eee9f618645fbf87fd52f6bea59bd6e5b5f1855645b1aae1cbbc"
},
"downloads": -1,
"filename": "web3research-0.0.9.tar.gz",
"has_sig": false,
"md5_digest": "86622e1d686b4f962eb460e7f118b310",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 42350,
"upload_time": "2025-01-04T14:25:50",
"upload_time_iso_8601": "2025-01-04T14:25:50.839551Z",
"url": "https://files.pythonhosted.org/packages/67/55/e7a4c90fff305ff44151e8438cc557de34618b7575a972b23152ebc687e0/web3research-0.0.9.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-04 14:25:50",
"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"
}