Metadata-Version: 2.3
Name: pbirs-client
Version: 0.0.3
Summary: 
Author: narumi
Author-email: narumi <toucans-cutouts0f@icloud.com>
Requires-Dist: cryptography>=50.0.1
Requires-Dist: httpx>=0.28.1
Requires-Dist: pydantic>=2.13.5
Requires-Dist: pyspnego>=0.12.2
Requires-Dist: typer>=0.27.2
Requires-Python: >=3.14
Description-Content-Type: text/markdown

# pbirs-client

A typed Python client for the Power BI Report Server REST API, with NTLM authentication and resource-based API helpers.

## Requirements

- Python 3.14 or later
- A Power BI Report Server account

## Installation

```bash
uv add pbirs-client
```

## Usage

Set the connection details:

```bash
export BI_URL="https://reports.example.com"
export BI_USERNAME="DOMAIN\\username"
export BI_PASSWORD="password"
```

Create a client and call an API resource:

```python
from pbirs_client import BIClient

with BIClient.from_env() as client:
    items = client.catalog.get_catalog_items()
    print(items)
```

Pass documented query options through `params`:

```python
with BIClient.from_env() as client:
    reports = client.power_bi_reports.get_power_bi_reports(
        params={"$select": "Id,Name,Path"},
    )
```

Write operations are disabled by default. Enable them explicitly when needed:

```python
client = BIClient.from_env(allow_mutation=True)
```

## Development

Install the development dependencies and run the offline checks:

```bash
uv sync --group dev
just all
```

The test report measures Python statement coverage. To separately verify API endpoint coverage against the current Microsoft Learn catalog, run the network-dependent audit:

```bash
just api-coverage
```

To smoke-test non-mutating API calls against a server configured in `.env`, run:

```bash
just smoke
```

The recipe uses the connection settings from `.env`, even when BI environment variables are already exported. The script reports response sizes without printing response data or credentials.

## Documentation

- [Power BI Report Server REST API](https://learn.microsoft.com/en-us/rest/api/power-bi-report/)
