Metadata-Version: 2.4
Name: jsonfold-template
Version: 0.4.2
Summary: Python implementation of the JSONFold Template Language (JFTL)
License: MIT License
        
        Copyright (c) 2026 JSONFold
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: simpleeval<2,>=1.0.7
Dynamic: license-file

# JFTL — JSONFold Template Language

<!-- LTeX: dictionary+=JSONata dictionary+=foreach dictionary+=py dictionary+=jq dictionary+=versionable dictionary+=awk dictionary+=JMESPath -->
<!-- cspell:words simpleeval JSONata versionable pyeval -->

JFTL is a JSON-based language for transforming and generating JSON.

JFTL templates are themselves valid JSON. They combine JSON navigation, iteration,
conditional logic, variables, transformations, and expression evaluation while
keeping the template structure close to the JSON being produced.

## Installation

Install the Python implementation from PyPI:

```bash
pip install jsonfold-template
```

## Command Line

The Python implementation installs the `jftl-pyrun` command:

```bash
jftl-pyrun template.json
```

Use:

```bash
jftl-pyrun --help
```

for the complete set of command-line options.

## Python API

The public Python API is available through `jsonfold.template`:

```python
from jsonfold.template import create_engine

engine = create_engine()
```

## Example

A simple JFTL transformation:

```json
{
  "$": true,
  "data": "$_datasets.input",
  "out": {
    "name": "$.name",
    "price": "$py=_['price'] * 2"
  }
}
```

JFTL supports navigation, iteration, filtering, conditional output, datasets,
variables, transformations, multiple expression engines, and other JSON
transformation operations.

## Documentation

Full language documentation, reference material, and cookbook examples are
available on the JFTL documentation site.

## Implementations

JFTL is a language rather than a single implementation.

This package contains the Python implementation. Other implementations may
provide different execution engines, integrations, performance characteristics,
or additional capabilities while implementing the JFTL language.

## License

The Python implementation of JFTL is released under the MIT License.

See [LICENSE](LICENSE) for details.
