topmark.toml.loaders¶
Load and split-parse TopMark TOML documents.
This module provides low-level file I/O helpers for reading TOML documents from the filesystem, normalizing them to plain-Python TOML tables, and turning one TopMark TOML source into a per-source split parse result.
Responsibilities
- read raw TOML documents from disk
- normalize
tomlkitoutput intoTomlTable - extract
[tool.topmark]frompyproject.tomlsources when needed - delegate per-source split parsing to
parse_topmark_toml_table
This module does not deserialize layered config into
MutableConfig and does not resolve
precedence across multiple sources.
load_topmark_toml_table ¶
Validate and split-parse an in-memory TopMark TOML source table.
Validates whether data complies with the expected TopMark TOML document schema,
and split-parses data subsequently.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
TomlTable
|
In-memory TOML table representing either a full TopMark TOML
document or a parsed |
required |
source_path
|
Path | None
|
Optional source path used only for diagnostics/logging. |
None
|
from_pyproject
|
bool
|
If |
False
|
Returns:
| Type | Description |
|---|---|
ParsedTopmarkToml | None
|
The per-source split parse result, or |
ParsedTopmarkToml | None
|
and no valid |
Source code in src/topmark/toml/loaders.py
load_topmark_toml_source ¶
Load and split-parse one TopMark TOML source file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path
|
Path to a TopMark TOML source file. |
required |
Returns:
| Type | Description |
|---|---|
ParsedTopmarkToml | None
|
The per-source split parse result, or |
ParsedTopmarkToml | None
|
loaded or does not contain a valid TopMark TOML source table. |