| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Outscale Python SDK (osc-sdk-python) is the official Python SDK to interact with the OUTSCALE API.
It allows you to:
You will need an Outscale account and API credentials. If you do not have one yet, please visit the Outscale website.
Install the pre-built Python package:
pip install osc-sdk-pythonClone the repository and build the package:
git clone https://github.com/outscale/osc-sdk-python.git
cd osc-sdk-python
make packageThen install the built wheel:
pip install dist/osc_sdk_python-0.42.0-py3-none-any.whlWhen 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.
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: 30By 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:
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
with Gateway(email="your@email.com", password="yourAccountPassword") as gw:
keys = gw.ReadAccessKeys()The following options can be provided when initializing the Gateway to customize the retry behavior of the SDK:
These options follow the same behavior as their counterparts in urllib3.util.Retry, but are implemented by the SDK retry logic.
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,
)You can also configure rate limiting when initializing the Gateway:
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:
Some example topics covered in docs/examples.md:
Common issues (such as UTF-8 / locale errors when reading the API spec) and their workarounds are documented in:
Outscale Python SDK is released under the BSD-3-Clause.
© 2025 OUTSCALE SAS
See LICENSE for full details.
We welcome contributions!
Please read our Contributing Guidelines and Code of Conduct before submitting a pull request.
| Back | FazBrowse Home | New Git URL |