MPython module to talk to a Portainer.
Project description
aiotainer
Asynchronous library to communicate with the Portainer API
Quickstart
In order to use the library, you'll need to do some work yourself to get authentication credentials. This depends a lot on the context (e.g. redirecting to use OAuth via web) but should be easy to incorporate using Portainers's authentication examples. See Portainers's Authentication for details.
You will implement AbstractAuth
to provide an access token. Your implementation
will handle any necessary refreshes. You can invoke the service with your auth implementation
to access the API.
You need at least:
- Python 3.11+
- Poetry
For a first start you can run the example.py
, by doing the following steps
git clone https://github.com/Thomas55555/aiotainer.git
cd aiotainer
poetry install
- Enter your personal
client_id
andclient_secret
in the_secrets.yaml
and rename it tosecrets.yaml
- Run with
poetry run ./example.py
Contributing
This is an active open-source project. We are always open to people who want to use the code or contribute to it. This Python project is fully managed using the Poetry dependency manager.
As this repository uses the pre-commit framework, all changes are linted and tested with each commit. You can run all checks and tests manually, using the following command:
poetry run pre-commit run --all-files
To run just the Python tests:
poetry run pytest
To update snapshots:
poetry run pytest --snapshot-update
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for aiotainer-0.0.1b2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3392516a1ca4dcde85d476f86b2c1e7ca2553856a4286408c79197a2c05cd8f2 |
|
MD5 | 1459002bf50eb58115bac62c50afd665 |
|
BLAKE2b-256 | dc58b94ca79659b589aba1a36ec1b5a0edb9ed24fed3d9e55d074cd5922ac20b |