Dragonchain SDK for Python
Project description
Intro
This is the Python 3 SDK for interacting with a dragonchain. It provides functionality to be able to interact with a dragonchain through a simple sdk with minimal configuration needed.
Documentation
Documentation for this SDK can be found at the following location:
Installation
Windows note: If running on a Windows computer, for the following section, you will probably have to replace python3 with python in the commands below depending on how python3 was installed on your computer.
First ensure that you have python3 installed on your machine.
The easiest way to install this repository is with pip. Simply run:
python3 -m pip install dragonchain-sdk
You can also install this package from source. To do so, get the source code (via git clone like git clone https://github.com/dragonchain-inc/dragonchain-sdk-python.git or simply downloading/extracting a source tarball from releases), then navigate into the root project directory. Now ensure that you have pip installed and you can install all the requirements for this project with:
python3 -m pip install -r requirements.txt
Once these requirements successfully install, run:
./run.sh build
sudo ./run.sh install
On windows, simply replace the above 2 commands with:
python3 setup.py build
python3 setup.py install
Configuration
In order to use this SDK, you need to have an Auth Key as well as an Auth Key ID for a given Dragonchain ID. These can be loaded into the sdk in various ways, and are checked in the following order of precedence:
The dragonchain_sdk.client can be initialized with the parameters dragonchain_id=<ID>, auth_key=<KEY>, and auth_key_id=<KEY_ID>
The environment variables DRAGONCHAIN_ID, AUTH_KEY, and AUTH_KEY_ID can be set with the appropriate values
An ini-style credentials file can be provided at ~/.dragonchain/credentials (or on Windows: %LOCALAPPDATA%\dragonchain\credentials) where the section name is the dragonchain id, with values for auth_key and auth_key_id. Additionally, you can supply a value for dragonchain_id in the default section to initialize the client for a specific chain without supplying an ID any other way
Example Credentials File
An example credentials file with keys for 2 chains and a default chain set.
[default] dragonchain_id =
35a7371c-a20a-4830-9a59-5d654fcd0a4a[35a7371c-a20a-4830-9a59-5d654fcd0a4a] auth_key_id =JSDMWFUJDVTCauth_key =n3hlldsFxFdP2De0yMu6A4MFRh1HGzFvn6rJ0ICZzkE[28567017-6412-44b6-80b2-12876fb3d4f5] auth_key_id =OGNHGLYIFVUAauth_key =aS73Si7agvX9gfxnLMh6ack9DEuidKiwQxkqBudXl81
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for dragonchain_sdk-1.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ec2fb477480f4e541b8e1fec79e28a7af3a1cacebe84937e1b7b21512f6bdcb |
|
MD5 | 98ba736c386f19551c507c3626031a6b |
|
BLAKE2b-256 | cff6607dfbf72fbe2c22a73514df53c3ff429aa2dd0fff8198bff832c54e3e2f |