Metadata-Version: 2.4
Name: laakhay-core
Version: 0.0.1
Summary: Core types and models for the Laakhay ecosystem
Project-URL: Homepage, https://laakhay.com
Project-URL: Repository, https://github.com/laakhay/core
Project-URL: Issues, https://github.com/laakhay/core/issues
Author-email: Laakhay Corporation <laakhay.corp@gmail.com>
License: MIT
License-File: LICENSE
Requires-Python: >=3.12
Provides-Extra: dev
Requires-Dist: build>=1.0.0; extra == 'dev'
Requires-Dist: pyright>=1.1.406; extra == 'dev'
Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Requires-Dist: twine>=5.0.0; extra == 'dev'
Description-Content-Type: text/markdown

# Laakhay Core

`laakhay-core` provides the shared type definitions and data models for the Laakhay ecosystem. It is designed to be a lightweight, high-performance, and zero-dependency library that prevents type drift between services.

## Core Principles

- **Zero Runtime Dependencies**: No Pydantic or external libraries required for core execution.
- **High Performance**: Uses Python `dataclasses` with `slots=True` for memory efficiency and speed.
- **Interoperability**: Standardized `Bar`, `Order`, and `Signal` models across `data`, `ta`, and `quantlab`.
- **Stable Contracts**: Versioned model serialization and explicit normalization helpers.

## Usage

```python
from laakhay.core import (
    Bar,
    DatasetKey,
    DataSource,
    Order,
    OrderSide,
    OrderType,
    Signal,
    Timeframe,
    to_decimal,
    to_timestamp,
)

bar = Bar(
    ts=to_timestamp("2026-02-20T00:00:00Z"),
    open=to_decimal("50000"),
    high=to_decimal("51000"),
    low=to_decimal("49000"),
    close=to_decimal("50500"),
    volume=to_decimal("10.5"),
)

order = Order(
    id="ord-1",
    symbol="BTCUSDT",
    side=OrderSide.BUY,
    type=OrderType.LIMIT,
    qty="0.1",
    price="50000",
)

signal = Signal(symbol="BTCUSDT", side="SELL", type="LIMIT", price="51000", sl="2%")
key = DatasetKey(symbol="BTCUSDT", timeframe=Timeframe("1h"), source=DataSource.OHLCV)
```

## Public API

- `laakhay.core` exports all canonical contracts directly.
- Preferred import style:

```python
from laakhay.core import Bar, Order, Signal, DatasetKey, Timeframe
```
