Skip to content

Python SDK

Aptos provides a lightly maintained official Python SDK. It is available on PyPi with the source code in the aptos-python-sdk GitHub repository. Much of the functionality of the Python SDK mirrors the Typescript SDK. The primary purpose of the Python SDK is to help Python developers to quickly become familiar with Aptos and as an accompaniment to Aptos tutorials.

The Python SDK can either be installed via pip, from source, or embedded:

To install via pip:

Terminal window
pip3 install aptos-sdk

The aptos-sdk will be installed in the local site packages directory. For example, on macOS, you will find the aptos-sdk in the ~/Library/Python/3.8/lib/python/site-packages/aptos_sdk directory.

To install from source:

Terminal window
git clone https://github.com/aptos-labs/aptos-python-sdk
pip3 install . --user

To embed the Python SDK into your existing Python project:

Terminal window
cd /path/to/python/project
cp -r /path/to/aptos-python-sdk aptos-sdk

See the Developer Tutorials for code examples showing how to use the Python SDK.