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, andInstrumentExpiry. - Memory Efficient: Uses
__slots__andfrozendataclasses 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3af0aeba3fcc5e9116c238f3f19940d5e2047576a138ca625b7b9cc5cb5ffc1
|
|
| MD5 |
830e4bdc27d05627c74d0dee2dbb6ca6
|
|
| BLAKE2b-256 |
43b2c6ea5660f0a34a6ca49c2f688c673fdb5ca898872d8ce429d8106569328d
|
File details
Details for the file laakhay_core-0.1.1-py3-none-any.whl.
File metadata
- Download URL: laakhay_core-0.1.1-py3-none-any.whl
- Upload date:
- Size: 22.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e316919737c410ea3b09c1005bf219b8a30e95bce47cf188491833f4029b5e6
|
|
| MD5 |
f7b8f6639953ad23f0573c780234a337
|
|
| BLAKE2b-256 |
24a5fbc1e4184e2c2ae212d35889943de4c3cb2d0218d40b7efb3518b36c8793
|