Skip to main content

Sia bindings for Python 2 & 3

Project description

PySia

https://img.shields.io/pypi/v/pysia.svg https://img.shields.io/travis/jnmclarty/pysia.svg Documentation Status Updates

Sia API bindings for Python 2 & 3.

This library is built using code-generation, to exactly match the endpoints, docs and responses maintained by Sia. This library will not attempt to improve on, or resist, any API changes made upstream to siad.

This version targets siad >= 1.2.2.

Install

pip install pysia

Usage

>>> from pysia import Sia
>>> sc = Sia() # Optionally, pass host & port.  Defaults to localhost & 9980

>>> consensus = sc.get_consensus()
>>> consensus['height']
108058

backup_made = sc.get_wallet_backup(destination=r'd:\siadwallet.dat')
print(backup_made)
# True

backup_made = sc.get_wallet_backup(destination=r'error causing input?@#$!`')
print(backup_made)
>>> {'message': 'error when calling /wallet/backup: destination must be an absolute path'}

print(sc.get_gateway())
>>> {'peers': [{'netaddress': '92.253.172.90:9981', 'version': '0.5.2', 'inbound': False, 'local': False},...]}

>>> print(sc.set_gateway_connect('212.77.177.47:9981'))
True

>>> print(sc.set_gateway_disconnect('212.77.177.47:9981'))
True

>>> print(sc.set_gateway_disconnect('212.77.177.47:9981'))
{'message': 'not connected to that node'}

Features

  • Exposes a method for each API endpoint of siad, matching Siad API docs 1-to-1

  • User-friendly autocomplete (GET -> getters, POST -> setters)

  • Pure python responses

  • User-friendly key-words called out for url-parameters GET-methods

Donations

Sia:

2fd5ada234b5dba82584160213d8c9698d080bc4311277667a1ef38e5265fe7058aeeb627822

License

  • Free software: MIT license

Documentation

Coming soon, here:

See Also

There are python 3 bindings for Sia, maintained by humans which might be or become more pythonic. See siapy.

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

0.1.122.0 (2017-05-28)

  • First code-gen produced version, targetting python 2 & 3 & siad 1.2.2

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

pysia-0.1.122.1.tar.gz (13.6 kB view details)

Uploaded Source

File details

Details for the file pysia-0.1.122.1.tar.gz.

File metadata

  • Download URL: pysia-0.1.122.1.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pysia-0.1.122.1.tar.gz
Algorithm Hash digest
SHA256 8ba66721e956789249063f6923708dbe62276aaa0a181a8f09658a54f8178107
MD5 0df36f5243283409e2ad40358b92fa6f
BLAKE2b-256 fa434420215d04bbdf23aa4034a10a12d668447ccbaf7f8a208c44713712afbb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page