Skip to main content

Data infrastructure built with ♥︎ by Laakhay

Project description

Laakhay Data

Beta-stage async-first cryptocurrency market data aggregation library.

⚠️ Beta Software: This library is in active development. Use with caution in production environments. APIs may change between versions.

Unified API for multi-exchange market data with support for Binance, Bybit, OKX, Hyperliquid, Kraken, and Coinbase. Modular provider architecture with REST/WebSocket abstraction, type-safe Pydantic models, and high-level streaming feeds.

Installation

pip install laakhay-data

Quick Start

import asyncio
from laakhay.data.core import DataAPI, MarketType, Timeframe

async def main():
    async with DataAPI() as api:
        # Fetch OHLCV data
        ohlcv = await api.fetch_ohlcv(
            symbol="BTCUSDT",
            timeframe=Timeframe.H1,
            exchange="binance",
            market_type=MarketType.SPOT,
            limit=100,
        )
        print(f"Fetched {len(ohlcv)} bars")
        
        # Stream real-time trades
        async for trade in api.stream_trades(
            symbol="BTCUSDT",
            exchange="binance",
            market_type=MarketType.SPOT,
        ):
            print(f"{trade.symbol}: ${trade.price} ({trade.side})")
            break

asyncio.run(main())

Supported Exchanges

Exchange Spot Futures REST WebSocket
Binance
Bybit
OKX
Hyperliquid
Kraken
Coinbase

Data Types

Type REST WebSocket Markets
OHLCV Bars Spot, Futures
Order Book Spot, Futures
Trades Spot, Futures
Liquidations Futures
Open Interest Futures
Funding Rates Futures
Mark Price Futures
Symbol Metadata Spot, Futures

Key Features

  • Unified DataAPI: Single interface across all exchanges
  • Universal Symbol Mapping (URM): Use any symbol format
  • Capability Discovery: Check feature support before requests
  • Type-Safe Models: Immutable Pydantic v2 models
  • High-Level Feeds: OHLCV, liquidation, and open interest feeds
  • Stream Relay: Forward streams to Redis, Kafka, or custom sinks

Documentation

Comprehensive documentation is available in the docs/ directory:

See the Documentation Index for complete navigation.

Requirements

  • Python 3.12+
  • pydantic>=2.0
  • aiohttp>=3.8
  • websockets>=10

License

MIT License - see LICENSE


Built by Laakhay Corporation

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_data-0.2.6.tar.gz (193.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_data-0.2.6-py3-none-any.whl (344.2 kB view details)

Uploaded Python 3

File details

Details for the file laakhay_data-0.2.6.tar.gz.

File metadata

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

File hashes

Hashes for laakhay_data-0.2.6.tar.gz
Algorithm Hash digest
SHA256 8842e6a192c15577f6d60e29124f195e7362094a7627cb4c35eca448b1c993f0
MD5 5b308ab83a4d13f9d60444799d0666ed
BLAKE2b-256 0cb4c64f10d51bdea307ca8a21795e3bd2fa163cb2b7d8277303d9c925955f07

See more details on using hashes here.

File details

Details for the file laakhay_data-0.2.6-py3-none-any.whl.

File metadata

File hashes

Hashes for laakhay_data-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 8ede4fd1dcf3c361ae6c46ba3c8b97140bad19426d46f6c765b11d725bd05170
MD5 2f7ed8a2898b5cd7f3f9b80005b276a5
BLAKE2b-256 dfbbdd0e001aa6a1a548c1ebcebca51e63f4911941e039ee08accffd69f3a9db

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