Outscale Gateway python SDK
Project description
Outscale Python SDK
🌐 Links
- Documentation: https://docs.outscale.com/api.html?python#3ds-outscale-api
- Project repository: https://github.com/outscale/osc-sdk-python
- Outscale website: https://outscale.com/
- Join our community on Discord
📄 Table of Contents
- Overview
- Requirements
- Installation
- Configuration
- Usage
- Examples
- Known Issues & Troubleshooting
- License
- Contributing
🧭 Overview
Outscale Python SDK (osc-sdk-python) is the official Python SDK to interact with the OUTSCALE API.
It allows you to:
- Configure multiple profiles through environment variables or credential files.
- Customize retry and rate-limit behavior.
- Enable detailed logging of requests and responses.
You will need an Outscale account and API credentials. If you do not have one yet, please visit the Outscale website.
✅ Requirements
- Python 3.x
pip(Python package manager)- Access to the OUTSCALE API (valid access key / secret key or basic auth)
- Network access to the Outscale API endpoints
⚙ Installation
Option 1: Install from PyPI
Install the pre-built Python package:
pip install osc-sdk-python
Option 2: Install from source
Clone the repository and build the package:
git clone https://github.com/outscale/osc-sdk-python.git
cd osc-sdk-python
make package
Then install the built wheel:
pip install dist/osc_sdk_python-0.38.1-py3-none-any.whl
🛠 Configuration
When you use the SDK, you can choose a profile. Profiles can be defined via environment variables or in a credentials file. Environment variables take precedence over files.
In the credentials file, you can set a default profile named default. It will be used if you do not explicitly specify a profile.
Environment variables
The SDK understands the following environment variables:
export OSC_PROFILE=<PROFILE> # default: "default"
# or explicit credentials:
export OSC_ACCESS_KEY=<ACCESS_KEY>
export OSC_SECRET_KEY=<SECRET_KEY>
# optional:
export OSC_REGION=<REGION> # default: eu-west-2
export OSC_MAX_RETRIES=<INT> # default: 3
export OSC_RETRY_BACKOFF_FACTOR=<FLOAT> # default: 1.0
export OSC_RETRY_BACKOFF_JITTER=<FLOAT> # default: 3.0
export OSC_RETRY_BACKOFF_MAX=<FLOAT> # default: 30
Credentials files
By default, the SDK looks for a JSON configuration file at ~/.osc/config.json.
Example:
{
"default": {
"access_key": "<ACCESS_KEY>",
"secret_key": "<SECRET_KEY>",
"region": "<REGION>"
},
"profile_1": {
"access_key": "<ACCESS_KEY>",
"secret_key": "<SECRET_KEY>",
"region": "<REGION>"
},
"profile_2": {
"access_key": "<ACCESS_KEY>",
"secret_key": "<SECRET_KEY>",
"region": "<REGION>"
}
}
Notes:
- If
~/.osc/config.jsonis not found,~/.oapi_credentialswill be used as a fallback. - Environment variables have priority over credentials files.
Basic Authentication
You can also use osc-sdk-python with basic authentication using your account email and password.
Note that some API calls may be blocked with this method. See the authentication documentation for more details.
Example:
from osc_sdk_python import Gateway
gw = Gateway(email="your@email.com", password="yourAccountPassword")
keys = gw.ReadAccessKeys()
Retry Options
The following options can be provided when initializing the Gateway to customize the retry behavior of the SDK:
max_retries(integer, default3)retry_backoff_factor(float, default1.0)retry_backoff_jitter(float, default3.0)retry_backoff_max(float, default30)
These correspond to their counterparts in urllib3.util.Retry.
Example:
from osc_sdk_python import Gateway
gw = Gateway(
max_retries=5,
retry_backoff_factor=0.5,
retry_backoff_jitter=1.0,
retry_backoff_max=120,
)
Rate Limit Options
You can also configure rate limiting when initializing the Gateway:
limiter_max_requests(integer, default5)limiter_window(integer, default1)
Example:
from osc_sdk_python import Gateway
gw = Gateway(
limiter_max_requests=20,
limiter_window=5,
)
More usage patterns and logging examples are documented in:
🧪 Examples
Some example topics covered in docs/examples.md:
- Listing VMs and volumes
- Using profiles and regions
- Raw calls with
gw.raw("ActionName", **params) - Enabling and reading logs
🧩 Known Issues & Troubleshooting
Common issues (such as UTF-8 / locale errors when reading the API spec) and their workarounds are documented in:
📜 License
Outscale Python SDK is released under the BSD-3-Clause.
© 2025 OUTSCALE SAS
See LICENSE for full details.
🤝 Contributing
We welcome contributions!
Please read our Contributing Guidelines and Code of Conduct before submitting a pull request.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file osc_sdk_python-0.38.1.tar.gz.
File metadata
- Download URL: osc_sdk_python-0.38.1.tar.gz
- Upload date:
- Size: 118.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19d16495b536f9cdf96976acb7d30a63946505b1f7331a5a4db9c86733240e4c
|
|
| MD5 |
14b4007abe74735cc352270adae1e39f
|
|
| BLAKE2b-256 |
29ff5d14a1712e217ff0608d3ff1985844852847181eca00a1405901ba90d342
|
Provenance
The following attestation bundles were made for osc_sdk_python-0.38.1.tar.gz:
Publisher:
publish.yml on outscale/osc-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
osc_sdk_python-0.38.1.tar.gz -
Subject digest:
19d16495b536f9cdf96976acb7d30a63946505b1f7331a5a4db9c86733240e4c - Sigstore transparency entry: 705101822
- Sigstore integration time:
-
Permalink:
outscale/osc-sdk-python@5cd45f38d890be26570bce845d8bc16801df3548 -
Branch / Tag:
refs/tags/v0.38.1 - Owner: https://github.com/outscale
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5cd45f38d890be26570bce845d8bc16801df3548 -
Trigger Event:
release
-
Statement type:
File details
Details for the file osc_sdk_python-0.38.1-py3-none-any.whl.
File metadata
- Download URL: osc_sdk_python-0.38.1-py3-none-any.whl
- Upload date:
- Size: 117.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
808966dd7c44a85d442f1bf3a1d227fcc648c99bd04ff4db94cfecdbb5e3aaa1
|
|
| MD5 |
00c5906eb2f21b3e1fb9be8912ce22b1
|
|
| BLAKE2b-256 |
2c93dddd0323333f65168f8ccc4e146c505c34b6967ce596a5c9a34cfac67252
|
Provenance
The following attestation bundles were made for osc_sdk_python-0.38.1-py3-none-any.whl:
Publisher:
publish.yml on outscale/osc-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
osc_sdk_python-0.38.1-py3-none-any.whl -
Subject digest:
808966dd7c44a85d442f1bf3a1d227fcc648c99bd04ff4db94cfecdbb5e3aaa1 - Sigstore transparency entry: 705101838
- Sigstore integration time:
-
Permalink:
outscale/osc-sdk-python@5cd45f38d890be26570bce845d8bc16801df3548 -
Branch / Tag:
refs/tags/v0.38.1 - Owner: https://github.com/outscale
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5cd45f38d890be26570bce845d8bc16801df3548 -
Trigger Event:
release
-
Statement type: