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.5.tar.gz
(20.0 kB
view details)
Built Distribution
toncenter-0.0.5-py3-none-any.whl
(20.3 kB
view details)
File details
Details for the file toncenter-0.0.5.tar.gz
.
File metadata
- Download URL: toncenter-0.0.5.tar.gz
- Upload date:
- Size: 20.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56670e12a6d32fb1d73fcb794d7fc8f8f2ed206b6590ee76a15f255ed59f0988 |
|
MD5 | 50b3a622f6fc83a9ec496f19ca4014ba |
|
BLAKE2b-256 | 42feaebd6333277e2fb56e9a91d45151f6ac5036307758d6d89301fa4f7c7a76 |
File details
Details for the file toncenter-0.0.5-py3-none-any.whl
.
File metadata
- Download URL: toncenter-0.0.5-py3-none-any.whl
- Upload date:
- Size: 20.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bba23d3ba4f389834c9488f290ffc473e17012171c0473f50c0ec2cb65c45443 |
|
MD5 | 44afc1fe48841671cb87086e7d9c77f5 |
|
BLAKE2b-256 | ce9f8b0124f32c91aae0eb939f4c8c30f1132af4cc646cebda17fc2d782c587d |