comparison doc/introduction.rst @ 195:28e6c1413947

Added support for TOML style configuration files
author Franz Glasner <fzglas.hg@dom66.de>
date Fri, 03 May 2019 21:51:09 +0200
parents 0d8dd58afc44
children c6904d02beae
comparison
equal deleted inserted replaced
194:0d8dd58afc44 195:28e6c1413947
11 The configurations can be read from different types of files: 11 The configurations can be read from different types of files:
12 12
13 - :ref:`YAML files <yaml-files>` 13 - :ref:`YAML files <yaml-files>`
14 - :ref:`JSON files <json-files>` 14 - :ref:`JSON files <json-files>`
15 - :ref:`INI files <ini-files>` 15 - :ref:`INI files <ini-files>`
16 - :ref:`TOML files <toml-files>`
16 - :ref:`executable Python scripts <executable-python-scripts>` 17 - :ref:`executable Python scripts <executable-python-scripts>`
17 18
18 19
19 .. _yaml-files: 20 .. _yaml-files:
20 21
100 As can be seen in this example -- INI file internal value interpolation 101 As can be seen in this example -- INI file internal value interpolation
101 is done as in Python's standard :mod:`configparser` module. 102 is done as in Python's standard :mod:`configparser` module.
102 103
103 This example also illustrates how INI sections are used to build a 104 This example also illustrates how INI sections are used to build a
104 tree-ish configuration dictionary. 105 tree-ish configuration dictionary.
106
107
108 .. _toml-files:
109
110 TOML Files
111 ----------
112
113 Read the TOML file with the help of the pure Python `uiri/toml` package.
114
115 All TOML features map seamingless to "ConfigMix".
116
117 The example TOML style configuration below yields an equivalent
118 configuration to the YAML configuration above:
119
120
121 .. literalinclude:: ../tests/data/conf10.toml
122 :language: ini
105 123
106 124
107 .. _executable-python-scripts: 125 .. _executable-python-scripts:
108 126
109 Executable Python Scripts 127 Executable Python Scripts
167 for JSON configuration files 185 for JSON configuration files
168 186
169 ``.py`` 187 ``.py``
170 for Python configuration files 188 for Python configuration files
171 189
190 ``.toml``
191 for TOML configuration file
192
172 ``.yml`` or ``.yaml`` 193 ``.yml`` or ``.yaml``
173 for YAML configuration files 194 for YAML configuration files
174 195
175 196
176 .. _getting-values: 197 .. _getting-values: