glom is pure Python, and you don’t need to know anything but
Python to use it effectively.

Still, most everyone who encounters glom for the first time finds
analogies to tools they already know. Whether SQL, list
comprehensions, or HTML templates, there seems to be no end to the
similarities. Many of them intentional!

While glom is none of those tools, and none of those tools are glom, a
little comparison doesn’t hurt. This document collects analogies to
help guide understanding along.

One of the key inspirations for glom was the humble list
comprehension, one of my favorite Python features.

List comprehensions make your code look like its output, and that goes
a long way in readability. glom itself does list processing with
[lambdax:x%2], which actually makes it more like a list comp
and the old filter() function.

glom’s list processing differs in two ways:

Required use of a callable or other glom spec, to enable deferred processing.

In some ways, glom is a Python query language for Python
objects. But thanks to its restructuring capabilities, it’s much more
than SQL or GraphQL.

With SQL the primary abstraction is an table, or table-like
resultset. With GraphQL, the analogous answer to this is, of course,
the graph.

glom goes further, not only offering the Python object tree as a
graph, but also allowing you to change the shape of the data,
restructuring it while fetching and transforming values, which GraphQL
only minimally supports, and SQL barely supports at all. Table targets
get you table outputs.

glom is a generalized form of intake libraries, and will have
explicit validation support soon. We definitely took schema
becoming successful as a sign that others shared our appetite for
succinct, declarative Python datastructure manipulation.

More importantly, these libraries seem to excel at structuring and
parsing data, and don’t solve much on the other end. Translating
valid, structured objects like database models to JSON serializable
objects is glom’s forté.

These hallowed technologies of yore, they were way ahead of the game
in many ways. glom intentionally avoids their purity and verbosity,
while trying to take as much inspiration as possible from their
function.