Metadata-Version: 2.5
Name: py-reg-map
Version: 0.2.0
Summary: Register map generator for embedded firmware (C storage, LeBin and Modbus RTU JSON)
Project-URL: Homepage, https://github.com/LogicElements/py-reg-map
Project-URL: Documentation, https://github.com/LogicElements/py-reg-map/blob/main/doc/index.md
Project-URL: Issues, https://github.com/LogicElements/py-reg-map/issues
Author: Logic Elements s.r.o
License-Expression: MIT
License-File: LICENSE
Keywords: code generator,embedded,firmware,modbus,register map,yaml
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Code Generators
Classifier: Topic :: Software Development :: Embedded Systems
Requires-Python: >=3.12
Requires-Dist: pydantic>=2.6
Requires-Dist: pyyaml>=6
Provides-Extra: dev
Requires-Dist: openpyxl>=3.1; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Requires-Dist: ruff>=0.6; extra == 'dev'
Provides-Extra: xlsx
Requires-Dist: openpyxl>=3.1; extra == 'xlsx'
Description-Content-Type: text/markdown

# py-reg-map

[![PyPI](https://img.shields.io/pypi/v/py-reg-map)](https://pypi.org/project/py-reg-map/)
[![Python](https://img.shields.io/pypi/pyversions/py-reg-map)](https://pypi.org/project/py-reg-map/)
[![CI](https://github.com/LogicElements/py-reg-map/actions/workflows/ci.yml/badge.svg)](https://github.com/LogicElements/py-reg-map/actions/workflows/ci.yml)
[![License: MIT](https://img.shields.io/pypi/l/py-reg-map)](LICENSE)

Register map generator for embedded firmware. A YAML file describes the device registers;
`regmap` generates the C storage and Modbus RTU sources for the firmware (`reg_map.h/.c`,
`mb_rtu_app.h/.c`) and the JSON definitions for the LeBin and Modbus RTU communication
software.

## Installation

Python 3.12 or newer. Install from [PyPI](https://pypi.org/project/py-reg-map/):

```sh
pip install py-reg-map
pip install "py-reg-map[xlsx]"   # with Excel import
```

The latest development version comes straight from GitHub:

```sh
pip install "py-reg-map @ git+https://github.com/LogicElements/py-reg-map"
```

## Usage

Start a new register map:

```sh
regmap init MyDevice                              # -> mydevice.yaml
```

Migrate an existing Excel register map (once):

```sh
regmap import-xlsx Documents/Vms1511.xlsm        # -> Documents/vms1511.yaml
```

Generate all outputs after editing the map, then commit them:

```sh
regmap generate Documents/vms1511.yaml
regmap generate Documents/vms1511.yaml --check              # CI: are the committed outputs current?
regmap generate Documents/vms1511.yaml --allow-id-change    # accept intended ID/Modbus changes
```

Add the firmware communication library (LeBin, Modbus RTU slave) to the firmware project:

```sh
regmap export-lib Core/RegMap
```

Editor completion for the YAML format:

```sh
regmap schema -o Documents/regmap.schema.json
```

## Documentation

Start at [doc/index.md](doc/index.md): [YAML format](doc/yaml-format.md),
[command line](doc/cli.md), [outputs](doc/outputs.md), [firmware library](doc/firmware-lib.md) and
[development guide](doc/development.md).

## License

[MIT](LICENSE) © 2026 Logic Elements s.r.o
