Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions .flake8

This file was deleted.

30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: CI

on:
push:
branches: [master]
pull_request:

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true

- name: Install the project
run: uv sync --python ${{ matrix.python-version }}

- name: Lint with ruff
run: uv run --python ${{ matrix.python-version }} ruff check

- name: Run tests
run: uv run --python ${{ matrix.python-version }} python -m unittest tests/test_*.py
6 changes: 0 additions & 6 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2016-2019 Jack McPherson
Copyright (c) 2016-2026 Jack McPherson

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
[![Build Status](https://travis-ci.org/jmcph4/PyOBSim.svg?branch=master)](https://travis-ci.org/jmcph4/PyOBSim)

# PyOBSim - the Python Order Book Simulator #
---

Expand Down Expand Up @@ -47,3 +45,18 @@ We get:
--------------------------------------------------------------------------------
Price Quantity
Bid

## Development ##
---

PyOBSim uses [uv](https://docs.astral.sh/uv/) for dependency management,
packaging, and running tasks. With `uv` installed, set up the project with:

uv sync

This creates a virtual environment and installs PyOBSim along with its
development dependencies (`ruff`). Common tasks:

uv run python -m unittest tests/test_*.py # run the test suite
uv run ruff check # lint the codebase
uv build # build the sdist and wheel
2 changes: 1 addition & 1 deletion pyobsim/book.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from .side import Side
from .errors import InsufficientFundsError, ParticipantAlreadyExistsError, \
NoSuchParameterError
NoSuchParameterError, NoSuchOrderError


class Book(object):
Expand Down
1 change: 1 addition & 0 deletions pyobsim/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class ParticipantAlreadyExistsError(Exception):
class NoSuchParameterError(Exception):
pass


class NoSuchOrderError(Exception):
pass

1 change: 0 additions & 1 deletion pyobsim/side.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ def volume(self):
for order in level:
vol += order.qty


return vol

def get(self, price):
Expand Down
47 changes: 47 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
[project]
name = "pyobsim"
version = "0.1.0"
description = "A Python order book simulator for testing trading algorithms"
readme = "README.md"
requires-python = ">=3.10"
license = "MIT"
license-files = ["LICENSE"]
authors = [{ name = "Jack McPherson", email = "jack@jmcph4.dev" }]
keywords = ["order book", "trading", "simulation", "finance", "markets"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Financial and Insurance Industry",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Office/Business :: Financial",
]
dependencies = []

[project.urls]
Homepage = "https://github.com/jmcph4/PyOBSim"
Repository = "https://github.com/jmcph4/PyOBSim"

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.build.targets.wheel]
packages = ["pyobsim"]

[dependency-groups]
dev = ["ruff>=0.6"]

[tool.ruff]
line-length = 80
# tests excluded while waiting for per-file ignore directives
extend-exclude = ["tests"]

[tool.ruff.lint]
# E/W: pycodestyle, F: pyflakes (the checks flake8 ran by default)
select = ["E", "W", "F"]
# W391 - trailing blank line at end of file (personal style preference)
ignore = ["W391"]
43 changes: 43 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading