Skip to main content
https://img.shields.io/travis/jasonkeene/python-ubersmith.svg?style=flat https://img.shields.io/coveralls/jasonkeene/python-ubersmith.svg?style=flat https://img.shields.io/pypi/v/ubersmith.svg?style=flat

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()

Release files for ubersmith 0.3.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ubersmith 0.3.9
File Size Uploaded
ubersmith-0.3.9.tar.gz 433.8 kB Details

Release files / ubersmith-0.3.9.tar.gz

Download URL ubersmith-0.3.9.tar.gz
Size 433.8 kB
Tags Source
SHA-256 checksum
How to use checksums
114e9c19331d5ee9c62f996f42efc1a4bbb16dfb5200a91133292050ed52f86c
BLAKE2b-256 checksum
How to use checksums
07d173d453faf3fef8907e8f09c9967db85a2718a503362df9fab04982f4507f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

0.4.0

1 release file

0.3.11

1 release file

0.3.10

1 release file

This release

0.3.9 This release

1 release file

0.3.8

1 release file

0.3.7

1 release file

0.3.6

1 release file

0.3.5

1 release file

0.3.4

1 release file

0.3.3

1 release file

0.3.2

1 release file

0.3.1

1 release file

0.3.0

1 release file

0.2.8

1 release file

0.2.7

1 release file

0.2.6

1 release file

0.2.5

1 release file

0.2.4

1 release file

0.2.3

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.0.1

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page