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
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.1.tar.gz
(70.8 kB
view details)
Built Distribution
solana-0.18.1-py2-none-any.whl
(87.4 kB
view details)
File details
Details for the file solana-0.18.1.tar.gz
.
File metadata
- Download URL: solana-0.18.1.tar.gz
- Upload date:
- Size: 70.8 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 | fcd1cecd6b5a0c74e8ac5045626439fe3befb2820daf03076fd5b28c20fc2262 |
|
MD5 | 5c36e109eed4712e59a80b9772ac8938 |
|
BLAKE2b-256 | be02f7628547fef5001c13792385d073bed239c6cbac4ef24a29ec4e87092b2c |
File details
Details for the file solana-0.18.1-py2-none-any.whl
.
File metadata
- Download URL: solana-0.18.1-py2-none-any.whl
- Upload date:
- Size: 87.4 kB
- Tags: Python 2
- 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 | 86e1b1fd4b1670db9bd37ce69088b4d1b6d08b5fd1496f3dc6b269ffdd5a5ef5 |
|
MD5 | e4c900b530cc474bde61b880496ec801 |
|
BLAKE2b-256 | 8dc8e35d2daeec0d83ad5f5484e329ad7b0fb327e0570bf3584af2701ff0682f |