Xpanse Python SDK
Overview
This library is intended to be an interface to the Xpanse Expander API.
Install
pip install xpanse
Requirements
Python 3.6+
Usage
# Import client
from xpanse.client import ExClient
# initialize client
client = ExClient()
# get ip_range iterator object and dump to a list
ranges = client.assets.ip_range.list().dump()
You can view more example code in the examples directory.
Configuration
A valid Bearer token or JWT is required for use. Bearer tokens are suggested as JWTs have a limited lifespan.
RECOMMENDED
You can supply them as environment variables using the variable names XPANSE_BEARER_TOKEN and/or XPANSE_JWT_TOKEN.
export XPANSE_BEARER_TOKEN=<Bearer Token>
# or
export XPANSE_JWT_TOKEN=<JWT>
NOT RECOMMENDED
You can also provided these keys directly at client initialization by doing
client = ExClient(jwt=<JWT>)
# or
client = ExClient(bearer_token=<BearerToken>)
Logging
Logging is handled through the python logging package. To enable different levels of verbosity in your scripts you can do the following:
import logging
logging.basicConfig(level=logging.DEBUG)
You can read more at https://docs.python.org/3/library/logging.html.
Release files for xpanse 1.0.9.post16
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| xpanse-1.0.9.post16.tar.gz | 87.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| xpanse-1.0.9.post16-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 208.4 kB
Release files / xpanse-1.0.9.post16.tar.gz
| Download URL | xpanse-1.0.9.post16.tar.gz |
|---|---|
| Size | 87.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
abb851002e72c5497c1b756091824a231a0feaaac58f59ccc74207246a041bf1
|
|
BLAKE2b-256 checksum How to use checksums |
fbcbebf22a0c56c31b6b55d9c8dd9911a2f025b4fb805e0bde5d80c66397f158
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
|
Release files / xpanse-1.0.9.post16-py3-none-any.whl
| Download URL | xpanse-1.0.9.post16-py3-none-any.whl |
|---|---|
| Size | 120.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b72922afe3836470e218565f363c44075d57c8568d0843222488ab45ccfb287a
|
|
BLAKE2b-256 checksum How to use checksums |
d4bb79996e38fa99adc9cdfccad83150a0fdf538bef1a967ea67fcdaefa9a0a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
|