How michaelhly/solana-py works
Project type and purpose
• This is a Python SDK (library) for interacting with the Solana blockchain via its JSON‑RPC and WebSocket APIs. It provides both synchronous and asynchronous clients, utility functions (e.g., cluster URL management, validation), and wrappers around Solana’s core programs (e.g., SPL Token, Memo, Vote).
File structure
• Top‑level config & tooling
• .github/, GitHub Actions workflows (CI, docs, release)
• mkdocs.yml + docs/ — static documentation site
• pyproject.toml, poetry.toml, Makefile — packaging, dependency, build/test scripts
• Source code (src/solana and src/spl):
• solana/rpc — API layers: api.py, async_api.py, websocket_api.py
• solana/rpc/providers — pluggable transport implementations (HTTP, AsyncHTTP, WebSocket, base classes)
• solana/utils — helpers (cluster selection, validation, security.txt)
• solana/_layouts & vote_program.py — transaction‑building helpers for on‑chain programs
• spl/token & spl/memo — high‑level clients and instruction builders for SPL programs
• Tests
• unit/ and integration/ — exercise client, provider, instruction‑builder functionality
• docker-compose.yml — spin up local validator for integration tests
README for additional insights
• Clarifies that the library wraps the Solana JSON RPC API and SPL Token program
• Emphasizes both sync and async clients, plus a WebSocket subscription client
• Points to external dependency: solders for low‑level type definitions
Capturing essential elements in detail
• Major sub‑packages: rpc, rpc/providers, rpc/websocket_api, utils, vote_program, spl/token, spl/memo
• Interaction with external dependencies: solders, remote endpoints
• Where tests plug in (integration tests use docker‑compose local validator)
• Call out CI/CD and docs pipeline if relevant for a holistic view