Duniter Python API
Python implementation of Duniter BMA API
Features
- Supports Duniter's Basic Merkle API and protocol
- Asynchronous
- Duniter signing key
Requirements
- Python >= 3.5.2
- aiohttp >= 0.19
- pylibscrypt
- libnacl
- base58
- attr
Installation
You can install duniter-python-api and all its dependencies via the following pip install:
pip3 install duniterpy
Please take a look at the document HTTP API to learn about the API.
Development
-
Create a python environment with pyenv
curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash`
-
Install dependencies:
pip install -r requirements.txt
-
Add PYTHONPATH env var to your shell containing the path to this repository
-
Take a look at examples folder
-
Run examples from parent folder:
python examples/request_data.py
-
Before submit a merge requests, please check the static typing and tests.
-
Check static typing with mypy:
make check
-
Run unit tests with:
make tests
Documentation
-
Install Sphinx:
pip install -r requirements_dev.txt
-
Generate documentation:
make docs
-
HTML Documentation is generated in docs/_build/html folder.
Packaging and deploy
Pypi
In the development pyenv environment, install the following tools:
pip install --upgrade pip setuptools wheel
pip install twine
Change the version number (semantic version number):
./release.sh 0.42.3
Build the Pypi package in the dist
folder:
python setup.py sdist bdist_wheel
Deploy the package on the Pypi repository:
twine upload dist/*