Skip to main content

Python Client library for OpenTMI

CI Pipeline Coverage Status PyPI version

This is the Python client library for OpenTMI.

installation

To install, simply use pip:

$ pip install --upgrade opentmi-client

See the Developers Guide if you want to develop this library.

Command Line Interface

Library provides Command line Interface to communicate with OpenTMI -backend

$ opentmi --help
usage: opentmi [-h] [-v] [-s] [--host HOST] [--user USER]
               [--password PASSWORD] [--token TOKEN]
               [--token_service TOKEN_SERVICE] [-p PORT]
               <subcommand> ...

optional arguments:
  -h, --help            show this help message and exit
  -v                    verbose level... repeat up to three times.
  -s, --silent          Silent - only errors will be printed
  --host HOST           OpenTMI host, default: localhost
  --user USER           username
  --password PASSWORD   password
  --token TOKEN         Authentication token
  --token_service TOKEN_SERVICE
                        Optional authentication service
  -p PORT, --port PORT  OpenTMI port

subcommand:
  <subcommand>          sub-command help
    version             Display version information
    list                List something
    store               Create something

example:

opentmi --host localhost --port 3000 --list --testcases 1

Python API

from opentmi_client import OpenTmiClient, Result, Event
client = Client("https://127.0.0.1")
client.login_with_access_token("my-github-access-token")

# post result
result = Result()
result.tcid = "test-case-a"
result.verdict = "pass"
client.post_result(result)

# post event
event = Event()
event.msgid = "ALLOCATED"
event.priority.level = "info",
event.ref.resource = "5697740f956cd2fd35c69062"
client.post_event(event)

See more examples from here.

Server side Result schema can be found from here. and Test case schema is available here.

notes

  • tcid -field have to be unique for each test cases.
  • There is couple mandatory fields by default: tcid and exec.verdict. Allowed values for result verdict is: pass, fail, inconclusive, blocked and error. upload_results() -function also create test case document if it doesn't exists in database.

Authentication

There are multiple options to authenticate:

  • use Client.login(<username>, <password>)
  • use Client.login_with_access_token(<token>, [<service>])
    • service are optional and supported values depend on server support. By default github is in use.
  • Use environment variables (tries login automatically when constructor is called):
    • Using username and password: OPENTMI_USERNAME and OPENTMI_PASSWORD or
    • Using github access token: OPENTMI_GITHUB_ACCESS_TOKEN
  • use token in host like http://<token>@localhost

LICENSE

MIT

Metadata

Release files for opentmi-client 0.12.0

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

Source distribution (sdist)

Source distribution for opentmi-client 0.12.0
File Size Uploaded Provenance Actions
opentmi_client-0.12.0.tar.gz 33.4 kB Without provenance Details for opentmi_client-0.12.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for opentmi-client 0.12.0
File Interpreter ABI Platform Actions
opentmi_client-0.12.0-py3-none-any.whl Python 3 none any Details for opentmi_client-0.12.0-py3-none-any.whl

Total release size: 72.6 kB

Release files / opentmi_client-0.12.0.tar.gz

Download URL opentmi_client-0.12.0.tar.gz
Size 33.4 kB
Tags Source
SHA-256 checksum
How to use checksums
f126c58fcf2e96b36dd13f40d4f94623637dc13261ba86778b2a3d7b13484302
BLAKE2b-256 checksum
How to use checksums
7d23fc33d1103d67f46d2f8b702d25197331c298412fe331d9207c8a68a903e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.16

Release files / opentmi_client-0.12.0-py3-none-any.whl

Download URL opentmi_client-0.12.0-py3-none-any.whl
Size 39.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
017f4833b1bc6b1e919b40e8ea2471b2cb480537a8577590f44b0a6d754c3b99
BLAKE2b-256 checksum
How to use checksums
de27d67bfb5e3984f6c6d98236cf343ff4304d269a005564ca983d92512a51af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.16

Security for opentmi-client 0.12.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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