Metadata-Version: 2.4
Name: disco-tools
Version: 0.1.7
Summary: Common tools for disco simulation engine.
Author: Michiel Jansen
License: Apache-2.0
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Operating System :: OS Independent
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICE
Requires-Dist: numpy~=2.3
Requires-Dist: PyYAML>=6.0
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == "dev"
Requires-Dist: pytest-cov>=5; extra == "dev"
Requires-Dist: mypy>=1.10; extra == "dev"
Requires-Dist: twine>=5; extra == "dev"
Requires-Dist: types-pyyaml>=6.0; extra == "dev"
Dynamic: license-file

# 🧾 disco-tools

**Common tools for disco simulation engine.**  

[![PyPI](https://img.shields.io/pypi/v/disco-tools.svg)](https://pypi.org/project/disco-tools/)
[![License: Apache-2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
[![Build](https://github.com/michielmj/disco-tools/actions/workflows/build.yml/badge.svg)](https://github.com/michielmj/disco-tools/actions)
[![Tests](https://github.com/michielmj/disco-tools/actions/workflows/test.yml/badge.svg)](https://github.com/michielmj/disco-tools/actions)

---

## 🧭 Overview

`disco-tools` is a collection of reusable Python utilities supporting simulation, analytics, and data-driven decision systems.  
It provides modular building blocks for working with metadata, scheduling, simulation orchestration, and system integration.

Each tool is designed to be:
- **Lightweight** — minimal dependencies
- **Composable** — works as a standalone library or inside larger systems
- **Fast** — optimized for high-throughput, data-heavy environments

Documentation for individual modules is available in the [`docs/`](docs) folder.

---

## ✨ Features

- ⚙️ **Label Selector** — Fast rule engine for qualifying and filtering metadata.  
  → [Read documentation ›](docs/label_selector.md)

- ⚙️ **Multi-Process Logging** — Safe, queue-based logging across worker processes using Python's
  `QueueHandler` + `QueueListener`.  
  → [Read documentation ›](docs/mp_logging.md)

- 🪤 **errsnap** — Capture full post-mortem exception snapshots — including arbitrary runtime
  state — to a self-contained `.errsnap` file for offline inspection.  
  → [Read documentation ›](docs/errsnap.md)

---

## 🚀 Installation

```bash
pip install disco-tools
```

---

## 🧰 Development Setup

Clone and install in editable mode:

```bash
git clone https://github.com/michielmj/disco-tools.git
cd disco-tools
pip install -e .[dev]
```

Run all tests:

```bash
pytest -q
```

---

## 📚 Documentation

- [Label Selector](docs/label_selector.md) — fast, composable rule engine for key–value metadata
- [Multi-Process Logging](docs/mp_logging.md) — process-safe logging via queue-based architecture
- [errsnap](docs/errsnap.md) — post-mortem exception snapshots with state capture

Additional module docs will be added under the [`docs/`](docs) directory as the toolkit evolves.

---

## 🧪 Example Usage

```python
from disco_tools.label_selector import Label, qualifies

rule = (Label("env") == "prod") + Label("version").gte(10)
meta = {"env": "prod", "version": 12}

if qualifies(meta, rule):
    print("Match!")
```

---

## 🧾 License

Apache 2.0 License © 2025 — part of the **disco-tools** project.
