skillfed

testrail-api

Python wrapper of the TestRail API

testrail-api v1.13.6 2.6M downloads/30d#2,972 on PyPI37
Permissive license MIT License Active released

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-api

uv

uv add testrail-api

poetry

poetry add testrail-api

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Libraries :: Python Modules

Tags

testrail api clienttest management automationtestrail python wrappertest run managementautomated test reportingtestrail integrationtest case tracking
test-managementapi-clientci-cd

More Python Modules packages