Toncenter API Python3 async wrap.
Project description
toncenter
Toncenter API Python3 async wrap.
Installation
pip3 install toncenter
Documentation (WIP)
https://witer33.github.io/toncenter/
Example
from toncenter.client import Client
import asyncio
async def main():
async with Client(open("main_api_token.txt").read()) as client:
info = await client.get_masterchain_info() # Gets masterchain info
print(info.last) # Prints last block
if __name__ == "__main__":
asyncio.run(main())
Example without context manager
from toncenter.client import Client
import asyncio
async def main():
client = Client(open("main_api_token.txt").read())
await client.start()
info = await client.get_masterchain_info() # Gets masterchain info
print(info.last) # Prints last block
await client.stop() # ALWAYS call this method.
if __name__ == "__main__":
asyncio.run(main())
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
toncenter-0.0.4.tar.gz
(19.5 kB
view hashes)
Built Distribution
toncenter-0.0.4-py3-none-any.whl
(19.6 kB
view hashes)
Close
Hashes for toncenter-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04932cbfe69dc6300bb1a94a557306398fd58e49f16d7e0317260096ea43045a |
|
MD5 | 66dfc3c41f85a3ec4a560c3ef73bccbd |
|
BLAKE2b-256 | 55070552be70cd259ff59014da2690f8e49afaa07d3fbca817f6624f68d586c7 |