Skip to content

PyJolt v1.0.0

Choose a tag to compare

@github-actions github-actions released this 10 Apr 06:24
· 10 commits to main since this release
ee6b8b2

1.0.0 — 2024-04-10

Added

Core transforms (full Java JOLT parity)

  • Shift — re-map fields with full spec language support:

    • Literal key matching
    • Wildcard * matching (prefix/suffix combinable, e.g. prefix_*_suffix)
    • OR patterns (a|b)
    • Self-reference @ — uses the current input node as its own value
    • $ / $N — emits the matched key name N levels up as a value
    • #literal — emits a constant string as a value
    • Output path tokens: &/&N back-references, &(N,M) capture groups,
      @(N,path) value lookups, [] array-append
    • Array-of-objects slot coordination — multiple fields from the same wildcard
      iteration land in the same output list element
    • Multiple output paths (list of strings)
  • Default — fill absent or null fields; wildcard * applies to every key;
    list-aware ({"key": {"*": sub_spec}} applies sub_spec to each list element)

  • Remove — delete specified fields; "*" removes all keys at a level

  • Sort — recursively sort all dict keys alphabetically

  • Cardinality — enforce ONE (scalar) or MANY (list) cardinality

  • ModifyOverwrite / ModifyDefault — apply functions or literal values to
    fields; 39 built-in functions covering type conversions, string manipulation,
    numeric operations, and collection utilities:
    toInteger, toLong, toDouble, toFloat, toString, toBoolean,
    trim, toUpperCase, toLowerCase, abs, min, max, intSum,
    doubleSum, longSum, floatSum, sum, avg, sqrt, not,
    size, concat, join, split, leftPad, rightPad, substring,
    startsWith, endsWith, contains, squashNulls, recursivelySquashNulls,
    toList, firstElement, lastElement, elementAt, indexOf, coalesce,
    noop

  • Chainr — chain multiple transforms sequentially; supports both direct
    instantiation and JOLT-spec lists (from_spec)

Packaging

  • PEP 561 py.typed marker — full inline type annotations
  • pyproject.toml with hatchling build backend, classifiers, URLs
  • Python 3.10–3.13 support

Tests

  • 193 tests across all transforms and real-world integration scenarios