Metadata-Version: 2.4
Name: nightjar
Version: 0.0.8
Summary: A typing based dispatching library.
Project-URL: Documentation, https://github.com/ysenarath/nightjar
Project-URL: Source, https://github.com/ysenarath/nightjar
Author-email: Yasas Senarath <email@example.com>
License-Expression: MIT
License-File: LICENSE
Keywords: dispatch,type-hinting,typing
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: Implementation :: CPython
Requires-Python: >=3.9
Requires-Dist: pydantic
Requires-Dist: typing-extensions>=4.13.0
Description-Content-Type: text/markdown

# Nightjar

[![PyPI version](https://badge.fury.io/py/nightjar.svg)](https://badge.fury.io/py/nightjar)
![PyPI - Downloads](https://img.shields.io/pypi/dm/nightjar)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/nightjar)
![GitHub](https://img.shields.io/github/license/ysenarath/nightjar)

Typed configuration, object construction, and predicate-based dispatch for Python.
Supports dataclasses, Pydantic models, and custom converters.

## Install

```bash
uv add nightjar
```

## Usage

```python
from pydantic import BaseModel
from nightjar import from_dict, to_dict

class Item(BaseModel):
    count: int
    enabled: bool = True

item = from_dict(Item, {"count": "4", "enabled": "false"})
assert to_dict(item) == {"count": 4, "enabled": False}
```

Use `AutoModule` or `dispatch` to construct registered implementations from
configuration. Extend conversion with `converter_registry.register_type`.

## Compatibility

- Python 3.9+: use `from __future__ import annotations` for `A | B` annotations on 3.9.
- Pydantic v1.10 and v2 are supported without an exact version pin. Conversion
  behavior follows the installed version; uv resolves a compatible release.
- Import conversion helpers from `nightjar`; `nightjar.serializers` has been removed.

Preview the documentation with `uv run --group docs mkdocs serve`.

[Documentation](docs/index.md) ·
[Issues](https://github.com/ysenarath/nightjar/issues) ·
[MIT License](LICENSE)
