Python client for Kiwi TCMS JSON-RPC API
Project description
kiwi-tcms-api
Python client for working with Kiwi TCMS via JSON-RPC API.
Installation
pip install kiwi-tcms-api
Features
- Authenticated connection via session (CSRF + Cookie)
- 4 ways to initialize the client
- Configuration via environment variables
- Full coverage of official API: TestCase, TestRun, TestPlan, TestExecution, Product, Build, User and more
- Two calling styles: named methods and dot-notation (
rpc.Product.filter()) - Support for self-signed SSL certificates
Install Dependencies
pip install requests beautifulsoup4
Quick Start
from kiwi_tcms_api import KiwiTCMSApi
rpc = KiwiTCMSApi(url='https://tcms.example.com', username='admin', password='secret')
# Get list of products
products = rpc.Product_filter()
# Create a test run
run = rpc.TestRun_create({
'summary': 'Smoke Tests',
'plan': 1,
'build': 1,
'manager': 1,
})
Initialization Methods
# 1. From environment variables
rpc = KiwiTCMSApi()
# 2. Explicit parameters
rpc = KiwiTCMSApi(url='https://tcms.example.com', username='admin', password='secret')
# 3. Deferred connection
rpc = KiwiTCMSApi.configure(url='https://tcms.example.com', username='admin', password='secret')
rpc.connect()
# 4. From configuration dictionary
cfg = {'url': 'https://tcms.example.com', 'username': 'admin', 'password': 'secret'}
rpc = KiwiTCMSApi.from_config(cfg)
Environment Variables
| Variable | Default | Description |
|---|---|---|
KIWI_TCMS_API_URL |
http://localhost:8000 |
Kiwi TCMS server URL |
KIWI_TCMS_API_USERNAME |
— | Username |
KIWI_TCMS_API_PASSWORD |
— | Password |
KIWI_TCMS_API_VERIFY_SSL |
true |
SSL certificate verification (false for self-signed) |
Method Call Styles
# Named method
rpc.TestCase_filter({'product': 1})
# Dot-notation (module.method)
rpc.TestCase.filter({'product': 1})
# Direct exec call
rpc.exec('TestCase.filter', [{'product': 1}])
API Coverage
| Module | Methods |
|---|---|
Auth |
login, logout |
TestCase |
create, filter, update, remove, add/remove tag/component/attachment/comment/property and more |
TestPlan |
create, filter, update, add/remove case/tag/attachment, tree |
TestRun |
create, filter, update, add/remove case/tag/cc/attachment/property |
TestExecution |
create, filter, update, add/remove comment/link/attachment/property |
TestCaseStatus |
create, filter |
TestExecutionStatus |
create, filter |
Product |
create, filter |
Build |
create, filter, update |
Version |
create, filter |
Component |
create, filter, update |
Category |
create, filter |
Environment |
create, filter, add/remove property |
User |
filter, update, deactivate, join_group, add_attachment |
Group |
filter, permissions, users |
Bug |
details, report |
BugTracker |
create, filter |
Tag |
create, filter |
Template |
create, filter |
PlanType |
create, filter |
Priority |
create, filter |
Classification |
create, filter |
Attachment |
remove_attachment |
Markdown |
render |
Kiwitcms |
version |
Utils |
tracker_from_url |
Examples
Creating a test case and adding to a plan
rpc = KiwiTCMSApi()
case = rpc.TestCase_create({
'summary': 'Authorization check',
'product': 1,
'category': 1,
'priority': 1,
'case_status': 2,
})
rpc.TestPlan_add_case(plan_id=5, case_id=case['id'])
Updating execution status
rpc.TestExecution_update(execution_id=42, values={'status': 4})
Adding a link to an execution
rpc.TestExecution_add_link({
'execution': 42,
'url': 'https://jira.example.com/browse/BUG-123',
'name': 'BUG-123',
})
Disabling SSL verification (self-signed certificate)
rpc = KiwiTCMSApi(url='https://tcms.internal', username='admin', password='secret', verify_ssl=False)
# or via environment variable:
# KIWI_TCMS_API_VERIFY_SSL=false
Discovering available methods
rpc.discover_methods()
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kiwi_tcms_api-0.0.2.tar.gz.
File metadata
- Download URL: kiwi_tcms_api-0.0.2.tar.gz
- Upload date:
- Size: 16.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31e27f0206e8205d307242902041e65370bed7e2d1dec01e4e15202b0425cff2
|
|
| MD5 |
b7542269a99d7a1e178a83d77f2cb257
|
|
| BLAKE2b-256 |
0ae5a7e3f7c64fb7ba221bf643cfd37dfbce0955857b54dcb927d8d4b225e01b
|
Provenance
The following attestation bundles were made for kiwi_tcms_api-0.0.2.tar.gz:
Publisher:
publish.yml on alekseyvm/kiwi-tcms-api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kiwi_tcms_api-0.0.2.tar.gz -
Subject digest:
31e27f0206e8205d307242902041e65370bed7e2d1dec01e4e15202b0425cff2 - Sigstore transparency entry: 1144049083
- Sigstore integration time:
-
Permalink:
alekseyvm/kiwi-tcms-api@8d34ebc08feeca42853fcb30765f2fd8fed52326 -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/alekseyvm
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8d34ebc08feeca42853fcb30765f2fd8fed52326 -
Trigger Event:
release
-
Statement type:
File details
Details for the file kiwi_tcms_api-0.0.2-py3-none-any.whl.
File metadata
- Download URL: kiwi_tcms_api-0.0.2-py3-none-any.whl
- Upload date:
- Size: 16.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae3dd116d8e7b8a519d18a46d81c224c4b4df59d6f107593f65446156aad7ff0
|
|
| MD5 |
986360c61a083df6a7d22f2bbd66d65f
|
|
| BLAKE2b-256 |
9525b79b5de82f6e140cdc63fc97482fc51401e30d5333ac9a8336136241482a
|
Provenance
The following attestation bundles were made for kiwi_tcms_api-0.0.2-py3-none-any.whl:
Publisher:
publish.yml on alekseyvm/kiwi-tcms-api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kiwi_tcms_api-0.0.2-py3-none-any.whl -
Subject digest:
ae3dd116d8e7b8a519d18a46d81c224c4b4df59d6f107593f65446156aad7ff0 - Sigstore transparency entry: 1144049122
- Sigstore integration time:
-
Permalink:
alekseyvm/kiwi-tcms-api@8d34ebc08feeca42853fcb30765f2fd8fed52326 -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/alekseyvm
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8d34ebc08feeca42853fcb30765f2fd8fed52326 -
Trigger Event:
release
-
Statement type: