Metadata-Version: 2.4
Name: boolean-sdk
Version: 0.1.1
Summary: Boolean SDK: ACS permission checks with memory and Redis caching
License: Proprietary
Keywords: acs,authorization,permissions,redis,cache
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
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: Typing :: Typed
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: httpx<1,>=0.27
Requires-Dist: redis<6,>=5
Provides-Extra: dev
Requires-Dist: pytest<9,>=8; extra == "dev"
Requires-Dist: build<2,>=1; extra == "dev"
Requires-Dist: twine<7,>=6; extra == "dev"

# boolean-sdk

Python SDK for ACS permission checks with in-memory and Redis caching.

Requiere **Python 3.9+** (3.10 o superior recomendado).

```python
from boolean.sdk import ACSClient, BooleanSDKConfig

config = BooleanSDKConfig(
    acs_base_url="https://example.com/acs",
    redis_url="redis://localhost:6379/0",
)
with ACSClient(config) as client:
    result = client.check_permission(token, "juzgado", "sentencias", "write")
    assert result.allowed in (True, False)
```

## Publicar en PyPI

1. Cuenta en [pypi.org](https://pypi.org) y un [API token](https://pypi.org/manage/account/token/) (scope para todo el usuario o solo el proyecto `boolean-sdk` tras el primer upload).
2. Desde esta carpeta (`sdk/python`):

   ```bash
   python -m pip install "build>=1" "twine>=6"
   python -m build
   python -m twine check dist/*
   TWINE_USERNAME=__token__ TWINE_PASSWORD=pypi-XXXXXXXX python -m twine upload dist/*
   ```

   Sustituí `pypi-XXXXXXXX` por el token que te muestra PyPI.

   **Si `twine check` falla** con `Metadata is missing required fields: Name, Version` y menciona `Metadata-Version` 2.3 como máximo, tenés **Twine anterior a v6**. Actualizá: `python -m pip install -U "twine>=6"` y volvé a ejecutar el `check`. El comando correcto es `twine check` o `python -m twine check`, no `python twine check`.

Para probar antes en TestPyPI: `twine upload --repository testpypi dist/*` (crear cuenta y token en [test.pypi.org](https://test.pypi.org)).

## Integración y prueba manual

- Guía para otro sistema o IA: [examples/INTEGRATION.md](examples/INTEGRATION.md).
- Script de ejemplo contra un ACS real: [examples/check_permission_demo.py](examples/check_permission_demo.py).
