cosmpy
A library for interacting with the cosmos networks
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 cosmpyuv
uv add cosmpypoetry
poetry add cosmpyInstalling 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
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
web3web3.py is a Python library for interacting…
permissive · top 5,000 on PyPI
injective-pyInjective Python SDK provides client libraries…
permissive · top 15,000 on PyPI
anchorpyAnchorPy is a Python client library for…
unclear · top 15,000 on PyPI
cdp-sdkPython client library for the Coinbase…
permissive · top 15,000 on PyPI
aptos-sdkProvides Python bindings to interact with the…
permissive · top 15,000 on PyPI
tronpytronpy is a Python client library for…
permissive · top 15,000 on PyPI
stellar-sdkStellar SDK provides Python APIs to build and…
permissive · top 15,000 on PyPI
pycoingeckoPython wrapper around the CoinGecko API (v3)…
permissive · top 15,000 on PyPI
tonsdkLow-level Python library for interacting with…
permissive · top 15,000 on PyPI
azure-cosmosPython client library for Azure Cosmos DB SQL…
permissive · top 1,000 on PyPI