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)
# Equity URM
aapl = parse_urm_id("urm://nasdaq:aapl:equity")

# Crypto spot URM
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.1.tar.gz (15.7 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.1-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for laakhay_core-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d3af0aeba3fcc5e9116c238f3f19940d5e2047576a138ca625b7b9cc5cb5ffc1
MD5 830e4bdc27d05627c74d0dee2dbb6ca6
BLAKE2b-256 43b2c6ea5660f0a34a6ca49c2f688c673fdb5ca898872d8ce429d8106569328d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laakhay_core-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4e316919737c410ea3b09c1005bf219b8a30e95bce47cf188491833f4029b5e6
MD5 f7b8f6639953ad23f0573c780234a337
BLAKE2b-256 24a5fbc1e4184e2c2ae212d35889943de4c3cb2d0218d40b7efb3518b36c8793

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