Skip to main content

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.

Python package

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mstr_rest_requests-0.14.1.tar.gz (97.6 kB view details)

Uploaded Source

Built Distribution

mstr_rest_requests-0.14.1-py3-none-any.whl (105.4 kB view details)

Uploaded Python 3

File details

Details for the file mstr_rest_requests-0.14.1.tar.gz.

File metadata

  • Download URL: mstr_rest_requests-0.14.1.tar.gz
  • Upload date:
  • Size: 97.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.10.8 Linux/5.15.0-1022-azure

File hashes

Hashes for mstr_rest_requests-0.14.1.tar.gz
Algorithm Hash digest
SHA256 f06145abe4446251a7bb0f934f2c573145ad623481fa49ba9a841227b4c6cf44
MD5 c39365eebb4e4d3b8cdda3f2c9c611e3
BLAKE2b-256 068dc4615be25ad33c02c44df3c59ac66e9731dfa4127d59ccd0e03f41e10842

See more details on using hashes here.

File details

Details for the file mstr_rest_requests-0.14.1-py3-none-any.whl.

File metadata

File hashes

Hashes for mstr_rest_requests-0.14.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d0a1ecc0c35e60a1fe9d23a108c0bbbd57b759664409039d310ce51e812bafa1
MD5 c6415c9d1f6a75bc83afc0436c676641
BLAKE2b-256 25048249194342d0c2d4b0b292e0516559b85fcbbcb87e1b1be2f351f9268884

See more details on using hashes here.

Supported by

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