Metadata-Version: 2.4
Name: urban-json-files
Version: 0.1.0
Summary: Plugin urban-json : fichiers JSON (loadjson, iteratejsonfile) et chemins (concatpath).
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
Keywords: json,transform,template,jslt,files,plugin
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: urban-json>=0.2.0
Dynamic: license-file

# urban-json-files

Plugin [urban-json](https://github.com/gaelgael5/Jslt) : **fichiers JSON et chemins**
dans les templates (port des fonctions .NET `loadjson`, `IterateJsonFile`, `concatpath`).

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

| Fonction | Rôle |
|---|---|
| `loadjson(chemin)` | Contenu d'un fichier JSON (`null` si le fichier n'existe pas). |
| `iteratejsonfile(chemin, "$.chemin")` | Éléments d'un fichier JSON sélectionnés par un JSONPath (compilé ou en chaîne). |
| `concatpath(["dossier", "fichier.json"])` | Chemin de fichier assemblé (`null` ignorés ; un segment absolu repart de la racine). |

```python
from urban_json import JsltTemplate

tpl = JsltTemplate.parse('{ "ids": iteratejsonfile("data.json", "$.items[*].id") }')
tpl.transform({})
```

Les chemins relatifs le sont au répertoire courant. Ces fonctions lisent le disque :
elles ne sont pas disponibles dans le playground (bac à sable du cœur).
