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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for laakhay_data-0.2.7.tar.gz
Algorithm Hash digest
SHA256 4dd5bc2677332f7cc5417e9f42c8f62e26b1bc90e783cc4027a94c271a35f187
MD5 e42314bdb764be058c8d78f747273655
BLAKE2b-256 14d4bebfb2f562ad34dc627f61864803ad911652defcd5d60b875414177652f0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for laakhay_data-0.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 2f2eef70759f6209a3cfcc0e3b039bfd2c04496de35c30ac67dc4135a6522d42
MD5 f4326b5bccd90d3a2864d1d3ac611447
BLAKE2b-256 e6f061f4307752bd802019aba1cc9fbf3291d587bca259f0ec619dce8c26cf11

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