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_api 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.0.tar.gz (9.7 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.0-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file ubersmith_api-1.0.0.tar.gz.

File metadata

  • Download URL: ubersmith_api-1.0.0.tar.gz
  • Upload date:
  • Size: 9.7 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.0.tar.gz
Algorithm Hash digest
SHA256 a662e6dd95f5a644b809ac43c8f1308d8679ed4d180ecbd151f9c49242ed770b
MD5 b26886e59e22b62c96501945d7d3ef68
BLAKE2b-256 5272eec431537baa23c1234349d20e573e2ec6c446561815e1065768137513af

See more details on using hashes here.

Provenance

The following attestation bundles were made for ubersmith_api-1.0.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: ubersmith_api-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 11.0 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 af042cfc410d63f4b9e249919bf6a741741b6b435d6f91c3c3cd03b1132a8c8b
MD5 f796266cb4b95b3d6ec580b2c1e1c3d6
BLAKE2b-256 16a013f69df5b72a9fb6bbf8b4a558553dd95dd83b8c4681ace355673028bd43

See more details on using hashes here.

Provenance

The following attestation bundles were made for ubersmith_api-1.0.0-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