Metadata-Version: 2.3
Name: valentina-python-client
Version: 1.5.1
Summary: Async Python client library for the Valentina Noir API
Author: Nate Landau
Author-email: Nate Landau <github@natenate.org>
License: MIT License
         
         Copyright (c) 2026 natelandau
         
         Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
         
         The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
         
         THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: anyio>=4.12.1
Requires-Dist: httpx>=0.28.1
Requires-Dist: loguru>=0.7.3
Requires-Dist: pydantic[email]>=2.12.5
Requires-Python: >=3.13
Project-URL: Homepage, https://docs.valentina-noir.com/python-api-client/
Project-URL: Repository, https://github.com/natelandau/valentina-python-client
Description-Content-Type: text/markdown

# Valentina Python Client

Async Python client library for accessing the Valentina Noir API.

## Features

- **Async-first design** - Built on httpx for efficient async HTTP operations
- **Type-safe** - Full type hints with Pydantic models for request/response validation
- **Convenient factory pattern** - Create a client once, access services from anywhere
- **Automatic pagination** - Stream through large datasets with `iter_all()` or fetch everything with `list_all()`
- **Robust error handling** - Specific exception types for different error conditions
- **Idempotency support** - Optional automatic idempotency keys for safe retries
- **Rate limit handling** - Built-in support for automatic rate limit retries

This client is a supported and up-to-date reference implementation for the [Valentina Noir API](https://docs.valentina-noir.com).

## Documentation

The full documentation is available at https://natelandau.github.io/valentina-python-client/.

## Development Tools

### Validate Constants

Verify that the `Literal` type constants in this package are in sync with the live API's `/options` endpoint. This catches drift between client and server before a release.

```bash
# Via duty task
uv run duty validate_constants

# Via script directly
uv run python scripts/validate_constants.py --api-key <key> --company-id <id>
```

The script reads configuration from (highest precedence first):

1. CLI arguments (`--api-url`, `--api-key`, `--company-id`)
2. System environment variables (`VALENTINA_CLIENT_BASE_URL`, `VALENTINA_CLIENT_API_KEY`, `VALENTINA_CLIENT_DEFAULT_COMPANY_ID`)
3. A `.env.secret` file in the project root

Exit codes: `0` = all constants match, `1` = mismatches found, `2` = missing configuration.
