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 update

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

Uploaded Source

Built Distribution

aptos_sdk-0.4.1-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aptos_sdk-0.4.1.tar.gz
  • Upload date:
  • Size: 17.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for aptos_sdk-0.4.1.tar.gz
Algorithm Hash digest
SHA256 62d7fc0ca3d00c551ae3b90c63a2d51b7b7d166a7aa7cbbda8edb3dd772d80a4
MD5 c3cebd193786dc7cf7100206f6bc567a
BLAKE2b-256 62084bff8360859a62234febf2d3dafbc079c0f0866b8ec384722f796475ee04

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aptos_sdk-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 18.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for aptos_sdk-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6c7fe4d1bc5992f08c7d2f08bcbf14ecb0455a97dbd314e56d982a302d8a7a89
MD5 2f55ff35befb44991b6817ef5268e051
BLAKE2b-256 482782cfaeb9c7f9f1bf685ec170fe7a4e7560609feb6c13b751996847fa8c65

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