Registry / database / cosmpy

cosmpy

JSON →
library0.12.2pypypiunverified

A Python library for interacting with Cosmos SDK-based blockchains. Supports transaction creation, signing, and querying. Current version 0.11.2 (latest stable), with release candidates for 0.12.0 targeting Cosmos SDK v0.53.4. Release cadence is irregular, with several minor versions per year.

pip install cosmpy
INSTALL
IMPORT
SIG · COSMPY
C
cosmpy
databasepythonv0.12.2
Install
6.9s avg
Import
—
Disk
81MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.12.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 82.6MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 6.9s · import 0.000s · 80MB
81MB installed
● package 81MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

LedgerClient
✓ from cosmpy import LedgerClient
✗ from cosmpy.clients import LedgerClient

Connect to a Cosmos node, create a wallet from a mnemonic, and query a balance.

from cosmpy.clients import LedgerClient from cosmpy.wallet import Wallet # Connect to a Cosmos node client = LedgerClient("https://rpc.cosmos.network:26657") # Create a wallet from a mnemonic (use env var for security) import os mnemonic = os.environ.get("MNEMONIC", "") wallet = Wallet.from_mnemonic(mnemonic) # Query balance balance = client.query_bank_balance(wallet.address(), "uatom") print(balance)
Debug
Known issues
gotchaImport path for clients is cosmpy.clients (plural). Many examples show 'cosmpy.client' which does not exist.
fix
Use 'from cosmpy.clients import LedgerClient'.
affects: >=0.8.0
gotchaWallet class moved from cosmpy.crypto to cosmpy.wallet in v0.8.0.
fix
Use 'from cosmpy.wallet import Wallet'.
affects: >=0.8.0
gotchaThe 'LedgerClient' is not available in v0.12.0rc* (replaced by 'StargateClient'). If you upgrade to v0.12.0rc, update imports.
fix
Use 'from cosmpy.clients import StargateClient' instead.
affects: 0.12.0rc0,0.12.0rc1
gotchaWhen querying balances, the denomination string must match the chain's coin type (e.g., 'uatom' for Cosmos Hub). Using a wrong denomination returns zero or error.
fix
Check the chain's coin denom (e.g., 'uatom', 'uosmo', etc.).
affects: all
gotchaTransaction broadcasting requires a client with a valid connection. Timeout errors often occur if RPC endpoint is unreachable.
fix
Ensure the RPC URL is correct and the node is accessible. Use client.ping() to test connectivity.
affects: all
Upgrade
Version history
0.12.2latest on PyPI · released May 26, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
OpenAI (training)
1
Resources
cosmpy — pip install cosmpy · libregistry