Skip to main content

Version-specific Python 3 wrapper for the Ubersmith API

Project description

Python Ubersmith

Pypi MIT licensed GitHub Release Date

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

ubersmith_api-1.0.2.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ubersmith_api-1.0.2-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

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

Hashes for ubersmith_api-1.0.2.tar.gz
Algorithm Hash digest
SHA256 1714beccf20ccfce01d78fbbb59ceb1ae453e755db581f0d018f3e682be63cf6
MD5 33ecb6398ba73cad76fb7b34911c46d3
BLAKE2b-256 42b619a4c8b2b5491718ee611d9a7421143b3daf624b66537b32d357805cb107

See more details on using hashes here.

Provenance

The following attestation bundles were made for ubersmith_api-1.0.2.tar.gz:

Publisher: release.yml on bnassif/ubersmith-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for ubersmith_api-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b3f62f938e9bde0f7fd8900faf1368591c47406102a7255488b47a4e3344268d
MD5 6e4525c7fb10944fbe9166101477c891
BLAKE2b-256 3ad60af1bb28e9e5419088d2e6f03b133dc289536fd6cf0d2aae91b177707c03

See more details on using hashes here.

Provenance

The following attestation bundles were made for ubersmith_api-1.0.2-py3-none-any.whl:

Publisher: release.yml on bnassif/ubersmith-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page