API Reference

Order Book

class bourse.core.OrderBook

Rust orderbook interface

bourse.core.order_book_from_json(path: str) bourse.core.OrderBook

Load an order book from a JSON snapshot

Discrete Event Simulation

bourse.step_sim.run(env, ...) dict[str, ndarray]

Run a discrete event simulation for fixed number of steps

class bourse.core.StepEnv

Discrete event simulation environment

class bourse.step_sim.agents.base_agent.BaseAgent

Base discrete event agent

class bourse.step_sim.agents.random_agent.RandomAgent(bourse.step_sim.agents.base_agent.BaseAgent)

Agent that place randomly sampled orders

Discrete Event Numpy API

class bourse.core.StepEnvNumpy

Discrete event simulation environment

class bourse.step_sim.agents.base_agent.BaseNumpyAgent

Base discrete event agent using Numpy data

class bourse.step_sim.agents.random_agent.NumpyRandomAgents(bourse.step_sim.agents.base_agent.BaseNumpyAgent)

Simple agent set that places random orders via Numpy arrays

Utils

bourse.data_processing.orders_to_dataframe(...) DataFrame

Convert order data to a Pandas dataframe

bourse.data_processing.trades_to_dataframe(trades) DataFrame

Convert trade data to a Pandas dataframe