Installation
pip install ubersmith
Example Use
First you’ll need to initialize the ubersmith package with your login credentials:
import ubersmith
ubersmith.init('http://ubersmith/api/2.0/', 'username', 'password')
Then you can make API calls:
from ubersmith import uber, client uber.method_list() client.get(email='g.freeman@combineresearch.com')
These modules match the methods as documented in the Ubersmith API 2.0 docs.
Without Module State
ubersmith.init creates and stores a request handler with your login credentials. If for some reason you’d prefer to not have this module state then you can instantiate the request handler manually:
from ubersmith.api import RequestHandler
h = RequestHandler('http://ubersmith/api/2.0/', 'username', 'password')
and then explicitly pass it into any call function:
from ubersmith import uber, client uber.method_list.handler(h)() client.get.handler(h)(email='g.freeman@combineresearch.com')
or you can access the call function directly on the handler and the handler will be implicitly passed into the call function for you:
h.uber.method_list() h.client.get(email='g.freeman@combineresearch.com')
Raw Processing
Alternatively you can process the request directly on the handler:
h.process_request('uber.method_list')
h.process_request('client.get', data={'email': 'g.freeman@combineresearch.com'})
although this will bypass any validation logic and response cleaning provided by the call function and just return the BaseResponse from ubersmith.
Development
You’ll need to install the development dependencies:
pip install -r requirements-dev.txt
Running Tests
To run the tests:
py.test
To run the tests on multiple interpreters:
tox
To run the tests and generate a coverage report:
bin/coverage.sh
Console
To run the dev console copy over the example config file:
cp bin/config.py.example bin/config.py
Edit it with your credentials then run the console:
python -i bin/console.py
From here you can run commands against your dev instance:
>>> uber.method_list()
Metadata
Release files for ubersmith 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ubersmith-0.4.0.tar.gz | 433.2 kB | Without provenance | Details for ubersmith-0.4.0.tar.gz |
Release files / ubersmith-0.4.0.tar.gz
| Download URL | ubersmith-0.4.0.tar.gz |
|---|---|
| Size | 433.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3a80a4bbeec1d2ec5068e27aef843de250fba0ab0656b32532fe1cbe6011a5ab
|
|
BLAKE2b-256 checksum How to use checksums |
44c8b85a1fc3dfd5a6bb96391e9e5d4cc7ef58c1074567bae4fed2ff3ff4950f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for ubersmith 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.