Skip to main content

The MultiversX Python SDK.

Project description

mx-sdk-py

The Python SDK for interacting with MultiversX. It's an all in one sdk that can be used to create transactions (including smart contract calls and deployments), sign and broadcast transactions, create wallets and many more.

Documentation

Development setup

Virtual environment

Create a virtual environment and install the dependencies:

python3 -m venv ./venv
source ./venv/bin/activate
pip install -r ./requirements.txt --upgrade

Install development dependencies, as well:

pip install -r ./requirements-dev.txt --upgrade

Allow pre-commit to automatically run on git commit:

pre-commit install

Above, requirements.txt should mirror the dependencies section of pyproject.toml.

If using VSCode, restart it or follow these steps:

  • Ctrl + Shift + P
  • Select Interpreter
  • Choose ./venv/bin/python.

Tests

Run the tests as follows:

This command runs all tests:

pytest .

If you want to skip network interaction tests run:

pytest -m "not networkInteraction"

We have some tests fetching mainnet transactions that are quite time consuming. To skip those, run this command:

pytest -m "not mainnet"

Generate test coverage report

First, we run the tests using coverage:

coverage run -m pytest .

Then, we can generate a report in the terminal using:

coverage report

We can also generate a html report using:

coverage html

Re-generate the docs

Each time a new module/submodule is added it needs to be added to the docs, as well. To do so cd in the root directory then run the following command:

sphinx-apidoc -f -o docs/ multiversx_sdk/ '*_test.py' '*constants.py'

This command will regenerate the .rst files for each module, excluding the tests and the constants.py files.

Also, each time a new version is released, the conf.py file should be updated accordingly.

Re-generate protobuf files:

protoc multiversx_sdk/core/proto/transaction.proto --python_out=. --pyi_out=.

Note that protoc must be installed beforehand. Use the same version as the one referenced in requirements.txt. For example, if we reference protobuf==5.29.4 in requirements.txt, then use protobuf v29.4.

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

multiversx_sdk-2.0.0.tar.gz (16.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

multiversx_sdk-2.0.0-py3-none-any.whl (16.3 MB view details)

Uploaded Python 3

File details

Details for the file multiversx_sdk-2.0.0.tar.gz.

File metadata

  • Download URL: multiversx_sdk-2.0.0.tar.gz
  • Upload date:
  • Size: 16.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for multiversx_sdk-2.0.0.tar.gz
Algorithm Hash digest
SHA256 20901df2a46787550c107971abb49aa283ce804ef9e46536243aea220a71bcc0
MD5 4ce321a7748ff32b3071b34c0babb557
BLAKE2b-256 4c21d5aa3dd779ea98b825e18ebae38f532524fb65820353069373356d839c8f

See more details on using hashes here.

File details

Details for the file multiversx_sdk-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: multiversx_sdk-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 16.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for multiversx_sdk-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 06e1d1e8d8bd5217b7085a1da16cc69380ad34d256e2dcf5f6ca8ee8fb1c30c6
MD5 75ea762f9d14dec5c1f7a66dad2de3d1
BLAKE2b-256 fc6dd947056cc1686e2382919d70059c9ac5ddf93780528d57e0f85be860311e

See more details on using hashes here.

Supported by

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