Metadata-Version: 2.4
Name: urban-json
Version: 0.2.0
Summary: Portage Python du langage JSLT (JSON Stylesheet Language Transformations) — transformation JSON vers JSON pilotée par template.
Author-email: Gael Beard <gaelgael5@gmail.com>
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/gaelgael5/Jslt
Project-URL: Repository, https://github.com/gaelgael5/Jslt
Project-URL: Documentation, https://github.com/gaelgael5/Jslt/blob/main/docs/guide.md
Project-URL: Issues, https://github.com/gaelgael5/Jslt/issues
Keywords: json,transform,template,jslt,jsonpath
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
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: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Text Processing :: Markup
Classifier: Typing :: Typed
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: antlr4-python3-runtime==4.13.2
Provides-Extra: dev
Requires-Dist: pytest>=7; extra == "dev"
Requires-Dist: ruff==0.16.8; extra == "dev"
Requires-Dist: build>=1; extra == "dev"
Dynamic: license-file

# urban-json

Portage Python du langage **JSLT — JSON Stylesheet Language Transformations** :
un langage de **transformation JSON → JSON piloté par template**, initialement
implémenté en .NET ([Black-Beard-Sdk/jslt](https://github.com/Black-Beard-Sdk/jslt)).

C'est le **paquet cœur** (moteur : parser, AST, interpréteur, JSONPath, fonctions
intégrées, extensibilité). Les capacités d'E-S (CSV, XML, SQL, HTTP, Elasticsearch)
sont des **plugins séparés** (`urban-json-csv`, `urban-json-xml`, `urban-json-db`, `urban-json-http`,
`urban-json-elastic`) découverts automatiquement.

```python
from urban_json import JsltTemplate

template = JsltTemplate.parse('{ "name": $.user.name, "year": $.user.age + 1 }')
template.transform({"user": {"name": "Alice", "age": 30}})
# -> {'name': 'Alice', 'year': 31}
```

## Installation

```bash
pip install urban-json
```

Unique dépendance d'exécution : `antlr4-python3-runtime`. Le parser généré est
embarqué (aucun outil ANTLR ni Java requis pour *utiliser* la librairie).

## Documentation

- **Guide complet avec exemples testables** :
  <https://github.com/gaelgael5/Jslt/blob/main/docs/guide.md>
  ([English](https://github.com/gaelgael5/Jslt/blob/main/docs/guide.en.md))
- **Vue d'ensemble du projet et des plugins** :
  <https://github.com/gaelgael5/Jslt>

## API

```python
from urban_json import JsltTemplate

tpl = JsltTemplate.parse(source_str)   # compile (JsltSyntaxError si invalide)
tpl.transform(document)                # applique le template à un document
tpl.debug(document)                     # trace pas-à-pas (débogage)
tpl.to_source()                        # re-sérialise l'AST (ToString)
```

Extensibilité (ajouter/isoler/découvrir des fonctions, plugins via entry points
`urban_json.functions`) : voir le guide, section Extensibilité.

## Licence

Apache-2.0 (comme le projet .NET d'origine).
