Glom

Latest version: v24.11.0

Safety actively analyzes 681844 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 4

22.1.0

_(January 24, 2022)_

Adds optional `*` and `**` expansion to the default glom access (i.e.,
`glom.glom('a.b.*')` will get all items under `b` as a list). `**` is
similar, except recursive.

This functionality is off by default in this version, as it
technically would break code using `'*'` and `'**'` as plain
keys. Note that this behavior will break in the next couple months,
and an in-library warning has been added to this effect.

Set `glom.core.PATH_STAR = True` to enable the new feature and take it
for a spin!

20.11.0

_(November 3, 2020)_

- The `T` object now supports arithmetic operators!
- A few internal performance improvements around chainmap, scope, and string path eval.

20.8.0

---

_(August 11, 2020)_

A few cleanups from the big release:

- PathAccessError paths are now Path objects again (fixes [185][i185])
- Fix an intermittent infinite recursion due to a suspected bug in
abc, and a bad interaction between ChainMap and weakref. (fixes [189][i189])
- Adjust face requirement version to be more strictly up-to-date ([188][i188])
- Soft launch the Pipe() spec, which is just a more explicit version
of the default tuple behavior. ([191][i191])

Huge thanks to all reporters and committers!

[i185]: https://github.com/mahmoud/glom/issues/185
[i188]: https://github.com/mahmoud/glom/issues/188
[i189]: https://github.com/mahmoud/glom/issues/189
[i191]: https://github.com/mahmoud/glom/issues/191

20.7.0

_(July 31, 2020)_

glom releases don't come bigger than this.

- [Match mode][matching] - Data validation and pattern matching. You're
going to have to read the docs to believe it.
- Complete documenation refactor
- [API][core_api] now split into domains ([Mutation][mutation], [Streaming][streaming], [Grouping][grouping], [Matching][matching])
- New [debugging and exception guide][debugging]
- New advanced glom intro: [glom Modes][modes]
- Traceback simplification and _Target-spec trace_
- glom no longer displays glom-internal stack frames, which were not
useful for developers debugging specs and data.
- Instead, the exception message displays summarized intermediate
targets and specs, to help drill down to the part of the data or
spec which raised the error.
- To restore previous behavior, or if you need to see internal stack
frames, pass `glom_debug=True` to the top-level `glom()` call, or
set the `GLOM_DEBUG` env var to `1`.
- For more details see the [debugging guide][debugging].
- [Scope][scope] updates
- [`S()` and `A`][scope_assign] (replaces the previously soft-launched `Let()`)
- [Vars()][vars]: Non-local scopes
- `T.__()` method for accessing dunder attributes (see applicable note under [T][T])
- `glom.__version__` - importable version attribute

[matching]: https://glom.readthedocs.io/en/latest/matching.html
[grouping]: https://glom.readthedocs.io/en/latest/grouping.html
[streaming]: https://glom.readthedocs.io/en/latest/streaming.html
[mutation]: https://glom.readthedocs.io/en/latest/mutation.html
[scope]: https://glom.readthedocs.io/en/latest/api.html#the-glom-scope
[scope_assign]: https://glom.readthedocs.io/en/latest/api.html#updating-the-scope-s-a
[vars]: https://glom.readthedocs.io/en/latest/api.html#sensible-saving-vars-s-globals
[core_api]: https://glom.readthedocs.io/en/latest/api.html
[debugging]: https://glom.readthedocs.io/en/latest/debugging.html
[T]: https://glom.readthedocs.io/en/latest/api.html#glom.T
[modes]: https://glom.readthedocs.io/en/latest/modes.html

20.5.0

_(May 2, 2020)_

- Added [delete() and Delete()][delete], for deletion of keys and attributes
- Added [Ref()][ref_spec] specifier type for recursive specs
- Added [Group()][group_spec] for structural grouping, like a souped-up [bucketize][boltons_bucketize]
- Some repr improvements
- CLI and testing upgrades

[delete]: https://glom.readthedocs.io/en/latest/mutation.html#deletion
[ref_spec]: https://glom.readthedocs.io/en/latest/api.html#glom.Ref
[group_spec]: https://glom.readthedocs.io/en/latest/grouping.html#glom.Group
[boltons_bucketize]: https://boltons.readthedocs.io/en/latest/iterutils.html#boltons.iterutils.bucketize

19.10.0

_(October 29, 2019)_

- Add streaming support via [Iter][iter] ([100][i100])
- Add better callable handling with [Invoke][invoke] ([101][i101])
- Add Fill ([110][i110]) - Also adds Auto for the default mode. (soft-launch, docs TBA)
- Add Let for variable capture ([108][i108]) (soft-launch, docs TBA)
- Steps in the tuple now nest scopes ([97][i97])
- All public specifier types now have reasonable reprs (notably, Coalesce, Check, and Assign)

[iter]: https://glom.readthedocs.io/en/latest/streaming.html#glom.Iter
[invoke]: https://glom.readthedocs.io/en/latest/api.html#glom.Invoke
[i97]: https://github.com/mahmoud/glom/issues/97
[i100]: https://github.com/mahmoud/glom/issues/100
[i101]: https://github.com/mahmoud/glom/issues/101
[i108]: https://github.com/mahmoud/glom/issues/108
[i110]: https://github.com/mahmoud/glom/issues/110

19.2.0

_(February 17, 2019)_

Add [`Merge()` spec and `merge()` convenience
function](https://glom.readthedocs.io/en/latest/grouping.html#glom.merge).
for turning iterables of mappings into a single mapping.

Additionally, `T` and `Spec()` instances which appear in the "key"
portion of the default dict/mapping spec, are now evaluated, enabling
operations [like this](https://github.com/mahmoud/glom/issues/85),
which demonstrates both new features:

python

from glom import glom, T, Merge

target = [{"id": 1, "name": "foo"}, {"id": 2, "name": "bar"}]
spec = Merge([{T["id"]: T["name"]}])

glom(target, spec)
{1: 'foo', 2: 'bar'}

Page 2 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.