Skip to content
Extraits de code Groupes Projets
Valider 1b3f6ef6 rédigé par François De Keersmaeker's avatar François De Keersmaeker
Parcourir les fichiers

Updated README

parent 522e6046
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
# pyyaml-loaders
[PyPI package page](https://pypi.org/project/pyyaml-loaders/).
PyYAML loaders with enhanced functionalities.
## Description
### `IgnoreLoader`
Ignore all constructors with tag `!`. Load YAML file as is.
### `IncludeLoader`
Tag: `!include`
Include values from other fields in the same YAML file, or from other file, while potentially replacing a subfield in the included field with a given value.
Syntax:
```yaml
!include [OTHER_FILE#]FIELD_TO_INCLUDE [SUBFIELD_TO_REPLACE:VALUE_TO_REPLACE_WITH]
```
## Installation
```bash
pip install pyyaml-loaders
```
## Usage
In preamble:
```python
from pyyaml_loaders import IncludeLoader, IgnoreLoader
```
When loading YAML file:
```python
with open(yaml_file, "r") as f:
data = yaml.load(f, IncludeLoader)
```
(or `IgnoreLoader` instead of `IncludeLoader`)
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter