API Reference: Data Models
The core logic of envars is built around a set of simple, Pydantic-like data models that represent the different components of your configuration.
This section of the documentation is best generated automatically from the source code's docstrings. To do this, you can use a tool like mkdocstrings.
Recommended Setup
-
Install
mkdocstrings:bash pip install mkdocstrings mkdocstrings-python -
Configure
mkdocs.yml: Add themkdocstringsplugin to yourmkdocs.ymlfile.```yaml
In mkdocs.yml
plugins: - search - mkdocstrings: handlers: python: options: show_root_heading: yes ```
-
Add Auto-Generated Content: You can then replace the content of this file with the following to automatically pull in the documentation for your models:
```markdown
Data Models
::: envars.models.Variable
::: envars.models.Environment
::: envars.models.Location
::: envars.models.VariableValue
::: envars.models.VariableManager ```
This setup will read the docstrings from your Python classes in src/envars/models.py and render them as clean, readable documentation whenever you build your site with mkdocs build.