Skip to main content

No project description provided

Project description

Aptos Python SDK

Discord PyPI Package Version PyPI Package Downloads

You need to connect to an Aptos node to use this library, or run one yourself locally.

Currently this is still in development and is unsuitable for directly interfacing with Aptos.

Requirements

We use 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.5.0.tar.gz (18.2 kB view details)

Uploaded Source

Built Distribution

aptos_sdk-0.5.0-py3-none-any.whl (19.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aptos_sdk-0.5.0.tar.gz
  • Upload date:
  • Size: 18.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for aptos_sdk-0.5.0.tar.gz
Algorithm Hash digest
SHA256 404112057cd050f2fa0f260bda4cf79d4dfdbcd0f3745c25c0eee7725b93bfa0
MD5 685b4ad016c972ea2200dc21e4378ab1
BLAKE2b-256 23ed9f5fb58f6b3632f127648b2292ef0911fec7d214fc100b66dcde92288733

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aptos_sdk-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 19.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for aptos_sdk-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c4908a0501d1c8fdffb35e682021fa1a94a7565ee2c498ac8b4913c4dcb5a775
MD5 a86babde4cdb4abf5f64a4efb7c17d42
BLAKE2b-256 841229262d3143336db708d003e27eabfa793f67870e62bb34e5f096d72f8a57

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