Skip to main content

Core types and models for the Laakhay ecosystem

Project description

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

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:
from laakhay.core import Bar, Order, Signal, DatasetKey, Timeframe

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

laakhay_core-0.0.1.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

laakhay_core-0.0.1-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file laakhay_core-0.0.1.tar.gz.

File metadata

  • Download URL: laakhay_core-0.0.1.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.4

File hashes

Hashes for laakhay_core-0.0.1.tar.gz
Algorithm Hash digest
SHA256 ea244d771a5105121515a1ea66f3f935f394796890383b1b7a91ac691a85daf8
MD5 266de21e747ea77f4160404d3beb1e96
BLAKE2b-256 9df76bbc27c655517263a15a7e36232430ee73d6290b6b306979162395ee757f

See more details on using hashes here.

File details

Details for the file laakhay_core-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for laakhay_core-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 057f52a058709704def89088619d402e366aa6083dd9c1bc106c5622cb69d1bd
MD5 b1a1ec5175a41cce42fe38be9ecf8bb9
BLAKE2b-256 d0a7b5af1c408a82fa63b96e77a7dc4a320364470f361cdfaf59041babb6a61a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page