Skip to main content

Aptos SDK

Project description

Aptos Python SDK

Discord PyPI Package Version PyPI Package Downloads

This provides basic functionalities to interact with Aptos. Get started here.

Currently this is still in development and may not be suitable for production purposes.

Note: The sync client is deprecated, please only start new projects using the async client. Feature contributions to the sync client will be rejected.

Requirements

This SDK uses Poetry for packaging and dependency management:

curl -sSL https://install.python-poetry.org | python3 -
poetry install

Unit testing

make test

E2E testing

First, run a local testnet (run this from the root of aptos-core):

cargo run -p aptos -- node run-local-testnet --with-faucet --faucet-port 8081 --force-restart --assume-yes

Next, tell the end-to-end tests to talk to this locally running testnet:

export APTOS_NODE_URL="http://127.0.0.1:8080/v1"
export APTOS_FAUCET_URL="http://127.0.0.1:8081"

Finally run the tests:

make examples

Note: These end-to-end tests are tested against a node built from the same commit as part of CI, not devnet. For examples tested against devnet, see developer-docs-site/static/examples/python/ from the root of the repo.

Autoformatting

make fmt

Generating types

The Python openapi-python-client tool cannot parse references. Therefore there are three options:

  • Use swagger-cli to dereference, gain a type explosion, and still have missing types
  • Live without missing types
  • Write a pure python implementation with no autogenerated code

Currently the team is moving forward with pure python, but leaves the following notes for the curious:

npm install  -g @apidevtools/swagger-cli
swagger-cli bundle --dereference ../../../api/doc/v0/openapi.yaml  -t yaml > openapi.yaml
python3 -m openapi_python_client generate --path openapi.yaml
mv aptos-dev-api-specification-client/aptos_dev_api_specification_client/ aptos_sdk/openapi

Semantic versioning

This project follows semver as closely as possible

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

aptos_sdk-0.6.2.tar.gz (28.1 kB view details)

Uploaded Source

Built Distribution

aptos_sdk-0.6.2-py3-none-any.whl (31.6 kB view details)

Uploaded Python 3

File details

Details for the file aptos_sdk-0.6.2.tar.gz.

File metadata

  • Download URL: aptos_sdk-0.6.2.tar.gz
  • Upload date:
  • Size: 28.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.9.16 Darwin/22.5.0

File hashes

Hashes for aptos_sdk-0.6.2.tar.gz
Algorithm Hash digest
SHA256 157129c9b3864b929cc2270d2582eb3e0ab8f940771354c77d029fe08265ce8a
MD5 932cf2bf2494f179f7d816e8afda910e
BLAKE2b-256 c8bdee5b1068da70b6caf0b031a4625dfec4487aba99d7f94be4a4c2afd8c505

See more details on using hashes here.

File details

Details for the file aptos_sdk-0.6.2-py3-none-any.whl.

File metadata

  • Download URL: aptos_sdk-0.6.2-py3-none-any.whl
  • Upload date:
  • Size: 31.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.9.16 Darwin/22.5.0

File hashes

Hashes for aptos_sdk-0.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 33adf6b30aeb45c36a9b93a99c58699552120cd0931dda8ab853a538e5806cd1
MD5 1490fe46d77d86340e7eb1385c6d2a4f
BLAKE2b-256 88c4c037c29f706482e6431ba0a22dc234092765e95a8749fd98362c5ea57245

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