Metadata-Version: 2.4
Name: imagen-sdk
Version: 0.0.1
Summary: A client library for generating images through the flix-imagen API
Project-URL: Homepage, https://bitbucket.org/flixstock-dev/imagen-sdk
Project-URL: Repository, https://bitbucket.org/flixstock-dev/imagen-sdk
Project-URL: Issues, https://bitbucket.org/flixstock-dev/imagen-sdk/issues
Author-email: Flixstock <dev@flixstock.com>
License-Expression: LicenseRef-Flixstock-Proprietary
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: Other/Proprietary License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Multimedia :: Graphics
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# Imagen SDK

A proprietary client library for generating images through the [flix-imagen](https://bitbucket.org/flixstock-dev/flix-imagen) API.

**Authorized Flixstock users only.** A signed runtime license file is required before the SDK can be used.

## Installation

```bash
pip install imagen-sdk
```

## Runtime license file

Before creating a client, obtain a signed license file from Flixstock. The SDK checks for a license in this order:

1. `license_path` argument to `ImagenClient`
2. `IMAGEN_SDK_LICENSE` environment variable
3. `./imagen-sdk.license` or `./license.json` in the working directory
4. `~/.config/imagen-sdk/license.json`

Example license format: see `license.example.json`.

### Issue a license (Flixstock admins)

```bash
python scripts/issue_license.py \
  --licensee "Jane Doe" \
  --email "jane.doe@flixstock.com" \
  --output imagen-sdk.license
```

Allowed email domains: `@flixstock.com`, `@imageedit.ai`.

## Usage

```python
from imagen_sdk import ImagenClient, LicenseError

try:
    client = ImagenClient(
        base_url="https://imagen-api.flixstock.com",
        api_key="your-api-key",
        license_path="/path/to/imagen-sdk.license",
    )
except LicenseError as exc:
    print(exc)
```

Or set the environment variable:

```bash
export IMAGEN_SDK_LICENSE=/path/to/imagen-sdk.license
```

```python
from imagen_sdk import ImagenClient

client = ImagenClient(
    base_url="https://imagen-api.flixstock.com",
    api_key="your-api-key",
)
```

## Development

```bash
python -m venv .venv
.venv\Scripts\activate          # Windows
# source .venv/bin/activate     # macOS/Linux

pip install --upgrade pip build twine pytest
python scripts/issue_license.py --licensee "Dev User" --email "dev@flixstock.com"
pytest
python -m build
```

## License

Proprietary — see [LICENSE](LICENSE). Unauthorized use, copying, or distribution is prohibited.
