Name | async-substrate-interface JSON |
Version |
1.4.3
JSON |
| download |
home_page | None |
Summary | Asyncio library for interacting with substrate. Mostly API-compatible with py-substrate-interface |
upload_time | 2025-07-28 20:28:43 |
maintainer | Latent Holdings |
docs_url | None |
author | Opentensor Foundation |
requires_python | <3.14,>=3.9 |
license | MIT License
Copyright (c) 2025 Opentensor
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
|
keywords |
substrate
development
bittensor
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Async Substrate Interface
This project provides an asynchronous interface for interacting with [Substrate](https://substrate.io/)-based blockchains. It is based on the [py-substrate-interface](https://github.com/polkascan/py-substrate-interface) project.
Additionally, this project uses [bt-decode](https://github.com/opentensor/bt-decode) instead of [py-scale-codec](https://github.com/polkascan/py-scale-codec) for faster [SCALE](https://docs.substrate.io/reference/scale-codec/) decoding.
## Installation
To install the package, use the following command:
```bash
pip install async-substrate-interface
```
## Usage
Here are examples of how to use the sync and async inferfaces:
```python
from async_substrate_interface import SubstrateInterface
def main():
substrate = SubstrateInterface(
url="wss://rpc.polkadot.io"
)
with substrate:
result = substrate.query(
module='System',
storage_function='Account',
params=['5CZs3T15Ky4jch1sUpSFwkUbYEnsCfe1WCY51fH3SPV6NFnf']
)
print(result)
main()
```
```python
import asyncio
from async_substrate_interface import AsyncSubstrateInterface
async def main():
substrate = AsyncSubstrateInterface(
url="wss://rpc.polkadot.io"
)
async with substrate:
result = await substrate.query(
module='System',
storage_function='Account',
params=['5CZs3T15Ky4jch1sUpSFwkUbYEnsCfe1WCY51fH3SPV6NFnf']
)
print(result)
asyncio.run(main())
```
## Contributing
Contributions are welcome! Please open an issue or submit a pull request to the `staging` branch.
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
## Contact
For any questions or inquiries, please join the Bittensor Development Discord server: [Church of Rao](https://discord.gg/XC7ucQmq2Q).
Raw data
{
"_id": null,
"home_page": null,
"name": "async-substrate-interface",
"maintainer": "Latent Holdings",
"docs_url": null,
"requires_python": "<3.14,>=3.9",
"maintainer_email": "BD Himes <b@latent.to>",
"keywords": "substrate, development, bittensor",
"author": "Opentensor Foundation",
"author_email": "BD Himes <b@latent.to>",
"download_url": "https://files.pythonhosted.org/packages/43/90/ae69cbd66fb6fa7ea6ef170aed79ac9eddedf8c2f86e30f7df4428125ae1/async_substrate_interface-1.4.3.tar.gz",
"platform": null,
"description": "# Async Substrate Interface\nThis project provides an asynchronous interface for interacting with [Substrate](https://substrate.io/)-based blockchains. It is based on the [py-substrate-interface](https://github.com/polkascan/py-substrate-interface) project.\n\nAdditionally, this project uses [bt-decode](https://github.com/opentensor/bt-decode) instead of [py-scale-codec](https://github.com/polkascan/py-scale-codec) for faster [SCALE](https://docs.substrate.io/reference/scale-codec/) decoding.\n\n## Installation\n\nTo install the package, use the following command:\n\n```bash\npip install async-substrate-interface\n```\n\n## Usage\n\nHere are examples of how to use the sync and async inferfaces:\n\n```python\nfrom async_substrate_interface import SubstrateInterface\n\ndef main():\n substrate = SubstrateInterface(\n url=\"wss://rpc.polkadot.io\"\n )\n with substrate:\n result = substrate.query(\n module='System',\n storage_function='Account',\n params=['5CZs3T15Ky4jch1sUpSFwkUbYEnsCfe1WCY51fH3SPV6NFnf']\n )\n\n print(result)\n\nmain()\n```\n\n```python\nimport asyncio\nfrom async_substrate_interface import AsyncSubstrateInterface\n\nasync def main():\n substrate = AsyncSubstrateInterface(\n url=\"wss://rpc.polkadot.io\"\n )\n async with substrate:\n result = await substrate.query(\n module='System',\n storage_function='Account',\n params=['5CZs3T15Ky4jch1sUpSFwkUbYEnsCfe1WCY51fH3SPV6NFnf']\n )\n\n print(result)\n\nasyncio.run(main())\n```\n\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request to the `staging` branch.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n## Contact\n\nFor any questions or inquiries, please join the Bittensor Development Discord server: [Church of Rao](https://discord.gg/XC7ucQmq2Q).\n",
"bugtrack_url": null,
"license": "MIT License\n \n Copyright (c) 2025 Opentensor\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n ",
"summary": "Asyncio library for interacting with substrate. Mostly API-compatible with py-substrate-interface",
"version": "1.4.3",
"project_urls": {
"Repository": "https://github.com/opentensor/async-substrate-interface/"
},
"split_keywords": [
"substrate",
" development",
" bittensor"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "d3db054a59f79f863b9a63281d52a9eaba2ea8b2e131f7adfe6e93d7691f030f",
"md5": "56de0273769e076a7ae4e47b1823b555",
"sha256": "76120241e51e23d312644cff4b044f24759635cae7f6fa36920ce597918d6a71"
},
"downloads": -1,
"filename": "async_substrate_interface-1.4.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "56de0273769e076a7ae4e47b1823b555",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<3.14,>=3.9",
"size": 81210,
"upload_time": "2025-07-28T20:28:41",
"upload_time_iso_8601": "2025-07-28T20:28:41.874797Z",
"url": "https://files.pythonhosted.org/packages/d3/db/054a59f79f863b9a63281d52a9eaba2ea8b2e131f7adfe6e93d7691f030f/async_substrate_interface-1.4.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "4390ae69cbd66fb6fa7ea6ef170aed79ac9eddedf8c2f86e30f7df4428125ae1",
"md5": "3edc44a7af32ea154a7444290c6c09bb",
"sha256": "483d42198ecacc193747239dfc6606ef4c5e0d4c261a2f186c490178cb4d23a7"
},
"downloads": -1,
"filename": "async_substrate_interface-1.4.3.tar.gz",
"has_sig": false,
"md5_digest": "3edc44a7af32ea154a7444290c6c09bb",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<3.14,>=3.9",
"size": 78749,
"upload_time": "2025-07-28T20:28:43",
"upload_time_iso_8601": "2025-07-28T20:28:43.084036Z",
"url": "https://files.pythonhosted.org/packages/43/90/ae69cbd66fb6fa7ea6ef170aed79ac9eddedf8c2f86e30f7df4428125ae1/async_substrate_interface-1.4.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-28 20:28:43",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "opentensor",
"github_project": "async-substrate-interface",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "async-substrate-interface"
}