Skip to main content

Library to manage MI files in Scribe's platform

Project description

Scribe MI

Python library to manage MI files in Scribe's platform

This library allows the management of MI (Monitoring Information) in a simple way.

You first need a Scribe account, an id_token and an api_key. The account and the api_key can both be requested at contact[atsign]scribelabs[dotsign]ai, and the id_token can be generated by the user.

One way to generate the id_token is through ScribeAuth library. The function get_tokens will return a Dictionary with three different tokens and it is necessary to extract the correct one to make it work (id_token).

It is important to use the function update_id_token before calling any other method of this library to avoid exceptions. If the id_token has expired, it will be necessary to update it again.


This library requires a version of Python 3 that supports typings.

Installation

pip install ScribeMi

1. Update id token to gain access

from ScribeMi import MI
mi = MI('url', 'api_key')
mi.update_id_token('idtoken')

2. List uploaded archives

from ScribeMi import MI
mi = MI('url', 'api_key')
archives = mi.list_archives()

3. Upload archive with file path

from ScribeMi import MI
mi = MI('url', 'api_key')
archive_name = mi.upload_archive('filename')

4. Upload archive with file in memory

from ScribeMi import MI
mi = MI('url', 'api_key')
archive_name = mi.upload_archive(open('file', 'rb'))

5. Delete archive by filename

from ScribeMi import MI
mi = MI('url', 'api_key')
deleted = mi.delete_archive('filename')

6. Get job by jobid

from ScribeMi import MI
mi = MI('url', 'api_key')
job = mi.get_job('jobid')

7. Upload job with file path

from ScribeMi import MI
mi = MI('url', 'api_key')
job_created = mi.create_job('jobid')

8. Upload job with file in memory

from ScribeMi import MI
mi = MI('url', 'api_key')
job_created = mi.create_job(open('file', 'rb'))

9. Delete job by jobid

from ScribeMi import MI
mi = MI('url', 'api_key')
deleted = mi.delete_job('jobid')

To flag an issue, open a ticket on Github.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

scribemi-1.1.0-py3-none-any.whl (5.1 kB view hashes)

Uploaded Python 3

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