--- id: testrail-api version: "1.13.6" license: MIT License license_treatment: permissive maintenance: active --- # testrail-api — Python wrapper of the TestRail API License: permissive · Maintenance: active · Downloads: 2.6M/mo ## 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 above — 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 pip install testrail-api uv add testrail-api 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_current - Install friction: low - Maintenance: active - Downloads: 2.6M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags testrail api client, test management automation, testrail python wrapper, test run management, automated test reporting, testrail integration, test case tracking, test-management, api-client, ci-cd [View on SkillFed](https://skillfed.io/packages/testrail-api) · [View on PyPI](https://pypi.org/project/testrail-api/)