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.3.tar.gz
(17.9 kB
view hashes)
Built Distribution
toncenter-0.0.3-py3-none-any.whl
(18.0 kB
view hashes)
Close
Hashes for toncenter-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ede824edabd3a5461f46f3eebbf6a3cbd0886a8cf1ab3ef936017bb489075f23 |
|
MD5 | 84c0cca6ba51d6a736fd549deb51a21f |
|
BLAKE2b-256 | 2d766c413f21b6f4ee82a4d7ad8ec9aada1eea35c7a7bb35c565ff32d65ca73f |