Skip to main content

Hedera SDK in Python

Project description

hedera-sdk-py

Hedera SDK in Python

This is basically a python wrapper of Hedera SDK in Java.

Install

pip install hedera-sdk-py

How to build

  • Make sure to install Hedera Java SDK Git submodule
  • Build Hedera Java SDK JAR
    • Go to Java SDK directory and apply most recent patch:
    cd ./hedera-sdk-java
    git apply ../patches/v2.46.0.patch
    
    • Build JAR
    ./gradlew assemble
    
  • Go back to root and run code generation script:
    cd ..
    python ./scripts/generate_code.py
    

How to Use

from hedera import PrivateKey
prikey = PrivateKey.generate()
print("Private key: {}".format(prikey.toString()))
print("Public key: {}".format(prikey.getPublicKey().toString()))

You must make sure JAVA_HOME is set to a JRE/JDK that's >=11. Do a echo $JAVA_HOME on Linux/MacOS or echo %JAVA_HOME% on Windows to confirm.

MacOS example:

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-16.0.2.jdk/Contents/Home

Linux example:

export JAVA_HOME=/usr/lib/jvm/java-16-openjdk-amd64

Windows:

Type to search "advanced system", you should see "View Advanced System settings", click it, then click "Environment Variables..."

On Windows, if you get "no jvm dll found" error, you need to add %JAVA_HOME%/bin/server (i.e. C:\Program Files\Java\jdk-11.0.10\bin\server) to your path.

See examples for more example usages.

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

hedera_sdk_py-2.50.0.tar.gz (26.1 MB view details)

Uploaded Source

Built Distribution

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

hedera_sdk_py-2.50.0-py3-none-any.whl (26.1 MB view details)

Uploaded Python 3

File details

Details for the file hedera_sdk_py-2.50.0.tar.gz.

File metadata

  • Download URL: hedera_sdk_py-2.50.0.tar.gz
  • Upload date:
  • Size: 26.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.5

File hashes

Hashes for hedera_sdk_py-2.50.0.tar.gz
Algorithm Hash digest
SHA256 476a40dce3c2530fb0f4f08c07b8a03e4cab58b3748326545245cbf3a94e30d6
MD5 e1c2f81277ae0bebd6b7f05b7d7323c5
BLAKE2b-256 9584c4a312bcc6b503204973fd7883b8495b1d6e36b015118ae14253433f1a15

See more details on using hashes here.

File details

Details for the file hedera_sdk_py-2.50.0-py3-none-any.whl.

File metadata

  • Download URL: hedera_sdk_py-2.50.0-py3-none-any.whl
  • Upload date:
  • Size: 26.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.5

File hashes

Hashes for hedera_sdk_py-2.50.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6db1c6088074d80c454afb9da8b72f52772992756d7b62a8e44f74189b469517
MD5 427c98cf500f1a79d4043d4201ee22c2
BLAKE2b-256 a4455c2ce5bfd238e41ccaba83e580e4684739f12aa783a5f16e010c9544bbf2

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