⚡ High-Performance Python Interface for RayforceDB
- Pythonic API - Chainable, fluent query syntax that feels pythonic
- High Performance - Minimal overhead between Python and RayforceDB runtime thanks to C API usage
- Active Development - Continuously expanding functionality
Package is available on Pypi
pip install rayforce-py>>> from datetime import time
>>> from rayforce import Table
>>> quotes = Table(
columns=["symbol", "time", "bid", "ask"],
values=[
["AAPL", "AAPL", "AAPL", "GOOG", "GOOG", "GOOG"],
[
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"),
],
[100.0, 101.0, 102.0, 200.0, 201.0, 202.0],
[110.0, 111.0, 112.0, 210.0, 211.0, 212.0],
],
)
>>> result = (
quotes
.select(
max_bid=quotes.bid.max(),
min_bid=quotes.bid.min(),
avg_ask=quotes.ask.mean(),
records_count=quotes.time.count(),
first_bid=quotes.time.first(),
)
.where((quotes.bid >= 110) & (quotes.ask > 100))
.by("symbol")
.execute()
)
>>> print(result)
┌────────┬─────────┬─────────┬─────────┬───────────────┬──────────────┐
│ symbol │ max_bid │ min_bid │ avg_ask │ records_count │ first_bid │
├────────┼─────────┼─────────┼─────────┼───────────────┼──────────────┤
│ GOOG │ 202.00 │ 200.00 │ 211.00 │ 3 │ 09:00:00.145 │
├────────┴─────────┴─────────┴─────────┴───────────────┴──────────────┤
│ 1 rows (1 shown) 6 columns (6 shown) │
└─────────────────────────────────────────────────────────────────────┘Full documentation available at: https://raypy.rayforcedb.com/
Built with ❤️ for high-performance data processing