Python wrapper for STRAKS block explorer api
Project description
A Python module for interacting with the STRAKS block explorer API located at https://straks.info
For information on STRAKS please visit the website located at https://straks.io
Installation
pystraksexplorer is avaiable via pip and is supported for both python 2 and 3:
pip3 install pystraksexplorer
Or you can download the source code from the github here, and then install the package using
python3 setup.py install
Useage
See below for useage examples
>>> from pystraksexplorer import StraksExplorer
>>>
>>> s = StraksExplorer()
>>>
>>> s.get_latest_block()
{'last_block': 1519821473, 'block_height': 139893, 'difficulty': 1326.42908167, 'hashrate': 112648332742.3684, 'total_coins': 42548130, 'circulating_coins': 2047421.0002712, 'total_txs': 195600, 'total_size': 108500529}
>>>
>>> s.get_difficulty()
1301.18019592
>>>
>>> s.get_total_supply()
42548150.0
>>>
>>> s.get_blocks(1,1)
{'blocks': [{'height': 139896, 'time': 1519821570, 'hash': '000000000024e75415eb76329b745095c54ec3cf4bbf50a146bf3c1cda983b0a', 'size': 707, 'difficulty': 1323.18032665, 'txlength': 3, 'value': 16.59875252}], 'length': 1, 'pagination': {'totalBlocks': 139897, 'totalPages': 139897, 'currentPage': 1, 'limit': 1}}
>>>
>>> s.get_block_from_block_hash('000000000024e75415eb76329b745095c54ec3cf4bbf50a146bf3c1cda983b0a')
{'hash': '000000000024e75415eb76329b745095c54ec3cf4bbf50a146bf3c1cda983b0a', 'size': 707, 'height': 139896, 'version': 536870912, 'merkleroot': 'a2244e8afd226517830d2a13b49581eb5c970d46af30daf5d614238bf594ad5e', 'tx': ['b1fdcbae4ec2817dae32db1ea4b69cc324f885768a932fea9f8dafb655e9481c', 'f6004c28c9950a12150f8327507534d2f0dbcaef3262668cbd81870ef6e374f0', 'be25c161e4be9503d3e1f8535968dd0c62dd592baa833abf1d31e281779a769b'], 'time': 1519821570, 'nonce': 2085421746, 'bits': '1b318745', 'difficulty': 1323.18032665, 'chainwork': '000000000000000000000000000000000000000000000000104c8f7548d78b30', 'confirmations': 5, 'previousblockhash': '0000000000061ff0bdf7eec0bcb54fe5d20af2ddbfa1bbf675b40cbae6a37b2e', 'nextblockhash': '00000000001d04f4e8bbab59eb49dbd0b9f208cad11e909438e26b83ff1daaa8', 'reward': 10, 'value': 16.59884292, 'isMainChain': True, 'poolInfo': {}}
>>>
>>> s.get_address_balance('33Ssxmn3ehVMgyxgegXhpLGSBpubPjLZQ6')
1623050000000
>>>
>>> s.get_address_total_sent('33Ssxmn3ehVMgyxgegXhpLGSBpubPjLZQ6')
0
>>>
>>> s.get_masternodes('enabled',1,1)
{'masternodes': [{'address': 'SWWuKDKaJBfWisJ1ebJmNfUDddh1bS6ske', 'status': 'enabled', 'protocol': 70102, 'active': 268501, 'txIn': '5c59eac2e18fb87e1df56afbc73667c3fc70922283e53c1f3071b87629f0e018', 'lastSeen': 1519823363, 'lastUpdate': 1519823400}], 'pagination': {'totalMasternodes': 91, 'totalPages': 91, 'currentPage': 1, 'limit': 1}}
Full documentation for the module can be found at the link below, and can also be built using “make html” from the docs folder.
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 Distributions
Built Distributions
File details
Details for the file pystraksexplorer-0.98.9-py3.6.egg
.
File metadata
- Download URL: pystraksexplorer-0.98.9-py3.6.egg
- Upload date:
- Size: 8.6 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
8561c41ddbd6889094cc5c51c18be491f43a9e6dcf13832154e6900d7a2cd186
|
|
MD5 |
53b62ab651acdcfd4affcd71ca63d3ba
|
|
BLAKE2b-256 |
80426a2aff5474e4bafa69d6cfd9c2ce0e692fe5a1e096a84dfcd4ca61996298
|
File details
Details for the file pystraksexplorer-0.98.9-py2.py3-none-any.whl
.
File metadata
- Download URL: pystraksexplorer-0.98.9-py2.py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
2d944b5c6352ade5a1a7c4d69f53d2331b4cdc8b088c09fd35e56105d340af0c
|
|
MD5 |
0c3c7161bdcedcf8758c5e9e57e0966e
|
|
BLAKE2b-256 |
916648ca2c281a97a12295b056f1e96361547969a815a088edea0ef6668e92cb
|