glom
25.12

Learning glom

  • glom Tutorial
    • Dealing with Data
    • Accessing Nested Data
      • Interactive Deep Get
    • Going Beyond Access
    • Handling Nested Lists
    • Changing Requirements
    • Data-Driven Assignment
    • True Python Native
      • Interactive Planetary Templating
    • Practical Production Use
    • Understanding the Specification
      • Interactive Contact Management
    • Conclusion
  • Frequently Asked Questions
    • What does “glom” mean?
    • Any other glom terminology worth knowing?
    • What is glom’s public API?
    • What’s a convenience function?
    • Other glom tips?
    • Why not just write more Python?
    • Should I use glom or remap?
    • How does glom work?
    • Does Python need a null-coalescing operator?
  • glom by Analogy
    • Similarity to list comprehensions
    • Similarity to templating (Jinja, Django, Mustache)
    • Similarity to SQL and GraphQL
    • Similiarity to validation (jsonschema, schema, cerberus)
    • Similarity to jq
    • Similarity to XPath/XSLT
    • Others
  • Examples & Snippets
    • Reversing a Target
    • Iteration Result as Tuple
    • Data-Driven Assignment
    • Construct Instance
    • Filtered Iteration
    • Preserve Type
    • Automatic Django ORM type handling
    • Filter Iterable
    • Lisp-style If Extension
    • Parellel Evaluation of Sub-Specs
    • Clamp Values
    • Transform Tree
    • Fix Up Strings in Parsed JSON
    • Store and Retrieve Current Target
    • Accessing Ancestry
  • glom Command-Line Interface

API Reference

  • Core glom API
    • The glom Function
      • glom()
    • Basic Specifiers
      • Path
      • Val
      • Spec
    • Object-Oriented Access and Method Calls with T
      • T
    • Defaults with Coalesce
      • Coalesce
      • SKIP
      • STOP
    • Calling Callables with Invoke
      • Invoke
        • Invoke.constants()
        • Invoke.specfunc()
        • Invoke.specs()
        • Invoke.star()
      • Alternative approach to functions: Call
        • Call
    • Self-Referential Specs
      • Ref
    • The glom Scope
      • Basic usage
      • Updating the scope - S() & A
      • Sensible saving - Vars & S.globals
        • Vars
    • Core Exceptions
      • PathAccessError
      • CoalesceError
      • UnregisteredTarget
      • BadSpec
      • GlomError
    • Setup and Registration
      • register()
      • register_op()
      • Glommer
  • Assignment & Mutation
    • Assignment
      • assign()
      • Assign
    • Deletion
      • delete()
      • Delete
    • Exceptions
      • PathAssignError
      • PathDeleteError
  • Streaming & Iteration
    • Iter
      • Iter.map()
      • Iter.filter()
      • Iter.chunked()
      • Iter.split()
      • Iter.flatten()
      • Iter.unique()
      • Iter.limit()
      • Iter.slice()
      • Iter.takewhile()
      • Iter.dropwhile()
      • Iter.all()
      • Iter.first()
  • Reduction & Grouping
    • Combining iterables with Flatten and Merge
      • flatten()
      • Flatten
      • merge()
      • Merge
      • Sum
      • Fold
    • Exceptions
      • FoldError
  • Matching & Validation
    • Validation with Match
      • Match
        • Match.matches()
        • Match.verify()
    • Optional and required dict key matching
      • Optional
      • Required
    • M Expressions
      • M
    • Boolean operators and matching
      • Or
      • And
      • Not
    • String matching
      • Regex
    • Control flow with Switch
      • Switch
    • Exceptions
      • MatchError
      • TypeMatchError
    • Validation with Check
      • Check
      • CheckError
  • Exceptions & Debugging
    • Exceptions
    • Reading a glom Exception
    • Reading Branched Exceptions
    • Debugging
      • Inspect

Extending glom

  • Writing a custom Specifier Type
    • When to write a Specifier Type
    • Building your Specifier Type
    • The glom Scope
    • Specifiers by example
    • Summing up
  • glom Modes
    • Writing custom Modes
glom
  • Search


© Copyright 2025, Mahmoud Hashemi.

Built with Sphinx using a theme provided by Read the Docs.