# Aptos Python SDK
[![Discord][discord-image]][discord-url]
[![PyPI Package Version][pypi-image-version]][pypi-url]
[![PyPI Package Downloads][pypi-image-downloads]][pypi-url]
This provides basic functionalities to interact with [Aptos](https:/github.com/aptos-labs/aptos-core/). Get started [here](https://aptos.dev/guides/system-integrators-guide/#getting-started).
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](https://python-poetry.org/docs/#installation) for packaging and dependency management:
```
curl -sSL https://install.python-poetry.org | python3 -
poetry install
```
## Unit testing
```bash
make test
```
## E2E testing and Using the Aptos CLI
* Download the [Aptos CLI](https://aptos.dev/tools/aptos-cli/install-cli/).
* Set the environment variable `APTOS_CLI_PATH` to the full path of the CLI.
* `make examples_cli`
We of course allow you to do this a bit more manually by:
First, run a local testnet (run this from the root of aptos-core):
```bash
cargo run -p aptos -- node run-local-testnet --force-restart --assume-yes
```
Next, tell the end-to-end tests to talk to this locally running testnet:
```bash
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:
```bash
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
```bash
make fmt
```
## Package Publishing
* Download the [Aptos CLI](https://aptos.dev/tools/aptos-cli/install-cli/).
* Set the environment variable `APTOS_CLI_PATH` to the full path of the CLI.
* `poetry run python -m aptos_sdk.cli` and set the appropriate command-line parameters
## 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:
```bash
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](https://semver.org/) as closely as possible
[repo]: https://github.com/aptos-labs/aptos-core
[pypi-image-version]: https://img.shields.io/pypi/v/aptos-sdk.svg
[pypi-image-downloads]: https://img.shields.io/pypi/dm/aptos-sdk.svg
[pypi-url]: https://pypi.org/project/aptos-sdk
[discord-image]: https://img.shields.io/discord/945856774056083548?label=Discord&logo=discord&style=flat~~~~
[discord-url]: https://discord.gg/aptosnetwork
Raw data
{
"_id": null,
"home_page": "https://github.com/aptos-labs/aptos-core/tree/main/ecosystem/python/sdk",
"name": "aptos-sdk-fork",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8.1,<4.0",
"maintainer_email": "",
"keywords": "web3,sdk,aptos,blockchain",
"author": "Aptos Labs",
"author_email": "opensource@aptoslabs.com",
"download_url": "https://files.pythonhosted.org/packages/75/32/be8719fbda687b805a8b4fea320b058f567bf09747f99b6dacd643bc8bc8/aptos_sdk_fork-0.7.1a2.tar.gz",
"platform": null,
"description": "# Aptos Python SDK\n[![Discord][discord-image]][discord-url]\n[![PyPI Package Version][pypi-image-version]][pypi-url]\n[![PyPI Package Downloads][pypi-image-downloads]][pypi-url]\n\nThis provides basic functionalities to interact with [Aptos](https:/github.com/aptos-labs/aptos-core/). Get started [here](https://aptos.dev/guides/system-integrators-guide/#getting-started).\n\nCurrently this is still in development and may not be suitable for production purposes.\n\nNote: The sync client is deprecated, please only start new projects using the async client. Feature contributions to the sync client will be rejected.\n\n## Requirements\nThis SDK uses [Poetry](https://python-poetry.org/docs/#installation) for packaging and dependency management:\n\n```\ncurl -sSL https://install.python-poetry.org | python3 -\npoetry install\n```\n\n## Unit testing\n```bash\nmake test\n```\n\n## E2E testing and Using the Aptos CLI\n\n* Download the [Aptos CLI](https://aptos.dev/tools/aptos-cli/install-cli/).\n* Set the environment variable `APTOS_CLI_PATH` to the full path of the CLI.\n* `make examples_cli`\n\nWe of course allow you to do this a bit more manually by:\n\nFirst, run a local testnet (run this from the root of aptos-core):\n\n```bash\ncargo run -p aptos -- node run-local-testnet --force-restart --assume-yes\n```\n\nNext, tell the end-to-end tests to talk to this locally running testnet:\n\n```bash\nexport APTOS_NODE_URL=\"http://127.0.0.1:8080/v1\"\nexport APTOS_FAUCET_URL=\"http://127.0.0.1:8081\"\n```\n\nFinally run the tests:\n\n```bash\nmake examples\n```\n\nNote: 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.\n\n## Autoformatting\n```bash\nmake fmt\n```\n\n## Package Publishing\n\n* Download the [Aptos CLI](https://aptos.dev/tools/aptos-cli/install-cli/).\n* Set the environment variable `APTOS_CLI_PATH` to the full path of the CLI.\n* `poetry run python -m aptos_sdk.cli` and set the appropriate command-line parameters\n\n## Generating types\nThe Python `openapi-python-client` tool cannot parse references. Therefore there are three options:\n\n- Use swagger-cli to dereference, gain a type explosion, and still have missing types\n- Live without missing types\n- Write a pure python implementation with no autogenerated code\n\nCurrently the team is moving forward with pure python, but leaves the following notes for the curious:\n\n```bash\nnpm install -g @apidevtools/swagger-cli\nswagger-cli bundle --dereference ../../../api/doc/v0/openapi.yaml -t yaml > openapi.yaml\npython3 -m openapi_python_client generate --path openapi.yaml\nmv aptos-dev-api-specification-client/aptos_dev_api_specification_client/ aptos_sdk/openapi\n```\n\n## Semantic versioning\nThis project follows [semver](https://semver.org/) as closely as possible\n\n[repo]: https://github.com/aptos-labs/aptos-core\n[pypi-image-version]: https://img.shields.io/pypi/v/aptos-sdk.svg\n[pypi-image-downloads]: https://img.shields.io/pypi/dm/aptos-sdk.svg\n[pypi-url]: https://pypi.org/project/aptos-sdk\n[discord-image]: https://img.shields.io/discord/945856774056083548?label=Discord&logo=discord&style=flat~~~~\n[discord-url]: https://discord.gg/aptosnetwork\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "Aptos SDK",
"version": "0.7.1a2",
"project_urls": {
"Homepage": "https://github.com/aptos-labs/aptos-core/tree/main/ecosystem/python/sdk",
"Repository": "https://github.com/aptos-labs/aptos-core"
},
"split_keywords": [
"web3",
"sdk",
"aptos",
"blockchain"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "efa85b0ede1685e953c6d558b433eb37575dcf08d33a17e1ccf22dbb7725e4dc",
"md5": "6b7ddf782150318d3602fd3ae370d107",
"sha256": "d0e7a79d8ba77fc53543aa0aa88a860ced52a0ee8511a8f821486bf4b2b9dbb7"
},
"downloads": -1,
"filename": "aptos_sdk_fork-0.7.1a2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6b7ddf782150318d3602fd3ae370d107",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8.1,<4.0",
"size": 52276,
"upload_time": "2023-11-13T06:35:43",
"upload_time_iso_8601": "2023-11-13T06:35:43.349860Z",
"url": "https://files.pythonhosted.org/packages/ef/a8/5b0ede1685e953c6d558b433eb37575dcf08d33a17e1ccf22dbb7725e4dc/aptos_sdk_fork-0.7.1a2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7532be8719fbda687b805a8b4fea320b058f567bf09747f99b6dacd643bc8bc8",
"md5": "d3eee656aee01fee12d0830fbc8f0a9d",
"sha256": "6f7cc3ebe8695d036b0a6502e4d09c3585c78c3cd8fddee0b7e4e70901c60986"
},
"downloads": -1,
"filename": "aptos_sdk_fork-0.7.1a2.tar.gz",
"has_sig": false,
"md5_digest": "d3eee656aee01fee12d0830fbc8f0a9d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8.1,<4.0",
"size": 43841,
"upload_time": "2023-11-13T06:35:45",
"upload_time_iso_8601": "2023-11-13T06:35:45.319967Z",
"url": "https://files.pythonhosted.org/packages/75/32/be8719fbda687b805a8b4fea320b058f567bf09747f99b6dacd643bc8bc8/aptos_sdk_fork-0.7.1a2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-11-13 06:35:45",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "aptos-labs",
"github_project": "aptos-core",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "aptos-sdk-fork"
}