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('api_key', 'url')
mi.update_id_token('idtoken')
2. List uploaded archives
from ScribeMi import MI
mi = MI('api_key', 'url')
archives = mi.list_archives()
3. Upload archive with file path
from ScribeMi import MI
mi = MI('api_key', 'url')
archive_name = mi.upload_archive('file_name')
4. Upload archive with file in memory
from ScribeMi import MI
mi = MI('api_key', 'url')
with open('file_name', 'rb') as f:
archive_name = mi.upload_archive(f)
5. Delete archive by file_name
from ScribeMi import MI
mi = MI('api_key', 'url')
deleted = mi.delete_archive('file_name')
6. Get job by jobid
from ScribeMi import MI
mi = MI('api_key', 'url')
job = mi.get_job('jobid')
7. Upload job with file path (file_name is optional)
from ScribeMi import MI
mi = MI('api_key', 'url')
job_created = mi.create_job('company_name', 'file_path', 'filetype', 'file_name')
8. Upload job with file in memory (file_name is optional)
from ScribeMi import MI
mi = MI('api_key', 'url')
with open('file_path', 'rb') as f:
job_created = mi.create_job('company_name', f, 'filetype', 'file_name')
9. Delete job by jobid
from ScribeMi import MI
mi = MI('api_key', 'url')
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
Built Distribution
File details
Details for the file scribemi-1.1.1-py3-none-any.whl
.
File metadata
- Download URL: scribemi-1.1.1-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eac48e4eda0af60d8e8211dcdac7354153d01c5aaa22f911f5f9cb5e143ad500 |
|
MD5 | 224bc5fd4e82f954a5b3655fd042bc02 |
|
BLAKE2b-256 | 98e36f78c9a83b3696970e72fccc5c6e58d261a82ecc78a60cc1358b2338fa33 |