2025-10-26 13:29:29 +01:00
`Rougail` 's library description
=================================
Rougail is a configuration management library that allows you to load variables in a simple and convenient way.
In the following examples, we will use a specific configuration of Rougail.
2025-10-29 17:18:55 +01:00
.. FIXME: You will find all the configuration options in doc:`configuration`
find a document with all the configuration options
2025-10-26 13:29:29 +01:00
To load the configuration you must import the `RougailConfig` class and set the `main_structural_directories` values:
.. code-block :: python
from rougail import RougailConfig
RougailConfig['main_structural_directories'] = ['dict']
Let's convert a our first structural file
-----------------------------------------
2025-11-22 11:11:45 +01:00
As a reminder, a :term: `structure file` is a set of instructions that will allow us to create :term: `families <family>` and :term: `variables <variable>` .
2025-10-26 13:29:29 +01:00
Let's start by creating a simple structure file.
Here is a first :file: `dict/00-base.yml` structure file:
.. code-block :: yaml
%YAML 1.2
---
version: 1.1
my_variable: my_value # my variable
...
Then, let's create the :term: `Tiramisu` objects via the following script:
.. code-block :: python
:caption: the `script.py` file content
from rougail import Rougail, RougailConfig
RougailConfig['main_structural_directories'] = ['dict']
rougail = Rougail()
config = rougail.run()
print(config.value.get())
.. demo :: Let's execute `script.py` :
.. code-block :: bash
$ python3 script.py
{'rougail.my_variable': 'my_value'}
The operator role
--------------------
The :term: `operator` role corresponds to the :term: `tiramisu` settings:
2025-10-27 18:22:40 +01:00
.. image :: ../images/tiramisu_get_set.png
2025-10-26 13:29:29 +01:00
.. index :: questionary
But instead of coding in the end user developer way, the opterator will prefer using the Rougail CLI interface:
2025-10-27 18:22:40 +01:00
.. image :: ../images/QuestionaryChoice.png
2025-10-26 13:29:29 +01:00
The Rougail CLI can output a rather complete view of the dataset:
2025-10-27 18:22:40 +01:00
.. image :: ../images/UserDataOutput.png
2025-10-26 13:29:29 +01:00
.. toctree ::
:titlesonly:
:caption: Use library
2025-10-26 22:21:21 +01:00
user_datas
output
2025-10-26 13:29:29 +01:00
parse
2025-10-26 14:31:48 +01:00
tags
2025-10-26 13:29:29 +01:00
rougailconfig_load_from_cli
extra
custom_function
own_type
upgrade