all2md.options.ini

Options for INI parsing and rendering.

This module defines configuration options for converting between INI and AST. The parser converts INI structures to readable document format, while the renderer extracts section-based data from documents back to INI format.

class all2md.options.ini.IniParserOptions

Bases: BaseParserOptions

Configuration options for INI to AST parsing.

By default the parser emits the INI as a fenced code block (literal_block). Set literal_block=False to convert INI structures into a human-readable document instead: - Sections become headings - Key-value pairs become definition lists (bullet lists with bold keys) - Comments are preserved

Parameters:
  • pretty_format_numbers (bool, default = True) – If True, format large numbers with thousand separators for readability.

  • preserve_case (bool, default = True) – If True, preserve the case of section names and keys. If False, convert to lowercase (configparser default behavior).

  • allow_no_value (bool, default = False) – If True, allow keys without values (e.g., standalone flags).

  • literal_block (bool, default = True) – If True (the default), render INI as a literal fenced code block, preserving the native syntax and comments. Set to False to convert into a structured document (headings and definition lists).

literal_block: bool = True
pretty_format_numbers: bool = True
preserve_case: bool = True
allow_no_value: bool = False
__init__(extract_metadata: bool = False, literal_block: bool = True, pretty_format_numbers: bool = True, preserve_case: bool = True, allow_no_value: bool = False) None
class all2md.options.ini.IniRendererOptions

Bases: BaseRendererOptions

Configuration options for AST to INI rendering.

The renderer extracts section-based data from markdown documents and converts it to INI format. Since INI is flat (no nesting), only top-level sections with key-value pairs are extracted.

Parameters:
  • type_inference (bool, default = True) – If True, automatically detect and convert types (numbers, booleans). If False, all values remain as strings. Note: INI format stores all values as strings, but type inference helps with readability.

  • section_from_headings (bool, default = True) – If True, use level-1 headings as section names. If False, extract from definition lists only.

  • preserve_case (bool, default = True) – If True, preserve the case of section names and keys.

  • allow_no_value (bool, default = False) – If True, allow keys without values (e.g., boolean flags set to empty).

type_inference: bool = True
section_from_headings: bool = True
preserve_case: bool = True
allow_no_value: bool = False
__init__(fail_on_resource_errors: bool = False, max_asset_size_bytes: int = 52428800, metadata_policy: MetadataRenderPolicy = <factory>, creator: str | None = 'all2md', type_inference: bool = True, section_from_headings: bool = True, preserve_case: bool = True, allow_no_value: bool = False) None