Skip to main content

Djib Python API

Project description


Djib Python SDK

It's the base Python library for interacting with Djib network. You can use it interact with the Djib network.

Quickstart

Installation

pip install djib

General RPC Usage

from djib.rpc import DjibRpc

WALLET_PRIVATE_KEY = '<Base58 encoded string>'

try:
    rpc = DjibRpc(WALLET_PRIVATE_KEY, is_devnet=True)

    # status of drive
    response = rpc.status()

    if response.error:
        print(f"Error: {response.error['message']}, Code: {response.error['code']}, Data: {response.error['data']}")
    else:
        print(response.data)
except Exception as e:
    print(f"Error: {str(e)}")

KMS Usage

from djib.rpc import KmsClient

WALLET_PRIVATE_KEY = '<Base58 encoded string>'

try:
    kms = KmsClient(WALLET_PRIVATE_KEY, is_devnet=True)
    a = 'Hello, World!'
    a_enc = kms.encrypt(a)
    a_dec = kms.decrypt(a_enc)
    assert a_dec == a
except Exception as e:
    print(f"Error: {str(e)}")

Development

Setup

  1. Install poetry
  2. Install dev dependencies:
poetry install
  1. Activate the poetry shell.
poetry shell

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

djib-0.1.2.tar.gz (20.3 kB view details)

Uploaded Source

Built Distribution

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

djib-0.1.2-py3-none-any.whl (20.4 kB view details)

Uploaded Python 3

File details

Details for the file djib-0.1.2.tar.gz.

File metadata

  • Download URL: djib-0.1.2.tar.gz
  • Upload date:
  • Size: 20.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.14 CPython/3.10.6 Linux/5.15.62-1-MANJARO

File hashes

Hashes for djib-0.1.2.tar.gz
Algorithm Hash digest
SHA256 0f98d5d5a0420007c2675335e2aabcbe577adddaeb2058fa49569d582814d146
MD5 0adcb1e953d6cba112611e9b7698694c
BLAKE2b-256 a0f23ecdaabfaca432d9236eccef15119427ebe12dea4221de75a28ef43a79fe

See more details on using hashes here.

File details

Details for the file djib-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: djib-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 20.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.14 CPython/3.10.6 Linux/5.15.62-1-MANJARO

File hashes

Hashes for djib-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cf22e94dc898387854525556078da8140e99c7e67b7479e64e692ee84bc5d437
MD5 5e9c53314c5efbace7b3ec6f1e5161f5
BLAKE2b-256 9fff15b646870798ae9d8e04914aee3a5c43a9b636a353702bcd244a99055344

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