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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aptos_sdk-0.6.3-py3-none-any.whl (36.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aptos_sdk-0.6.3.tar.gz
  • Upload date:
  • Size: 32.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.3 Linux/6.3.6-arch1-1

File hashes

Hashes for aptos_sdk-0.6.3.tar.gz
Algorithm Hash digest
SHA256 e94d44e604fbf8da082bf681b33bcc8ccf2d695cf91a11db0f0ae52dac7b88f3
MD5 94ee8607cdbd69c9aeb2333af01c0354
BLAKE2b-256 a2ad036ffcf4120f657c19f150d65099ceffd57ce9fb70daaf112305c7f4a215

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aptos_sdk-0.6.3-py3-none-any.whl
  • Upload date:
  • Size: 36.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.3 Linux/6.3.6-arch1-1

File hashes

Hashes for aptos_sdk-0.6.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f79d4e7e1fb16bcce69e4b032d749f7607b590f801ca9bca6c253a3df3e71d26
MD5 201bb86107cc4a15f8ff62d613026487
BLAKE2b-256 c561f08a07bd306fc3c369922180f7275d6c3956cdd0ec44ac0da9b8f0143148

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page