OpenViSTAI · Agents · Blockchain · Crypto
Menu
Developer Tools

Cosmpy

Cosmpy is a Python client library for querying and interacting with Cosmos-SDK-based blockchain networks. Its repository includes a Fetch.ai balance-query example and examples for transfers, staking, smart-contract deployment and interaction, and atomic swaps.

Independent OpenViST project profile, based on linked sources.

Cosmpy — OpenViST project profile in Developer Tools.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use Cosmpy when a Python application needs to query or interact with a Cosmos-SDK-based blockchain and its documented examples match the intended operation.

Who it is for

  • Python developers building applications that interact with Cosmos-SDK networks.
  • Developers exploring ledger queries, token transfers, staking, smart contracts or atomic swaps.

Documented uses

  • Query all coin balances for a blockchain account.
  • Build workflows for token transfers or staking.
  • Explore smart-contract deployment and interaction.
  • Prototype atomic-swap applications.
Before you choose

Requirements & limits

  • The library is written in Python and installed through pip.
  • The balance-query example uses Fetch.ai mainnet configuration.
  • The repository lists an Apache-2.0 license.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Query account balances on Fetch.ai mainnet

Use CosmPy’s documented example to query and print all balances for an account.

Before you start

  • Python environment with CosmPy installed using pip3.
  • The account address to query.

Steps

  1. Install CosmPy with the command below.

    Documented command
    pip3 install cosmpy
  2. Create a LedgerClient using NetworkConfig.fetchai_mainnet().

  3. Pass the account address to query_bank_all_balances.

  4. Iterate over the returned coins and print each coin’s amount and denomination.

Expected outcome

The example prints the queried account’s coin balances as amount-and-denomination pairs.

Guide limitations

  • This recipe covers the Fetch.ai mainnet configuration shown in the example; other network configurations are not specified here.
  • The example queries balances only; it does not document how to submit transactions.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
6 October 2026
Original website title
fetchai/cosmpy · Official homepage title · retained in its source language