Metadata-Version: 2.4
Name: pylynqa
Version: 0.1.0b1
Summary: Python client for the Lynqa API
Author-email: Alexis Pallier <alexis.pallier@petit-robot.bzh>
License-Expression: Apache-2.0
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.28
Provides-Extra: dev
Requires-Dist: pytest>=7; extra == "dev"
Requires-Dist: pytest-mock>=3; extra == "dev"
Requires-Dist: pytest-responses>=0.5; extra == "dev"
Requires-Dist: ruff>=0.15; extra == "dev"
Requires-Dist: ty>=0.0; extra == "dev"
Requires-Dist: coverage>=7.10; extra == "dev"
Dynamic: license-file

# pylynqa

[![CI](https://github.com/petit-robot/pylynqa/actions/workflows/ci.yml/badge.svg)](https://github.com/petit-robot/pylynqa/actions/workflows/ci.yml)
[![Acceptance test](https://github.com/petit-robot/pylynqa/actions/workflows/acceptance.yml/badge.svg)](https://github.com/petit-robot/pylynqa/actions/workflows/acceptance.yml)
[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)
![Python](https://img.shields.io/badge/python-3.9%2B-blue.svg)

**pylynqa** is a Python client for the [Lynqa](https://lynqa.smartesting.com) REST API.

![Python/Lynqa connector](docs/python-lynqa.png)

Lynqa is a test execution AI Agent: you describe a test (plain steps or a Gherkin scenario) and Lynqa runs it
against your web application. This library provides a wrapper around the REST API, covering test
run management, step inspection, screenshot retrieval, and account operations.

## Disclaimers

> [!IMPORTANT]
> **This is an unofficial project.** pylynqa is **not affiliated with, endorsed by, or maintained by
> [Smartesting](https://www.smartesting.com)**, the company that develops Lynqa. "Lynqa" and "Smartesting" are the
> property of their respective owners.

> [!NOTE]
> **Lynqa is a commercial product.** Using this client requires a Lynqa account and an API key, and running tests
> consumes paid credits. See <https://my.lynqa.smartesting.com/integration> to create an API key.

## Requirements

- Python 3.9+
- A Lynqa account and API key (test executions consume credits)

## Installation

```bash
pip install pylynqa
```

> At this early stage the package may not be published on PyPI yet. In the meantime you can install it from source:
>
> ```bash
> pip install git+https://github.com/petit-robot/pylynqa.git
> ```

## Quick start

```python
from pylynqa import CreateTestStep, LynqaClient

client = LynqaClient(api_key="your-api-key")

run_id = client.add_test_run(
    url="https://lemonde.fr",
    steps=[
        CreateTestStep(
            action="Go to the website",
            expected_result="The website is open",
        ),
        CreateTestStep(
            action='Search an article on "france ia"',
            expected_result='Should have an article on "IA agentique"',
        ),
    ],
    name="Smoke - Search an article",
)

status = client.get_test_run_status(run_id)
print(status["status"])  # e.g. "running"
```

## Collaboration

This project is at an early stage, so **external contributions are limited for now**. This may be opened up more
broadly later as the project matures.

In the meantime, **you are very welcome to open an [issue](https://github.com/petit-robot/pylynqa/issues)** to report a
bug or ask any question.

## License

Licensed under the [Apache License 2.0](LICENSE).
