Skip to main content

Nimiq Python Client

Python implementation of the Nimiq RPC client specs.

Usage

To get started sending requests to a Nimiq node, we create a NimiqClient object.

import nimiqclient

client = NimiqClient(
	scheme = "http",
	user = "luna",
	password = "moon",
	host = "127.0.0.1",
	port = 8648
)

# make rpc call to get current block number
blockNumber = client.blockNumber()
print(blockNumber)

Note: When no config object is passed in the initialization it will use the default values in the Nimiq node.

API

The complete API documentation is available here.

Check out the original Nimiq RPC specs for the behind-the-scenes RPC calls.

Installation

Using PIP

pip install nimiqclient

Or clone the repository and install the package from source

git clone https://github.com/nimiq-community/python-client
cd python-client
python setup.py install

Build

Clone the repo and install it

git clone https://github.com/nimiq-community/python-client
cd python-client
python setup.py install

All done, happy coding!

Test

You need a start a Testnet Nimiq node:

nodejs index.js --protocol=dumb --type=full --network=test --rpc

Tests are stored in the /tests folder and can be run from the command line like this:

python -m unittest discover -v

Documentation

The documentation is generated automatically with Sphinx.

From the repository root directory install the development dependency requirements:

pip install -r requirements-dev.txt

Then from the /docs directory run Sphinx via the make command:

cd docs
make html

Add a blank file in the /docs folder with the name .nojekyll for the documentation hosted on GitHub Pages:

touch .nojekyll

Contributions

This implementation was originally contributed by rraallvv.

Bug reports and pull requests are welcome! Please refer to the issue tracker for ideas.

License

Apache 2.0

Release files for nimiqclient 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nimiqclient 0.1.2
File Size Uploaded
nimiqclient-0.1.2.tar.gz 24.3 kB Details

Release files / nimiqclient-0.1.2.tar.gz

Download URL nimiqclient-0.1.2.tar.gz
Size 24.3 kB
Tags Source
SHA-256 checksum
How to use checksums
23582f9f70f97b56b99b5d1579f28c51d0f50ba56b0702d716d3f1aebf6ee1f5
BLAKE2b-256 checksum
How to use checksums
7577d19adaa4aa50471c81016802dfca61c4c3fc3afa2aa7e9950643c8b5865c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.7.1 requests/2.26.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/2.7.16

Release history Release notifications | RSS feed

This release

0.1.2 This release

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

3 release files

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page