Metadata-Version: 2.4
Name: pudding
Version: 1.1.0
Summary: Pudding converts text to a structured format, such as XML, JSON or YAML.
Author-email: Moritz Hille <moritz.hekxsler@gmail.com>
License-Expression: GPL-3.0-only
Project-URL: Homepage, https://github.com/Hekxsler/pudding
Project-URL: Issues, https://github.com/Hekxsler/pudding/issues
Keywords: parser,converter,text,xml,yaml,json
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: File Formats
Classifier: Topic :: Text Processing
Classifier: Topic :: Utilities
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: argparse
Requires-Dist: lxml
Requires-Dist: pyyaml
Dynamic: license-file

# Pudding
[![Coverage Status](https://coveralls.io/repos/github/Hekxsler/pudding/badge.svg?branch=master)](https://coveralls.io/github/Hekxsler/pudding?branch=master)
[![Documentation Status](https://readthedocs.org/projects/pudding/badge/?version=latest)](https://pudding.readthedocs.io/latest/?badge=latest)

Pudding converts text files into structured formats such as XML, JSON, or YAML. The syntax and parsing rules are defined using a custom DSL in `.pud` files.

The idea is based on [Gelatin](https://github.com/knipknap/Gelatin).

## Features
- Convert text to XML, JSON, and YAML
- Custom grammar and rule definitions (`.pud` files)
- Modular and extensible design
- Supports complex parsing and output operations

## Usage

### CLI
```bash
pudding -s <SYNTAX> -f <FORMAT> <INPUT>
```
- `<SYNTAX>`: Path to the syntax file
- `<FORMAT>`: "xml", "json", or "yaml"
- `<INPUT>`: File to convert

### Python 
Import convert_file, convert_files or convert_string:
```python
from pudding import convert_file, convert_files, convert_string
```
Or directly import the Compiler, Context and Processor classes and create your own functions, statements or Writer.


## Example

See files in tests/data folder.
