Skip to content

topmark.core.constants

topmark / core / constants

Core constants and package metadata used across TopMark.

This module collects UI-agnostic constants that are safe to import from any layer of the project, including configuration, registry, pipeline, API, CLI, and documentation tooling.

The constants cover:

  • package identity and installed metadata
  • dependency metadata extracted from package metadata
  • bundled TOML resource names
  • TopMark header and embedded TOML markers
  • registry namespace and token-validation primitives
  • standard newline definitions shared by readers, processors, and policies

Keep this module free of CLI, presentation, pipeline, and API-command imports so it remains a stable low-level dependency.

EXAMPLE_TOPMARK_TOML_PACKAGE module-attribute

EXAMPLE_TOPMARK_TOML_PACKAGE = 'topmark.toml'

Package containing the bundled example TopMark TOML document topmark-example.toml.

EXAMPLE_TOPMARK_TOML_NAME module-attribute

EXAMPLE_TOPMARK_TOML_NAME = 'topmark-example.toml'

Resource name of the bundled example TopMark TOML document.

TOPMARK_START_MARKER module-attribute

TOPMARK_START_MARKER = 'topmark:header:start'

Start marker of TopMark header.

TOPMARK_END_MARKER module-attribute

TOPMARK_END_MARKER = 'topmark:header:end'

End marker of TopMark header.

TOML_BLOCK_START module-attribute

TOML_BLOCK_START = '# === BEGIN[TOML] ==='

Start marker of rendered TopMark TOML configuration block.

TOML_BLOCK_END module-attribute

TOML_BLOCK_END = '# === END[TOML] ==='

End marker of rendered TopMark TOML configuration block.

TOPMARK_NAMESPACE module-attribute

TOPMARK_NAMESPACE = 'topmark'

Namespace identifier for TopMark-provided registry entries.

VALID_REGISTRY_TOKEN_RE module-attribute

VALID_REGISTRY_TOKEN_RE = (
    "[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*"
)

Regular expression pattern applicable to key and namespace in the registry.

Rules
  • Allowed characters: a-z, 0-9, '.', '_', '-'
  • Must start with a-z
  • Must not end with a separator ('.', '_', '-')
  • No consecutive separators
  • Must not contain ':'

STANDARD_NEWLINES module-attribute

STANDARD_NEWLINES = ('\r\n', '\n', '\r')

Supported physical newline styles, ordered longest-first for safe matching.

STANDARD_NEWLINE_SET module-attribute

STANDARD_NEWLINE_SET = frozenset(STANDARD_NEWLINES)

Set of supported physical newline styles for membership checks.

STANDARD_NEWLINE_RE module-attribute

STANDARD_NEWLINE_RE = '\\r\\n|\\n|\\r'

Regular expression pattern matching supported LF, CRLF, and CR line endings.

DependencyInfo

Bases: TypedDict

Structural metadata for a single project dependency.