Metadata-Version: 2.4
Name: xnano-core
Version: 2.0.0b2
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Rust
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: MacOS
Classifier: Typing :: Typed
Requires-Dist: markdown-it-py>=3.0.0
Requires-Dist: pydantic-core>=2.0.0
Requires-Dist: pygments>=2.17.0
Requires-Dist: typing-extensions>=4.12.0 ; python_full_version < '3.13'
Requires-Dist: xnano-audio ; extra == 'all'
Requires-Dist: xnano-image ; extra == 'all'
Requires-Dist: xnano-audio ; extra == 'audio'
Requires-Dist: xnano-image ; extra == 'image'
Provides-Extra: all
Provides-Extra: audio
Provides-Extra: image
License-File: LICENSE
Summary: The xnano terminal runtime: buffers, state, input, layout and effects on top of ratatui.
Home-Page: https://github.com/hsaeed3/xnano
Author-email: Hammad Saeed <hammad@supportvectors.com>
License-Expression: MIT
Requires-Python: >=3.10
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Documentation, https://xnano.dev
Project-URL: Homepage, https://github.com/hsaeed3/xnano
Project-URL: Source, https://github.com/hsaeed3/xnano

# xnano-core

The compiled Rust engine for building terminal interfaces: buffers, widgets, layout, effects, state management, and a live runtime.

## Install

```bash
pip install xnano-core
```

Most people install the top-level `xnano` package instead, which adds the terminal API (`xnano.open()`, placements, hooks, scenes and sound) on top of this engine:

```bash
pip install xnano
```

For v1 of xnano (a different API), install `xnano>=1.2.3,<2`.

## Example

```python
from xnano_core import Point, Size, Style, Color, Clock

# Basic geometry
point = Point(2, 3) + Point(1, 1)
assert (point.x, point.y) == (3, 4)

# Styles combine colors and text attributes
style = Style('red', 'black', bold=True)
assert 'bold' in style.modifiers

# Clocks can be real or manually advanced for testing
clock = Clock.manual(elapsed_seconds=2.0)
assert clock.elapsed_milliseconds == 2000.0
```

## What it provides

- **Cell buffers**: mutable 2D arrays of terminal cells with styles, colors and text attributes
- **Widgets**: built-in composable pieces like blocks, tables, gauges, charts, calendars and text editors
- **Operations**: animations, effects, transitions, and state mutations on the fly
- **Expression language**: scalar expressions that react to state changes and user input
- **Input**: keyboard and mouse events with key bindings and focus management
- **State management**: declarative state schema with validation, patches, and observations
- **Runtime**: offscreen and live terminal execution with event loops and frame timing

## Links

- **Repository**: https://github.com/hsaeed3/xnano
- **Documentation**: https://xnano.hammad.app
- **API reference**: https://xnano.hammad.app/api-reference/
- **License**: MIT

