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

Uploaded Source

Built Distribution

solana-0.12.1-py3-none-any.whl (81.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: solana-0.12.1.tar.gz
  • Upload date:
  • Size: 63.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.7.9

File hashes

Hashes for solana-0.12.1.tar.gz
Algorithm Hash digest
SHA256 8f92a6c83988d09525681d6761c84a3388f4de1cbd20193b909243d9fc0485a2
MD5 1b30b8427ca0c2ac7009393a087612d2
BLAKE2b-256 d6265352b8f74e767066a2e06ebeb677eebe0ff06ceae655e4542133dbb417d1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: solana-0.12.1-py3-none-any.whl
  • Upload date:
  • Size: 81.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.7.9

File hashes

Hashes for solana-0.12.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6bd5b0f1fc4d8a8502ad0108e383d768b0c5edfc809c0a9fd5ae421b74973f20
MD5 e173468d0cfbbd9f165b976246e461a3
BLAKE2b-256 395957f70be029db7126ff1de60ee8b6db86c593e77cfe9c315e85014df34679

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