Skip to main content

Core types and models for the Laakhay ecosystem

Project description

Laakhay Core

laakhay-core is the high-performance, zero-dependency bedrock of the Laakhay ecosystem. It provides the source of truth for all domain models, identity grammars, and primitive types.

🏗 Philosophy: The "Thin Core"

This library follows a strict separation of Data and Behavior.

  • Schema Authority: Defines what a Bar or Position is.
  • Identity Authority: Centralizes URM (Universal Representation Mapping).
  • Stability First: Zero runtime dependencies to prevent version drift.

Read more about our Philosophy


🛠 Features

  • Standardized Identity: URM System for exchange-agnostic instrument resolution.
  • Atomic Models: Efficient OHLCV (Bar), Orders, and Positions.
  • Semantic Components: Type-safe BaseAsset, QuoteAsset, and InstrumentExpiry.
  • Memory Efficient: Uses __slots__ and frozen dataclasses for high-throughput trading.
  • Python 3.9+: Built for modern Python environments.

🚀 Quick Start

Installation

laakhay-core is meant to be used as a backend library:

pip install laakhay-core

Basic Usage

from laakhay.core import Bar, Timeframe, AssetSpec, parse_urm_id

# 1. Create a high-performance Bar
bar = Bar(ts=1708453200, open="52000", high="52500", low="51800", close="52100", volume="150")

# 2. Work with Identities (Stocks or Crypto)
# Stock URM (Implicit quote)
aapl = parse_urm_id("urm://nasdaq:aapl:spot")

# Crypto URM (Explicit pair)
btc = parse_urm_id("urm://binance:btc/usdt:spot")

# 3. Handle Metadata
aapl_meta = AssetSpec(symbol="AAPL", currency="USD", precision=2)

📖 Documentation

🧪 Development

make test    # Run all unit tests
make lint    # Check formatting and types

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.1.0.tar.gz (13.9 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.1.0-py3-none-any.whl (20.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for laakhay_core-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d7b5a8fded1f6ea9da3088d50d712001e5d27cbee2d80c97c698b5be23bf93aa
MD5 12ff422b355cbf8856b9315ed9ef2e70
BLAKE2b-256 45c5a6ddb135dc7a1b6de81c6fca30cae4fd673858dd8929efc86e9075edc3c9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laakhay_core-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 77ac9056bce9660f4eb5ae073a8a42a15d699c0836186c2cf69a14be71cb0bc6
MD5 f6e8c9ef3e72d241d14cb2becfed130e
BLAKE2b-256 3c79a144c2e8861111bd13811719c9c24445c30aea203c5688a27c50114947a6

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