skillfed

cosmpy

A library for interacting with the cosmos networks

cosmpy v0.12.2 83.7K downloads/30d#14,054 on PyPI150
Permissive license Apache-2.0 Active released

What it is and what it does

CosmPy is a Python client library for Cosmos SDK-based blockchains, primarily designed for the Fetch.ai network. It abstracts the complexity of blockchain interaction by providing high-level methods for common operations: querying account balances, transferring tokens, staking, and deploying or calling smart contracts. The library handles cryptographic signing, network communication via gRPC, and protocol buffer serialization internally.

The package is built on a foundation of established cryptographic and serialization dependencies (bcrypt, ecdsa, pycryptodome, protobuf, grpcio) and is actively maintained with recent releases. It targets developers building applications on Cosmos networks who want to avoid low-level protocol details. The library is in Alpha status, meaning the API may evolve, but it has been in development since 2021 and is actively used.

Use it for:

  • Query account balances and transaction history on Cosmos-based networks without running a full node.
  • Build automated token transfer or staking workflows that interact with blockchain accounts programmatically.
  • Deploy and interact with smart contracts on Cosmos networks from Python applications.
  • Integrate blockchain operations into backend services or data pipelines that need to read or write blockchain state.
  • Perform atomic swaps or multi-step transactions that require coordination across blockchain operations.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

CosmPy provides Python bindings to interact with Cosmos SDK-based blockchain networks, enabling account queries, token transfers, staking, and smart contract interactions.

Yes, if you are building on Cosmos SDK networks (especially Fetch.ai). The library is actively maintained, has low install friction, carries no known vulnerabilities, and uses a permissive license. The Alpha status means the API may change, so pin the version in production. Not relevant for non-Cosmos blockchain work.

Install

cosmpy on PyPI

pip

pip install cosmpy

uv

uv add cosmpy

poetry

poetry add cosmpy

Installing cosmpy

Before you install

Low friction installation with a pure-Python wheel. Active maintenance with a recent release 80 days ago and ongoing commits. Supports Python 3.10 through 3.14.

License in practice

Apache-2.0 permissive license allows commercial and private use with minimal restrictions, making it suitable for most projects.

Quickstart

pip install cosmpy

from cosmpy.aerial.client import LedgerClient, NetworkConfig

ledger_client = LedgerClient(NetworkConfig.fetchai_mainnet())
balances = ledger_client.query_bank_all_balances('fetch12q5gw9l9d0yyq2th77x6pjsesczpsly8h5089x')
for coin in balances:
    print(f'{coin.amount}{coin.denom}')

Requires Python 3.10 or later; depends on 14 runtime packages including cryptographic libraries (bcrypt, ecdsa, pycryptodome, pynacl).

Verify before relying

  • Whether the library supports networks beyond Fetch.ai mainnet or if other Cosmos chains are documented.
  • Performance characteristics when querying large account histories or performing batch operations.
  • Whether smart contract deployment and interaction examples cover all major contract types.

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (<4.0,>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 14 — bcrypt, bech32, ecdsa, googleapis-common-protos, grpcio, jsonschema, packaging, protobuf, pycryptodome, pynacl, python-dateutil, requests, sortedcontainers, virtualenv
Maintenance actively maintained — 80 days since the last release
Last repo commit
First released
Downloads 83,709/month — #14,054 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: cosmpy-0.12.2-py3-none-any.whl

Keywords: CosmPy, Cosmos-SDK

Development Status :: 3 - AlphaEnvironment :: ConsoleIntended Audience :: DevelopersIntended Audience :: Information TechnologyLicense :: OSI Approved :: Apache Software LicenseNatural Language :: EnglishOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: UnixProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software DevelopmentTopic :: Software Development :: Libraries :: Python ModulesTopic :: System

Tags

cosmos blockchain python clientcosmos sdk interaction libraryfetch.ai network integrationblockchain account queries pythoncosmos token transfer librarycosmos staking pythoncosmos smart contract interaction
blockchaincosmos-sdkcryptography

More Software Development packages