Skip to main content

A library for interacting with the cosmos networks

Project description

CosmPy

PyPI PyPI - Python Version PyPI - Wheel License

AEA framework sanity checks and tests Contributor Covenant

A python library for interacting with cosmos based blockchain networks

Installing

To install the library use:

pip3 install cosmpy

Getting Started

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

from cosmpy.aerial.client import LedgerClient, NetworkConfig

# connect to Fetch.ai network using default parameters
ledger_client = LedgerClient(NetworkConfig.fetchai_mainnet())

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

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

Documentation

Before running this command make sure your development environment is set up. Check Development setup for more details.

To see the documentation:

make docs-live

Then navigate to the following URL in your browser:

http://127.0.0.1:8000/cosmpy/

Examples

Under the examples directory, you can find examples of basic ledger interactions using cosmpy e.g. transferring tokens, staking, deploying and interacting with a smart contract, and performing atomic swaps.

To contribute

Please see CONTRIBUTING and DEVELOPING guides.

Extra Resources

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

cosmpy-0.6.2.tar.gz (195.4 kB view details)

Uploaded Source

Built Distribution

cosmpy-0.6.2-py3-none-any.whl (404.2 kB view details)

Uploaded Python 3

File details

Details for the file cosmpy-0.6.2.tar.gz.

File metadata

  • Download URL: cosmpy-0.6.2.tar.gz
  • Upload date:
  • Size: 195.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.9.15 Linux/5.15.0-1023-azure

File hashes

Hashes for cosmpy-0.6.2.tar.gz
Algorithm Hash digest
SHA256 a7c92b13a34bfa4b5287e56c3d4c7cb85cc3e8d008965da3fb18711c46c18ab6
MD5 886cf6ddadf2c04b4f47018d0eddcee0
BLAKE2b-256 38eea2f105f2c45d040e4f32e28f14353ec9220495582945a75c7b7330b3927b

See more details on using hashes here.

File details

Details for the file cosmpy-0.6.2-py3-none-any.whl.

File metadata

  • Download URL: cosmpy-0.6.2-py3-none-any.whl
  • Upload date:
  • Size: 404.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.9.15 Linux/5.15.0-1023-azure

File hashes

Hashes for cosmpy-0.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 537a262df4d72346e751c97480b122cbcbcc66be32ef321a1a95c2b1d8628ff1
MD5 3b27794746e3c62fce3a3010d45f52f5
BLAKE2b-256 2c94e5c84dc4fe3aa7e5ea240ddc949a9af51fed8247f1df3a5cd8c4ead6024b

See more details on using hashes here.

Supported by

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