Aptos Python SDK — a pure Python library for interacting with the Aptos blockchain. No infrastructure services (databases, Docker, etc.) are required for development.
- uv must be available on PATH. Install via
curl -LsSf https://astral.sh/uv/install.sh | sh. - Python 3.12+ is required (Python 3.12 is pre-installed on the VM).
All make targets use uv run. See Makefile for the full list.
| Task | Command |
|---|---|
| Install deps | uv sync --extra dev |
| Unit tests + BDD specs | make test |
| Lint (mypy + ruff) | make lint |
| Autoformat | make fmt |
| Test coverage | make test-coverage |
A git pre-commit hook is provided in .githooks/. To enable it:
git config core.hooksPath .githooksThis runs make fmt, make lint, and v2 ruff checks/formatting before each commit, failing if formatting produces any changes. Always run make fmt and make lint (and cd v2 && uv run ruff check --fix src/ tests/ && uv run ruff format src/ tests/) before committing or pushing.
make fmtreformats files viaruff. After running it, checkgit diff— the existing codebase may not be fully formatted, somake fmtcan produce changes even on a clean checkout. Do not commit those unless the PR is specifically about formatting.- E2E / integration tests (
make examples,make integration_test) require a running Aptos local testnet and theAPTOS_CLI_PATHenvironment variable. These are not needed for normal SDK development or unit testing. - The sync client (
client.py) is deprecated; useasync_client.pyfor new work.