Welcome to pyacryl2’s documentation!¶
pyacryl2
is Python API client for Acryl node. It provides sync HTTP client based
on requests module and async based on
aiohttp.
Also it has some useful features e.g. Acryl address generation and validation, transaction data generation.
pyacryl2?¶
There is already a module named pyacryl
based on pywaves
. pyacryl2
is not
compatible with pyacryl
so it can’t be used in old projects.
Installation¶
pip install pyacryl2
From source:
python setup.py install
Tests:
From source:
python setup.py test
Making requests to node API¶
Using sync client:
from pyacryl2.client import AcrylClient
client = AcrylClient()
print(client.node_version())
Or using async client:
import asyncio
from pyacryl2.async_client import AcrylAsyncClient
client = AcrylAsyncClient()
# Python 3.6
loop = asyncio.get_event_loop()
print(loop.run_until_complete(client.node_version()))
# Python 3.7
print(asyncio.run(client.node_version()))