Skip to main content

NEMpy

tests build pypi python-ver license badge

High-level python wrapper for working with NEM cryptocurrencies ecosystem (only Symbol supported)

Implemented on the basis symbol project core sdk python library

Possibilities

  • Creating a wallet with profiles and accounts. Importing account by mnemonic.
  • Using a wallet to send funds, message (plain/encrypted), view activity history and balance
  • Blockchain monitoring via websocket
  • Ability to use all the above in third-party products and services

Getting Started

This is an example of how you can set up your project locally. For up and running the wrapper locally please follow the next simple example steps.

Prerequisites

To work with the project, you will need pipenv tool.

pip install pipenv

Installing

Install and update using pip:

pip install nem-py

A Simple Example

Attention!

The example below is intended to demonstrate the ease of use, but it is not secure! Use this code only on the NetworkType.TEST_NET

from nempy.user_data import AccountData
from nempy.engine import XYMEngine
from nempy.sym.network import NetworkType
from nempy.sym.constants import Fees

PRIVATE_KEY = '<YOUR_PRIVATE_KEY>'
PASSWORD = '<YOUR_PASS>'
account = AccountData.create(PRIVATE_KEY, NetworkType.TEST_NET).encrypt(PASSWORD)

engine = XYMEngine(account)
entity_hash, status = engine.send_tokens(recipient_address='TDPFLBK4NSCKUBGAZDWQWCUFNJOJB33Y5R5AWPQ',
                                         mosaics=[('@symbol.xym', 0.1), ],
                                         message='Hallo NEM!',
                                         password=PASSWORD,
                                         fee_type=Fees.SLOWEST)
print(status.name, status.value)

You can get funds for the balance for testing in the Faucet.

Additional documentation can be found here

Command-line interface (CLI)

You can get acquainted with the capabilities of the CLI interface here

Working with pipenv environment

  1. Clone the repository git clone https://github.com/denjas/nempy.git
  2. Go to the directory with the project cd nempy
  3. Install virtualenv package pip install pipenv
  4. Setting up a virtual environment pipenv install --dev
  5. Installing a nem-py package into the environment pipenv run pip install . or pipenv run pip install -e . for development mode.

Running CLI utility

pipenv run nempy-cli.py

Testing

Follow the previous steps to set up your environment.

Running tests pipenv run tests or pipenv run tests --cov=nempy to assess coverage

Version Numbers

Version numbers will be assigned according to the Semantic Versioning scheme. This means, given a version number MAJOR.MINOR.PATCH, we will increment the:

  1. MAJOR version when we make incompatible API changes,
  2. MINOR version when we add functionality in a backwards compatible manner, and
  3. PATCH version when we make backwards compatible bug fixes.

Metadata

Release files for nem-py 0.0.7

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

Source distribution (sdist)

Source distribution for nem-py 0.0.7
File Size Uploaded
nem-py-0.0.7.tar.gz 61.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nem-py 0.0.7
File Interpreter ABI Platform
nem_py-0.0.7-py3-none-any.whl Python 3 none any Details

Total release size: 107.0 kB

Release files / nem-py-0.0.7.tar.gz

Download URL nem-py-0.0.7.tar.gz
Size 61.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3972a9136ce5a9bfaefa90a88b3eca16d2f1b63e26f1316fac38b14a9968beca
BLAKE2b-256 checksum
How to use checksums
69a1ed38f65693d9eceae05b758311295cf3e82adbc937216af210f0d1727adc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

Release files / nem_py-0.0.7-py3-none-any.whl

Download URL nem_py-0.0.7-py3-none-any.whl
Size 45.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2e2e886bcec9f6797c02814797a55dea9d2b4a64fb15b1101177d4a42998525a
BLAKE2b-256 checksum
How to use checksums
fc074de0ad24fa552ca928fd0a777207f7ec20f33340cf95dc502d2bf0015d1a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
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