Easily make requests of the MicroStrategy REST API
Project description
mstr-rest-requests
A extension to the excellent requests
Session
object, to enable more straightforward interaction with MicroStrategy's REST API.
Usage
Installation
Simply install the package however you normally install them, for example:
pip install mstr-rest-requests
Examples
Authentication
Here's how to get an authenticated session (currently only standard and anonymous authentication are supported):
from mstr.requests import MSTRRESTSession
session = MSTRRESTSession(base_url='https://demo.microstrategy.com/MicroStrategyLibrary/api/')
session.login(username='dave', password='hellodave')
session.has_session()
# returns True
Session handling
Several convenience methods are implemented to make dealing with Session objects easier.
def has_session(self)
Will return a boolean as to whether the session contains an authentication tokem.
def destroy_auth_token(self)
Removes the auth token from the session
def json(self)
Returns a JSON representation of the session that can be reconstituted with:
update_from_json(self, data)
where data
is either a dict or a string containing JSON data.
HTTP requests
The MSTRRESTSession adds two parameters to all request methods:
include_auth=True, project_id=None
so you can specify a project_id
on any request by adding the parameter.
Convenience methods for API calls
TODO
Project details
Release history Release notifications | RSS feed
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
Hashes for mstr-rest-requests-0.12.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac25733fc575fca12e7a6f270823e606cc8609430059ab2b55f69f0c219024ee |
|
MD5 | 793fbdfddd5a15879327408e3d42c10b |
|
BLAKE2b-256 | 462eadfe417b44b9650480ef6df3bfe344bfa02eaf5cbcf706867782e1bbed14 |
Hashes for mstr_rest_requests-0.12.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d821921fd23b8368dec76f13d0032f44422d2067ab9884629938b764908ac8d |
|
MD5 | e15d0a18cbe842b116bcbd5f22098eab |
|
BLAKE2b-256 | c3ed30fd5d717477f7c881b7c7efc5d63378733dce7b655eeb1c3d9a5a176e4a |