Skip to content
Snippets Groups Projects
Select Git revision
  • b47db736c6ad8f902a2b6c344bcd1702d6e72164
  • main default protected
  • release/1.1
  • encrypt_comments
  • mnemonic_dewif
  • authors_rules
  • 0.14
  • rtd
  • 1.2.1 protected
  • 1.2.0 protected
  • 1.1.1 protected
  • 1.1.0 protected
  • 1.0.0 protected
  • 1.0.0rc1 protected
  • 1.0.0rc0 protected
  • 1.0.0-rc protected
  • 0.62.0 protected
  • 0.61.0 protected
  • 0.60.1 protected
  • 0.58.1 protected
  • 0.60.0 protected
  • 0.58.0 protected
  • 0.57.0 protected
  • 0.56.0 protected
  • 0.55.1 protected
  • 0.55.0 protected
  • 0.54.3 protected
  • 0.54.2 protected
28 results

duniterpy

user avatar
Caner Candan authored
b47db736
History
Name Last commit Last update
hdc
pks
ucg
wrappers
.gitignore
LICENSE
README.md
__init__.py

#ucoin-python-api

A python implementation of uCoin API

Requirements

In order to use the API, you have to first install the required dependencies given below thanks to pip3:

  • requests
  • python-gnupg

##Installation

Here is a fast installation procedure (a bit dirty) we suggest to quickly use this API.

$ mkdir $HOME/ucoin
$ cd $HOME/ucoin
$ git clone git@github.com:canercandan/ucoin-python-api.git
$ export PYTHONPATH="$HOME/ucoin:$PYTHONPATH"

Thus you are ready to use it with your own python program. Here is an example illustrating how to use it thanks to the python shell:

In [1]: import ucoin-python-api as ucoin

In [2]: ucoin.settings['server'] = 'mycurrency.candan.fr'

In [3]: ucoin.ucg.Peering().get()
Out[3]:
{'contract': {'currentNumber': '5',
  'hash': 'FB710AE30F843BF505ABF9DE8CF404B7F35D238A'},
 'currency': 'mycurrency',
 'key': '6282C3F765E560992113137AD149AFF1B07FF751',
 'merkles': {'hdc/amendments/current/votes': {'depth': 1,
   'leavesCount': 2,
   'nodesCount': 1,
   'root': '2CEC90DEBBB89C10B6AB5EAEF17FF1D0BA8B4346'},
  'pks/all': {'depth': 2,
   'leavesCount': 4,
   'nodesCount': 3,
   'root': '944D0A3A0593C4B627BA41F0454BB4A705918CE9'}},
 'remote': {'host': 'mycurrency.candan.fr',
  'ipv4': '62.210.131.202',
  'ipv6': '',
  'port': 8081}}

Please take a look at the document HTTP API to learn about the API.