testrail-api
Python wrapper of the TestRail API
What it is and what it does
testrail-api is a Python client library that wraps the TestRail test management API, letting you automate interactions with TestRail from Python code. It exposes the API's main resources—milestones, test runs, test results, and attachments—as object methods, so you can create test runs, add results, attach screenshots, and update milestones without manually constructing HTTP requests.
The package depends only on requests and supports Python 3.9 and later. It can read credentials from environment variables or accept them directly at initialization, and it allows custom response handlers for non-standard error handling. The library is actively maintained, has no known vulnerabilities, and is classified as Production/Stable.
Use it for:
- Automate test result reporting by creating runs and adding results directly from test frameworks or CI/CD pipelines.
- Bulk-manage milestones and test runs programmatically rather than through the TestRail UI.
- Attach screenshots or logs to test results automatically during test execution.
- Build custom test reporting dashboards or integrations that query TestRail data.
- Integrate TestRail with continuous integration systems to track test execution and results.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A Python wrapper for the TestRail API that lets you programmatically create and manage test runs, milestones, results, and attachments in TestRail.
Yes. The package is actively maintained, has no security vulnerabilities, installs with minimal friction, and is the standard way to interact with TestRail from Python. Install it if you need to automate TestRail operations or integrate TestRail into a CI/CD pipeline.
Install
testrail-api on PyPI
pip
pip install testrail-apiuv
uv add testrail-apipoetry
poetry add testrail-apiInstalling testrail-api
Before you install
Low friction install with a single runtime dependency (requests). The package is actively maintained with recent commits, marked as Production/Stable, and supports current Python versions from 3.9 through 3.14.
License in practice
MIT License (permissive) means you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
pip install testrail-api
from testrail_api import TestRailAPI
api = TestRailAPI("https://example.testrail.com/", "example@mail.com", "password")
new_milestone = api.milestones.add_milestone(project_id=1, name="New milestone")
Requires TestRail instance URL, email, and password; alternatively set TESTRAIL_URL, TESTRAIL_EMAIL, and TESTRAIL_PASSWORD environment variables.
Verify before relying
- Whether the package supports TestRail's full API surface or a subset of endpoints.
- Rate limiting or connection pooling behavior when making many concurrent requests.
- Authentication method support beyond basic email/password (e.g., API tokens).
Package facts
| License | MIT License (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — requests |
| Maintenance | actively maintained — 210 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,602,959/month — #2,972 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: testrail_api-1.13.6-py3-none-any.whl
Keywords: testrail, api, client, api-client, library, testrail_api, testrail-api
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
pytest-pytestrailA pytest plugin that decorates test functions…
permissive · top 15,000 on PyPI
pytest-testrailA pytest plugin that integrates test execution…
permissive · top 15,000 on PyPI
trcliA command-line tool for uploading test…
unclear · top 15,000 on PyPI
pybacklogpyPyBacklogPy wraps the Backlog API to let you…
permissive · top 5,000 on PyPI
pytest-html-reporterGenerates static HTML test reports from pytest…
permissive · top 15,000 on PyPI
qase-api-clientPython client library for the Qase TestOps API…
unclear · top 15,000 on PyPI
allure-robotframeworkIntegrates Robot Framework test execution with…
permissive · top 15,000 on PyPI
qase-pytestA pytest plugin that reports test results to…
permissive · top 15,000 on PyPI
pytest-freezerpytest-freezer provides a pytest fixture that…
permissive · top 5,000 on PyPI
qase-api-v2-clientA Python client library for the Qase TestOps…
unclear · top 15,000 on PyPI