Skip to main content

drt-py-sdk

The Python SDK for interacting with DharitrI. 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/ dharitri_py_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 dharitri_py_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.

Metadata

Release files for dharitri-py-sdk-test 0.0.6

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

Source distribution (sdist)

Source distribution for dharitri-py-sdk-test 0.0.6
File Size Uploaded Provenance Actions
dharitri_py_sdk_test-0.0.6.tar.gz 16.1 MB Without provenance Details for dharitri_py_sdk_test-0.0.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dharitri-py-sdk-test 0.0.6
File Interpreter ABI Platform Actions
dharitri_py_sdk_test-0.0.6-py3-none-any.whl Python 3 none any Details for dharitri_py_sdk_test-0.0.6-py3-none-any.whl

Total release size: 32.4 MB

Release files / dharitri_py_sdk_test-0.0.6.tar.gz

Download URL dharitri_py_sdk_test-0.0.6.tar.gz
Size 16.1 MB
Tags Source
SHA-256 checksum
How to use checksums
de94832a8dff03105b95d95f984354566774dafa85c653193f23d311ff90a9ce
BLAKE2b-256 checksum
How to use checksums
2b1e970ba5adccca65471f9689d3fcc8d2e31b9d2f015a4aec1ca9b97767b1f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release files / dharitri_py_sdk_test-0.0.6-py3-none-any.whl

Download URL dharitri_py_sdk_test-0.0.6-py3-none-any.whl
Size 16.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
0d1a20f132be2b774cfa5b843316aea419c975bbb16020b2394e047e4914b114
BLAKE2b-256 checksum
How to use checksums
74dbee9289d3c97dd3efde5e91bf2e679bf430fe464a3a086183a0debe7cc74e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Security for dharitri-py-sdk-test 0.0.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.6 This release

2 release files No provenance

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