Version-specific Python 3 wrapper for the Ubersmith API
Project description
Python Ubersmith
A fully-featured API wrapper for the Ubersmith API
Python wrappers exist on PyPI and across GitHub for interacting with the Ubersmith API, but each of them fails to provide full compatibility.
In comes ubersmith-api...
Overview
At its core, this package provides a generic API wrapper class, UbersmithClient which allows for uncontrolled calls to an Ubersmith instance.
Built atop this wrapper, a templating suite is available for generating classes for each API section in Ubersmith, specific to each Ubersmith version to maximize compatibility.
Installation
# PyPi Installation
pip install ubersmith-api
# GitHub Installation
pip install git+'https://github.com/bnassif/ubersmith-api.git'
Getting Started
Instantiating the Base Client
from ubersmith import *
config = UbersmithConfig(
host='target-hostname-or-address',
username='username-to-use',
password='api-token-for-user',
)
client = UbersmithClient(config)
Making Calls
response_obj = client.request(
'uber.method_get',
data={
'method_name': 'client.get',
},
#raw=True,
)
By default, the request() method will parse the response from the API, checking for HTTP error codes, as well as error messages from Ubersmith itself. If no errors are found, the returned data field is returned.
Alternatively, you can parse raw=True to return the requests.Response object for manual parsing and error checking.
Shipped Methods
The UbersmithClient class comes with three (3) core methods shipped.
These offer a simplified entrypoint to gathering parsed information of an Ubersmith system.
# Get system information: calls `uber.system_info`
sys_info = client.system_info()
# Get all available methods: calls `uber.method_list`
all_methods = client.method_list()
# Get details of one method: calls `uber.method_get`
method_details = client.method_get('client.get')
Future Compatibility
NOTE:
Additional code is shipped in this repository, along with version-specific schemas for the Ubersmith API.
These features will be enabled in later releases of the package.
License
MIT - Feel free to use, extend, and contribute.
Project details
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 ubersmith_api-1.0.2.tar.gz.
File metadata
- Download URL: ubersmith_api-1.0.2.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1714beccf20ccfce01d78fbbb59ceb1ae453e755db581f0d018f3e682be63cf6
|
|
| MD5 |
33ecb6398ba73cad76fb7b34911c46d3
|
|
| BLAKE2b-256 |
42b619a4c8b2b5491718ee611d9a7421143b3daf624b66537b32d357805cb107
|
Provenance
The following attestation bundles were made for ubersmith_api-1.0.2.tar.gz:
Publisher:
release.yml on bnassif/ubersmith-api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ubersmith_api-1.0.2.tar.gz -
Subject digest:
1714beccf20ccfce01d78fbbb59ceb1ae453e755db581f0d018f3e682be63cf6 - Sigstore transparency entry: 705531679
- Sigstore integration time:
-
Permalink:
bnassif/ubersmith-api@3f4b70718361a241be7a87d5bb4d69eeb159fd7b -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/bnassif
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3f4b70718361a241be7a87d5bb4d69eeb159fd7b -
Trigger Event:
release
-
Statement type:
File details
Details for the file ubersmith_api-1.0.2-py3-none-any.whl.
File metadata
- Download URL: ubersmith_api-1.0.2-py3-none-any.whl
- Upload date:
- Size: 11.1 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 |
b3f62f938e9bde0f7fd8900faf1368591c47406102a7255488b47a4e3344268d
|
|
| MD5 |
6e4525c7fb10944fbe9166101477c891
|
|
| BLAKE2b-256 |
3ad60af1bb28e9e5419088d2e6f03b133dc289536fd6cf0d2aae91b177707c03
|
Provenance
The following attestation bundles were made for ubersmith_api-1.0.2-py3-none-any.whl:
Publisher:
release.yml on bnassif/ubersmith-api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ubersmith_api-1.0.2-py3-none-any.whl -
Subject digest:
b3f62f938e9bde0f7fd8900faf1368591c47406102a7255488b47a4e3344268d - Sigstore transparency entry: 705531682
- Sigstore integration time:
-
Permalink:
bnassif/ubersmith-api@3f4b70718361a241be7a87d5bb4d69eeb159fd7b -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/bnassif
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3f4b70718361a241be7a87d5bb4d69eeb159fd7b -
Trigger Event:
release
-
Statement type: