Metadata-Version: 2.4
Name: pyyaml-loaders
Version: 0.2.0
Summary: PyYAML loaders with enhanced functionalities.
Author-email: François De Keersmaeker <francois.dekeersmaeker+github@proton.me>
Maintainer-email: François De Keersmaeker <francois.dekeersmaeker+github@proton.me>
License-Expression: GPL-3.0-or-later
Project-URL: Homepage, https://github.com/smart-home-network-security/pyyaml-loaders
Project-URL: Source, https://github.com/smart-home-network-security/pyyaml-loaders
Keywords: yaml,pyyaml
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
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 :: Only
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: PyYAML
Dynamic: license-file

# pyyaml-loaders

[PyPI package page](https://pypi.org/project/pyyaml-loaders/).

PyYAML loaders with enhanced functionalities.


## Description

### [`IgnoreLoader`](pyyaml_loaders/IgnoreLoader.py)

Ignore all constructors with tag `!`. Load YAML file as is.


### [`IncludeLoader`](pyyaml_loaders/IncludeLoader.py)

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`)
