Skip to content

RayforceDB/rayforce-py

Repository files navigation

High-Performance Lightweight Python ORM designed for RayforceDB

Documentation Tests Coverage Release Python Version

Python ORM for RayforceDB, a high-performance columnar database designed for analytics and data operations. Core is written in pure C with minimal overhead - combines columnar storage with SIMD vectorization for lightning-fast analytics on time-series and big data workloads.

Full Documentation: https://py.rayforcedb.com/

Features

  • Pythonic API - Chainable, fluent query syntax
  • High Performance - Minimal overhead between Python and RayforceDB runtime via C API
  • Lightweight - Core is less than 1 MB footprint
  • Active Development - Continuously expanding functionality

RayforcePy Benchmarks

Benchmarks run on: macOS M4 32GB, 100 groups, 20 runs (median), 5 warmup runs. H2OAI

Quick Start

>>> from datetime import time
>>> from rayforce import Table, Vector, Symbol, Time, F64
>>> from rayforce.types.table import Column

>>> quotes = Table.from_dict({
        "symbol": Vector(items=["AAPL", "AAPL", "AAPL", "GOOG", "GOOG", "GOOG"], ray_type=Symbol),
        "time": Vector(
            items=[
                time.fromisoformat("09:00:00.095"),
                time.fromisoformat("09:00:00.105"),
                time.fromisoformat("09:00:00.295"),
                time.fromisoformat("09:00:00.145"),
                time.fromisoformat("09:00:00.155"),
                time.fromisoformat("09:00:00.345"),
            ],
            ray_type=Time,
        ),
        "bid": Vector(items=[100.0, 101.0, 102.0, 200.0, 201.0, 202.0], ray_type=F64),
        "ask": Vector(items=[110.0, 111.0, 112.0, 210.0, 211.0, 212.0], ray_type=F64),
    })

>>> result = (
        quotes
        .select(
            max_bid=Column("bid").max(),
            min_bid=Column("bid").min(),
            avg_ask=Column("ask").mean(),
            records_count=Column("time").count(),
            first_time=Column("time").first(),
        )
        .where((Column("bid") >= 110) & (Column("ask") > 100))
        .by("symbol")
        .execute()
    )
>>> print(result)
┌────────┬─────────┬─────────┬─────────┬───────────────┬──────────────┐
│ symbolmax_bidmin_bidavg_askrecords_countfirst_time   │
├────────┼─────────┼─────────┼─────────┼───────────────┼──────────────┤
│ GOOG202.00200.00211.00309:00:00.145 │
├────────┴─────────┴─────────┴─────────┴───────────────┴──────────────┤
│ 1 rows (1 shown) 6 columns (6 shown)                                │
└─────────────────────────────────────────────────────────────────────┘

Installation

Package is available on PyPI:

pip install rayforce-py

This installation also provides a command-line interface to access the native Rayforce runtime:

~ $ rayforce
Launching Rayforce...
  RayforceDB: 0.1 Dec  6 2025
  Documentation: https://rayforcedb.com/
  Github: https://github.com/RayforceDB/rayforce
↪ (+ 1 2)
3

Built with ❤️ for high-performance data processing | MIT Licenced | RayforceDB Team

About

Lightweight and Powerful Python ORM for RayforceDB - a high-performance columnar database

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •