Metadata-Version: 2.1
Name: genpypress
Version: 0.1.0
Summary: Set of tools and utilities connected with press code generator.
License: MIT
Author: Jan Herout
Author-email: jan.herout@gmail.com
Requires-Python: >=3.10,<3.12
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: attrs (>=22.2.0,<23.0.0)
Requires-Dist: cattrs (>=22.2.0,<23.0.0)
Description-Content-Type: text/markdown

# genpypress

This library contains several code generator helpers. It is connected to the `press` code generator.

## Usage

```python
from pathlib import Path
from genpypress import mapping

# import a file in markdown format
file = Path("TGT_ACCS_METH_RLTD_906_900_915_AMR_NIC_PCR_2_M2C.md", encoding="utf-8")
map = mapping.from_markdown(file.read_text(encoding="utf-8"))

# access table mapping property
print("Type of historization:", map.etl_historization)

# access a column mapping property (case insensitive)
print("hist_type =", map["hist_type"].transformation_rule)

# nonexisting column will - of course - blow the code up
try:
    print(map["not available"])
except KeyError as err:
    print(f"error: {err}")
```
