Metadata-Version: 2.4
Name: cuifw_c
Version: 1.7.0
Summary: C extension for CuiFW (Console User Interface FrameWork)
Home-page: 
Author: Suleiman
Author-email: 
License: MIT
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: C
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: User Interfaces
Classifier: Topic :: Terminals
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: author
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: license
Dynamic: license-file
Dynamic: requires-python
Dynamic: summary

# cuifw_c

C extension for CuiFW — Console User Interface FrameWork.

This package contains the C core used by CuiFW: UTF-8 terminal setup,
ANSI helpers, canvas primitives, keyboard and mouse input, and process
management. If the extension is not built, Python falls back to the pure
Python implementation.

## Features

- UTF-8 enforcement on Windows and POSIX
- ANSI-aware length and truncation
- Raw keyboard input (termios / msvcrt)
- SGR mouse parsing
- Canvas primitives
- Process management
- Zero external dependencies
- Portable: Linux, macOS, Windows, Termux

## Installation

From source:

    pip install .

From sdist:

    pip install dist/cuifw_c-1.0.0.tar.gz

Development mode:

    pip install -e .

## Building

sdist only:

    python -m build --sdist

sdist + wheel:

    python -m build

Result:

    dist/
    ├── cuifw_c-1.0.0.tar.gz
    └── cuifw_c-1.0.0-cp311-cp311-linux_x86_64.whl

## Requirements

- Python >= 3.7
- C compiler (gcc / clang / MSVC)
- Optional: build (pip install build)

## Usage

    import cuifw_c

    cuifw_c.setup_utf8()

    text = "\033[31mhello\033[0m"
    print(cuifw_c.visible_len(text))

    canvas = cuifw_c.Canvas(80, 24)
    canvas.set(5, 5, ord("*"))
    canvas.rect(0, 0, 10, 10)
    print(canvas.render())

Exact API depends on the C module implementation. See cuifw_c/cuifw_c.c
for exported symbols.

## Project layout

    cuifw_c_project/
    ├── setup.py
    ├── pyproject.toml
    ├── MANIFEST.in
    ├── README.md
    ├── LICENSE
    └── cuifw_c/
        ├── __init__.py
        └── cuifw_c.c

## Compatibility

Platforms: Linux, macOS, Windows, Termux.

Python: 3.7, 3.8, 3.9, 3.10, 3.11, 3.12.

## Development

    python setup.py build_ext --inplace

## License

MIT — see LICENSE.

## Author

Suleiman

## Changelog

### 1.7.0

- Initial release
- UTF-8 setup
- ANSI helpers
- Canvas primitives
- Process management
- Keyboard and mouse input
