Solana.py
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 pipenv.
brew install pipenv
- Install dev dependencies.
pipenv install --dev
- Activate the pipenv shell.
pipenv 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
pipenv run update-localnet
# Start localnet instance
pipenv run start-localnet
Using Jupyter Notebook
make notebook
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.15.0.tar.gz
(69.2 kB
view details)
Built Distribution
solana-0.15.0-py3-none-any.whl
(87.1 kB
view details)
File details
Details for the file solana-0.15.0.tar.gz
.
File metadata
- Download URL: solana-0.15.0.tar.gz
- Upload date:
- Size: 69.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 216d0642358e0f65d8d66564c1c3205295f4d651781a06a428221267a7799162 |
|
MD5 | fd4e62b364d0b3efdcec19ed0fdf7642 |
|
BLAKE2b-256 | 13a291a99ac92ffbab4a0ecab254d2dcee124b3027117f0f6eac63b09ddff705 |
File details
Details for the file solana-0.15.0-py3-none-any.whl
.
File metadata
- Download URL: solana-0.15.0-py3-none-any.whl
- Upload date:
- Size: 87.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c7e7b03370e412269b888feb53b0f135f6b7faf8d7aee95eda55c87a6310a42 |
|
MD5 | c73a38201e6c21212473e29238a5b5fd |
|
BLAKE2b-256 | 06092a51d59ce515c363dcb747fe64fd5a6589372208c4fde1b352dce8c0af41 |