anchorpy
The Python Anchor client.
What it is and what it does
AnchorPy bridges Python and Solana's Anchor framework, allowing developers to generate and use type-safe clients for Anchor programs without writing boilerplate. It reads an Anchor program's IDL (Interface Definition Language) and generates either static Python classes or provides a dynamic client interface, similar to the TypeScript anchor-ts library.
The package includes a Pytest plugin for testing Anchor programs in Python, a CLI with development utilities, and integrates with Solana's ecosystem libraries (solders, borsh-construct, based58). It targets developers building on Solana who prefer Python over TypeScript or Rust, or who need Python-based tooling for program interaction and testing.
Use it for:
- Generate type-safe Python clients from Anchor IDL files to interact with deployed Solana programs.
- Write integration tests for Anchor programs using the built-in Pytest plugin.
- Automate Solana program interactions in Python scripts or backend services without manual RPC calls.
- Build Python-based tooling and utilities for Anchor program development and deployment.
- Interact with Solana smart contracts from data analysis or machine-learning pipelines.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
AnchorPy is a Python client library for interacting with Anchor programs on the Solana blockchain, offering static and dynamic client generation, a Pytest plugin, and CLI utilities.
Yes, if you are building on Solana and need a Python client for Anchor programs. The package has low install friction and no known vulnerabilities. However, the 506-day gap since the last release and unclear license status warrant verification before committing to production use. Check the repository for the actual license and confirm ongoing maintenance fits your project's support expectations.
Install
anchorpy on PyPI
pip
pip install anchorpyuv
uv add anchorpypoetry
poetry add anchorpyInstalling anchorpy
Before you install
Low install friction with a pure-Python wheel. Maintenance is aging—last release was 506 days ago—but the repository remains active with a recent commit on 2025-03-26 and moderate community interest (278 stars).
License in practice
License treatment is unclear; no SPDX identifier or raw license text is recorded. Verify the actual license terms in the repository before adopting this package in a commercial or restricted-license context.
Quickstart
pip install anchorpy
from anchorpy import Program
from solders.keypair import Keypair
# Load and interact with an Anchor program
program = Program.at(program_id, provider)
Requires Python >=3.9. Solana network connectivity and a valid Anchor IDL (Interface Definition Language) file are needed to interact with programs.
Verify before relying
- Whether the package is actively maintained or in maintenance-only mode given the 506-day gap since last release.
- The actual license under which anchorpy is distributed (SPDX and raw license are both null in metadata).
- Whether the 9 runtime dependencies (including solana, solders, borsh-construct) are all actively maintained and compatible with current Solana tooling.
Package facts
| License | not declared (unclear) |
| Python support | supports the current Python release (~=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 9 — anchorpy-core, based58, borsh-construct, construct-typing, pyheck, solana, solders, toml, toolz |
| Maintenance | aging — 506 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 168,980/month — #10,430 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: anchorpy-0.21.0-py3-none-any.whl
Tags
More Internet packages
Botocore provides low-level, data-driven access…
permissive · top 100 on PyPI
aiobotocoreProvides an async client for AWS services using…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
filelockProvides a platform-independent file locking…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
googleapis-common-protosProvides common Protocol Buffer message…
permissive · top 100 on PyPI
anchorpy-coreProvides Python bindings to Anchor Rust code,…
permissive · top 15,000 on PyPI
solanaSolana.py is a Python SDK for building…
permissive · top 5,000 on PyPI
cosmpyCosmPy provides Python bindings to interact…
permissive · top 15,000 on PyPI
web3web3.py is a Python library for interacting…
permissive · top 5,000 on PyPI
tronpytronpy is a Python client library for…
permissive · 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
injective-pyInjective Python SDK provides client libraries…
permissive · top 15,000 on PyPI
chia-puzzles-pyProvides Python bindings to the standard Chia…
unclear · top 15,000 on PyPI
eth-brownieBrownie is a Python framework for developing,…
permissive · top 15,000 on PyPI