---
title: Python SDK
description:
  Learn how to interact with Solana using the Python SDK (michaelhly/solana-py).
h1: Python SDK for Solana
---

## Solana Python SDK

There are two packages that are useful for developing with Python:

[`@kevinheavy/solana.py`](https://github.com/michaelhly/solana-py)

- Solana.py is the base Python library for interacting with Solana.
- You can use it to build transactions and interact with the
  [Solana JSON RPC API](/docs/rpc), much like you would do with
  [solana-web3.js](https://github.com/solana-labs/solana-web3.js/)

- It also covers the [SPL Token Program](https://spl.solana.com/token).

- [Latest Documentation](https://michaelhly.github.io/solana-py/).

[`@kevinheavey/solders`](https://github.com/kevinheavey/solders)

- `solders` is a high-performance Python toolkit for Solana, written in Rust. It
  provides robust solutions in the following areas:

- Core SDK functionality: keypairs, pubkeys, signing and serializing
  transactions.
- RPC: building requests and parsing responses (for networking and asynchronous
  APIs, [solana-py](https://michaelhly.github.io/solana-py/rpc/async_api/) is
  the recommended option).
- Integration testing: the `solders.litesvm` module is an alternative to
  `solana-test-validator` that's much more convenient and **much** faster. It's
  based on [solana-program-test](https://crates.io/crates/solana-program-test).

## Solana Client Python SDK

If you want to interact with Solana contracts with Python, you can use clients
SDK to render Solana rust contracts to Python clients, if only you can get the
IDL file of the contract.

[`Codama-py`](https://www.npmjs.com/package/codama-py)

- Standardize any Solana onchain contract program to
  [`Codama IDL`](https://github.com/codama-idl/codama) and generate an
  interactive Python client.
- Supports both Anchor and custom programs.

[`Anchor-py`](https://github.com/kevinheavey/anchorpy)

- Anchor-py is a Python client for Anchor programs. It can generate clients from
  Anchor IDL files, and interact with Anchor programs.

## Solana Python Cookbook

[`Solana Python Cookbook`](/developers/cookbook) A collection of examples and
recipes for developing Solana using Python SDK.
