etlplus.utils

etlplus.utils package.

Small shared helpers used across modules.

Functions

count_records(data)

Return a consistent record count for JSON-like data payloads.

finite_decimal_or_none(value)

Return a finite Decimal for numeric-like values.

is_integer_value(value)

Return whether value is an integer, excluding booleans.

is_number_value(value)

Return whether value is an int or float, excluding booleans.

stringify_value(value)

Normalize configuration-like values into strings.

topological_sort_named_items(items, *, ...)

Return named items in topological order.

topological_sort_names(dependencies_by_name)

Return node names in topological order.

Classes

FloatParser()

Cohesive float-oriented parsing and normalization rules.

IntParser()

Cohesive integer-oriented parsing and normalization rules.

MappingFieldParser()

Parse required fields from mapping-style payloads.

MappingParser()

Normalize optionally mapping-like inputs into concrete mapping shapes.

NamedDependencyGraph(names, edges, indegree)

Dependency graph state for name-based topological sorting.

PathParser()

Parse and classify path-like strings.

EnvironmentSecretProvider([env_map, name])

Resolve secret keys from an environment-style mapping.

LocalFileSecretProvider([env_map, name, ...])

Resolve secret keys from a local JSON/YAML mapping file.

SecretResolver([env_map, secrets_file_env_var])

Resolve additive secret tokens with an environment-first provider model.

SequenceParser()

Parse sequence-style payloads into concrete sequence types.

SubstitutionResolver([vars_map, env_map])

Resolve token substitutions across nested Python containers.

TextChoiceResolver(mapping, default[, normalize])

Resolve normalized text choices using one mapping and fallback.

TextNormalizer()

Normalize user-provided text and text-backed choices.

ValueParser()

Centralize tolerant scalar parsing rules for config-like payloads.

CoercibleStrEnum(new_class_name, /, names, *)

StrEnum with ergonomic helpers.

JsonCodec([compact, pretty, sort_keys, ...])

Centralize JSON parse, render, and print behavior.

PathHasher(file_path)

Hash one filesystem path when it exists.

RecordPayloadParser(format_name)

Validate and normalize JSON-record payloads for one data format.

TokenReferenceCollector([pattern, paths_by_name])

Collect unresolved text tokens and their stable paths in nested values.

BoundsWarningsMixin()

Append human-readable warnings without raising exceptions.

SecretProvider(*args, **kwargs)

Provider contract for resolving one secret key.