Metadata-Version: 2.4
Name: stock-gen
Version: 0.5.0
Summary: Order-book event generator and CLOB simulator with policy-driven event dynamics
Author: Small Turtle 2
License: MIT License
        
        Copyright (c) 2026 Small Turtle 2
        
        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:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Requires-Python: >=3.11
Requires-Dist: matplotlib>=3.8
Requires-Dist: numpy>=1.26
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == 'dev'
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Description-Content-Type: text/markdown

# stock-gen

Language: English (canonical) | [한국어](README.ko.md)

`stock-gen` is an event-driven limit order book simulator for virtual stock market experiments.
It models placement, cancellation (including partial cancel), replace, and market events on a single-asset CLOB.

## Requirements

- Python >= 3.11

## Install

```bash
python -m pip install stock-gen
```

For local development:

```bash
python -m pip install -e '.[dev]'
```

## Quickstart

```python
from stock_gen import StockGenerator, StockGeneratorConfig

cfg = StockGeneratorConfig(seed=123, end_time=5.0)
sim = StockGenerator(cfg).gen()
print(len(sim.frames), len(sim.events), len(sim.trades))
```

## What Changed In v0.5

- `get_l2(as_ticks=False)` now encodes missing prices as `NaN`.
- `L2Snapshot` now includes `bid_px_valid` / `ask_px_valid` masks.
- `StepResult` now exposes `events_user`, `events_synthetic`, `events_total`.
- `StepResult.events_processed` is kept as a backward-compatible alias of `events_user`.
- Config now supports partial cancel controls (`partial_cancel_prob`, `partial_min_ratio`) and intraday regime multipliers.

## Documentation Map

### User Docs

- [docs/api.md](docs/api.md)
- [docs/config-reference.md](docs/config-reference.md)
- [docs/data-contract.md](docs/data-contract.md)
- [docs/reproducibility.md](docs/reproducibility.md)

### Maintainer Docs

- [docs/architecture.md](docs/architecture.md)
- [docs/release.md](docs/release.md)
- [docs/archive/migration-v0.3.md](docs/archive/migration-v0.3.md)
- [docs/archive/migration-v0.5.md](docs/archive/migration-v0.5.md)
