Skip to main content

Solana.py

Project description

Actions Status PyPI version PyPI pyversions Codecov License: MIT Code style: black

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

  1. Install pipenv.
brew install pipenv
  1. Install dev dependencies.
pipenv install --dev
  1. 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


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.11.0.tar.gz (56.4 kB view details)

Uploaded Source

Built Distribution

solana-0.11.0-py3-none-any.whl (70.6 kB view details)

Uploaded Python 3

File details

Details for the file solana-0.11.0.tar.gz.

File metadata

  • Download URL: solana-0.11.0.tar.gz
  • Upload date:
  • Size: 56.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.7.9

File hashes

Hashes for solana-0.11.0.tar.gz
Algorithm Hash digest
SHA256 11e6ed55dc44b2f1883a5033efef1956f2df97baba972bb01980c2a982be786f
MD5 676d0e221552ad6543465d5ab9ca0b6b
BLAKE2b-256 17bd0f6f5d5daaeba0c43bffd1910b321f24fea9b449ca6d64bb0da93fd4971c

See more details on using hashes here.

File details

Details for the file solana-0.11.0-py3-none-any.whl.

File metadata

  • Download URL: solana-0.11.0-py3-none-any.whl
  • Upload date:
  • Size: 70.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.7.9

File hashes

Hashes for solana-0.11.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8aee160c3d4c8a70fb76a4700cec7fa2f9b5b1db7451fa78f17b8a44ed759d99
MD5 9d6ba7e29a25d283675f44953bdbff76
BLAKE2b-256 e0a3bf17c231b8444052a9f6ff38ec7287ac04821fbcdc8d096dc63b73ba95eb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page