Python SDK

An SDK written in Python for KiiChain

Introduction to the SDK

This project is still under development so future changes will be made.

The Python SDK allows you to build on KiiChain with predetermined set of coding. You can index, query, and send transactions, as well as access market data for various purposes like analysis, creating indicators, algorithmic trading, strategy backtesting, and bot programming.

This package is ideal for developers, coders, experienced traders, and data scientists who are interested in building on the network.

Start here

Details on how to setup the dev environment can be found in the development guidelines. Using poetry virtual environment is highly encouraged to ensure seamless development.

Notes:

  • Items that need to be looked into are marked as TODO: in the code and docs.

  • Workflows are failing due to usage limits. It's advisable to fix this to ensure code quality. Current workaround is to make sure to run corresponding checks and tests locally.

KiiPy Video Demo

The demo video can be found here. Operations include creating a wallet, getting balances, sending tokens, and staking.

Installation

Install with pip

pip install kiipy

Install from source code

  1. Clone the repository

git clone https://github.com/KiiBlockchain/kiipy.git
cd kiipy
  1. Install the required dependencies

poetry install
  1. Open the virtual environment

poetry shell

Getting Started

Below is a simple example for querying an account's balances:

from kiipy.aerial.client import LedgerClient, NetworkConfig

# connect to Kii test network using default parameters
ledger_client = LedgerClient(NetworkConfig.kii_testnet())

alice: str = 'kii1pyt53arxkg5t4aww892esskltrf54mg88va98y'
balances = ledger_client.query_bank_all_balances(alice)

# show all coin balances
for coin in balances:
  print(f'{coin.amount}{coin.denom}')

Examples

Under the examples directory, you can find examples of basic ledger interactions using kiipy, such as transferring tokens, staking, and deploying.

Contributing

All contributions are very welcome! Remember, contribution is not only PRs and code, but any help with docs or helping other developers solve their issues are very appreciated!

Read below to learn how you can take part in the KiiPy project.

Code of Conduct

Please be sure to read and follow our Code of Conduct. By participating, you are expected to uphold this code.

Contribution Guidelines

Read our contribution guidelines to learn about our issue and pull request submission processes, coding rules, and more.

Development Guidelines

Read our development guidelines to learn about the development processes and workflows.

Issues, Questions and Discussions

We use GitHub Issues for tracking requests and bugs, and GitHub Discussions for general questions and discussion.

License

The KiiPy project is licensed under Apache License 2.0.

Last updated

Logo