Solana Python API
Project description
Solana.py
Solana Python API built on the JSON RPC API.
Python version of solana-web3.js for interacting with Solana.
Read the Documentation.
Quickstart
Installation
pip install solana
General Usage
import solana
API Client
from solana.rpc.api import Client
http_client = Client("https://api.devnet.solana.com")
Async API Client
import asyncio
from solana.rpc.async_api import AsyncClient
async def main():
async with AsyncClient("https://api.devnet.solana.com") as client:
res = await client.is_connected()
print(res) # True
# Alternatively, close the client explicitly instead of using a context manager:
client = AsyncClient("https://api.devnet.solana.com")
res = await client.is_connected()
print(res) # True
await client.close()
asyncio.run(main())
Development
Setup
- Install poetry
- Install dev dependencies:
poetry install
- Activate the poetry shell.
poetry shell
Lint
make lint
Tests
# All tests
make tests
# Unit tests only
make unit-tests
# Integration tests only
make int-tests
Start a Solana Localnet
Install docker.
# Update/pull latest docker image
make update-localnet
# Start localnet instance
make start-localnet
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
solana-0.18.3.tar.gz
(62.5 kB
view details)
Built Distribution
solana-0.18.3-py3-none-any.whl
(77.0 kB
view details)
File details
Details for the file solana-0.18.3.tar.gz
.
File metadata
- Download URL: solana-0.18.3.tar.gz
- Upload date:
- Size: 62.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.7 CPython/3.9.1 Linux/5.4.72-microsoft-standard-WSL2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59a664e7008f9a385447e6e870b241df4954dc2b889cc278de96047d6b09d181 |
|
MD5 | d006563b1bf1ef628010b17910a6229b |
|
BLAKE2b-256 | bc2bcadf2bab474e31d90efc0935801bf9536b10d482d3d1053e2c16bc9f91be |
File details
Details for the file solana-0.18.3-py3-none-any.whl
.
File metadata
- Download URL: solana-0.18.3-py3-none-any.whl
- Upload date:
- Size: 77.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.7 CPython/3.9.1 Linux/5.4.72-microsoft-standard-WSL2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7778f477e4c2d880f6ce181830fcc2bc78a93e69abb645d49c77ba2a8105afe |
|
MD5 | 859b438bbaa4913fba9d063f4d23476a |
|
BLAKE2b-256 | 68e7c600da362e30b378f379218ae50941213fb024517f1a7bfa4e4f20e026ea |