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.2.tar.gz
(62.5 kB
view details)
Built Distribution
solana-0.18.2-py3-none-any.whl
(76.9 kB
view details)
File details
Details for the file solana-0.18.2.tar.gz
.
File metadata
- Download URL: solana-0.18.2.tar.gz
- Upload date:
- Size: 62.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.11 CPython/3.7.9 Darwin/20.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0431bd10cbe92d82a0c102e9f736483afc06ffbb6af18b81b06aec0c5e029813 |
|
MD5 | d4a8933140a7de032446dfe40ae56a1d |
|
BLAKE2b-256 | c3cf129477a6a7e425d86f116978842427659046b8966931a4dd85106afb2cfc |
File details
Details for the file solana-0.18.2-py3-none-any.whl
.
File metadata
- Download URL: solana-0.18.2-py3-none-any.whl
- Upload date:
- Size: 76.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.11 CPython/3.7.9 Darwin/20.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0550915db89261ed78335ee5728341e7094444a6442529d9c9407e364185456 |
|
MD5 | 734cdeadf4a791e9e42a9892f7e9e9ea |
|
BLAKE2b-256 | 91c39d673ce1d0ed877122a2a2b419b26e4c3e128f2ea7638da6455ec47da021 |