skillfed

anchorpy

The Python Anchor client.

anchorpy v0.21.0 169.0K downloads/30d#10,430 on PyPI278
License unclear AGING released

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 anchorpy

uv

uv add anchorpy

poetry

poetry add anchorpy

Installing 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

solana anchor python clientanchor program interaction pythonsolana blockchain client libraryanchor idl code generationsolana smart contract client
solanablockchaincode-generation

More Internet packages