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...
Installation
# PyPi Installation
pip install ubersmith-api
# GitHub Installation
pip install git+'https://github.com/bnassif/ubersmith-api.git'
Overview
The ubersmith-api package ships two separate layers of usage, which offer varying levels of compatibility.
Both levels use the robust UbersmithConfig Pydantic Settings object, which exposes all settings for how to interact with the API.
Universal Client
The universal client, UbersmithClient provides a generic object for interacting with any Ubersmith version using the version 2.0 API. This object ships with just three methods bound to it:
UbersmithClient.request(): Method for making API callsUbersmithClient.system_info(): Callsuser.system_infoUbersmithClient.method_list(): Callsuser.method_listUbersmithClient.method_get(): Callsuser.method_get
Example Usage
from ubersmith import *
config = UbersmithConfig(
host='target-hostname-or-address',
username='username-to-use',
password='api-token-for-user',
)
api_client = UbersmithClient(config)
client_info = api_client.request(
'client.get',
data={
'client_id': 1234,
'metadata': True,
},
#raw=True, # Optionally return the unparsed `requests.Response` object
)
Version Specific Clients
Built atop the universal client, version-specific clients are also shipped with ubersmith-api to provide more robust API interactions.
Version-specific clients extend the UbersmithClient object by binding API sections to it, with each section having functions that correspond to API methods.
Example Usage
from ubersmith.versions import *
config = UbersmithConfig(
host='target-hostname-or-address',
username='username-to-use',
password='api-token-for-user',
)
api_client = get_client(version='5.1.3-rc2', config=config)
client_info = api_client.client.get(
client_id=1234,
metadata=True,
)
[!TIP] Version specific clients are built using JSON schema files generated with API calls against an Ubersmith instance running the target version.
If your version is not supported, you are encouraged to generate a schema and submit its schema in a PR.
See the schema docs for details on how to get started with generating and using schemas.
[!IMPORTANT] Some API methods shipped by Ubersmith have unsafe parameter names.
In these cases, the parameters and sometimes methods are omitted from generation to prevent unwanted errors.
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.1.0.tar.gz.
File metadata
- Download URL: ubersmith_api-1.1.0.tar.gz
- Upload date:
- Size: 188.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8bd2fdd0a79c94485992cdf3d537aaacd34d68d1d870f8818e1362d42c908f00
|
|
| MD5 |
0afdbce2656753f0191a3a9e97a4c39e
|
|
| BLAKE2b-256 |
1b432a31b83b950e3021dd8e9bdc2751a24106e602541b2596036f78dfdff06a
|
Provenance
The following attestation bundles were made for ubersmith_api-1.1.0.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.1.0.tar.gz -
Subject digest:
8bd2fdd0a79c94485992cdf3d537aaacd34d68d1d870f8818e1362d42c908f00 - Sigstore transparency entry: 1228831232
- Sigstore integration time:
-
Permalink:
bnassif/ubersmith-api@053a5a87b418a96a9861960bc87d4e68862c6d54 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/bnassif
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@053a5a87b418a96a9861960bc87d4e68862c6d54 -
Trigger Event:
release
-
Statement type:
File details
Details for the file ubersmith_api-1.1.0-py3-none-any.whl.
File metadata
- Download URL: ubersmith_api-1.1.0-py3-none-any.whl
- Upload date:
- Size: 201.7 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 |
c9cfac99377d9841b4fd0940fe40a3034ea210f58bd26c79b219038cc5fe3ed0
|
|
| MD5 |
e2e056b76bc4b485965cbd885451c10a
|
|
| BLAKE2b-256 |
f3c9f9aea5ad541a542cebb4176cf0a04f17e401c6e2633a3dd87984251b13b9
|
Provenance
The following attestation bundles were made for ubersmith_api-1.1.0-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.1.0-py3-none-any.whl -
Subject digest:
c9cfac99377d9841b4fd0940fe40a3034ea210f58bd26c79b219038cc5fe3ed0 - Sigstore transparency entry: 1228831255
- Sigstore integration time:
-
Permalink:
bnassif/ubersmith-api@053a5a87b418a96a9861960bc87d4e68862c6d54 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/bnassif
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@053a5a87b418a96a9861960bc87d4e68862c6d54 -
Trigger Event:
release
-
Statement type: