Registry / devops / anchorpy-core

anchorpy-core

JSON →
library0.2.0pypypi✓ verified 84d ago

Python bindings for Anchor Rust code, providing a typed client for Solana programs. Current version 0.2.0, release cadence unknown.

pip install anchorpy-core
INSTALL
IMPORT
SIG · ANCHORPY-CORE
A
anchorpy-core
devopspythonv0.2.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

Idl
from anchorpy_core.idl import Idl
Correct import for the IDL type
Program
from anchorpy_core.program import Program
Correct import for the Program client

Initialize a connection to a Solana program using anchorpy-core's provider pattern.

import os from anchorpy import Provider, Wallet from solders.pubkey import Pubkey # Connect to Solana devnet provider = Provider.local() # Replace with your program ID program_id = Pubkey.from_string(os.environ.get('PROGRAM_ID', 'YourProgramIDHere')) print(f"Connected to provider, ready to interact with {program_id}")
Debug
Known issues
breakinganchorpy-core 0.2.0 is a rewrite from anchorpy v0.1.x. The API has changed; do not mix imports from both libraries.
fix
Use only anchorpy-core >=0.2.0. Uninstall old anchorpy if present.
affects: 0.1.x
gotchaThe 'Idl' class is now under anchorpy_core.idl, not anchorpy.idl. Common mistake leads to ImportError.
fix
Use 'from anchorpy_core.idl import Idl'.
affects: 0.2.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'anchorpy_core'
Installed wrong package (e.g., 'anchorpy' instead of 'anchorpy-core') or version pinned to old release.
fix
Run 'pip install anchorpy-core' and ensure version >=0.2.0.
ImportError: cannot import name 'Idl' from 'anchorpy'
Trying to import from the old 'anchorpy' package which has a different structure.
fix
Use 'from anchorpy_core.idl import Idl'.
Upgrade
Version history
0.2.0latest on PyPI · released Dec 29, 2023
Audit
Dependencies
anchorpyrequiredCore dependency for Anchor IDL parsing and client
soldersrequiredSolana data types
Agent activity
20 hits · last 30 days
node
18
OpenAI (training)
1
Resources

No resource links recorded.