Metadata-Version: 2.4
Name: fin-engine-core
Version: 1.0.1
Summary: Shared core library for fin-engine microservices
License: MIT
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: pydantic>=2.0
Requires-Dist: redis>=4.5
Requires-Dist: pandas>=2.0
Requires-Dist: numpy>=1.24
Requires-Dist: apscheduler>=3.10
Requires-Dist: pytz>=2023.3
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"
Requires-Dist: ruff>=0.1; extra == "dev"
Requires-Dist: pact-python>=2.0; extra == "dev"

# fin-engine-core

Shared core library for fin-engine microservices.

## Contratos Estables (v1)

### OrderSignal
Intención de orden generada por el brain.

```python
from fin_engine_core import OrderSignal, SIDE_BUY, SIDE_SELL

signal = OrderSignal(
    side=SIDE_BUY,
    simbolo="AAPL",
    razon="SCORE>THRESHOLD",
    score=0.45,
    regimen="TRENDING",
)
```

### NotificationEvent
Evento de notificación para el notifier.

```python
from fin_engine_core import NotificationEvent

event = NotificationEvent(
    tipo="venta",
    usuario="pedro",
    simbolo="AAPL",
    pnl=12.34,
)
```

### EventBus
Interfaz pub/sub abstraída.

```python
from fin_engine_core import RedisSignalBus, InMemorySignalBus

bus = RedisSignalBus(host="localhost", port=6379)
bus.publicar("señales", signal)
```

## Domain Models

```python
from fin_engine_core import (
    AccountSnapshot,
    PositionSnapshot,
    snapshot_desde_estado,
    OrderJournal,
    OrderStateMachine,
    TradingCalendar,
    get_category,
    get_et_now,
    get_cl_now,
    is_market_open_et,
)
```

## Instalación

```bash
pip install fin-engine-core==1.0.0
```

## Versionado

SemVer estricto. v1.x = estable. Breaking changes = v2.0.0.
