Metadata-Version: 2.4
Name: mpt-api-client
Version: 0.0.2
Summary: SoftwareOne Marketplace API Client for Python
Author: SoftwareOne AG
License: Apache-2.0 license
License-File: LICENSE
Keywords: client,marketplace,openapi,softwareone
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Utilities
Requires-Python: <4,>=3.12
Requires-Dist: httpx==0.28.*
Requires-Dist: python-box>=7.3.2
Description-Content-Type: text/markdown

# mpt-api-python-client

A Python client for interacting with the MPT API.

## Installation

Install as a uv dependency:

```bash
uv add mpt-api-client
cp .env.example .env
```

## Usage

```python
from mpt_api_client import MPTClient

#client = MPTClient(api_key=os.getenv("MPT_API_KEY"), base_url=os.getenv("MPT_API_URL"))
client = MPTClient() # Will get the api_key and base_url from the environment variables

for product in client.catalog.products.iterate():
    print(product.name)
```

## Async Usage

```python
import asyncio
from mpt_api_client import AsyncMPTClient

async def main():
    # client = AsyncMPTClient(api_key=os.getenv("MPT_API_KEY"), base_url=os.getenv("MPT_API_URL"))
    client = AsyncMPTClient() # Will get the api_key and base_url from the environment variables
    async for product in client.catalog.products.iterate():
        print(product.name)

asyncio.run(main())
```

## Development

Clone the repository and install dependencies:

```bash
git clone https://github.com/albertsola/mpt-api-python-client.git
cd mpt-api-python-client
uv add -r requirements.txt
```

## Testing

Run all validations with:

```bash
docker compose run --rm app_test
```

Run pytest with:

```bash
pytest tests/unit
pytest tests/e2e
pytest tests/seed
```
## License

MIT
