dotted-notation 0.44.9__tar.gz → 0.44.11__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. {dotted_notation-0.44.9 → dotted_notation-0.44.11}/CHANGELOG.md +40 -0
  2. {dotted_notation-0.44.9/dotted_notation.egg-info → dotted_notation-0.44.11}/PKG-INFO +7 -1
  3. {dotted_notation-0.44.9 → dotted_notation-0.44.11}/README.md +6 -0
  4. {dotted_notation-0.44.9 → dotted_notation-0.44.11}/dotted/api.py +20 -2
  5. {dotted_notation-0.44.9 → dotted_notation-0.44.11}/dotted/engine.py +4 -2
  6. {dotted_notation-0.44.9 → dotted_notation-0.44.11/dotted_notation.egg-info}/PKG-INFO +7 -1
  7. {dotted_notation-0.44.9 → dotted_notation-0.44.11}/pyproject.toml +1 -1
  8. {dotted_notation-0.44.9 → dotted_notation-0.44.11}/LICENSE +0 -0
  9. {dotted_notation-0.44.9 → dotted_notation-0.44.11}/MANIFEST.in +0 -0
  10. {dotted_notation-0.44.9 → dotted_notation-0.44.11}/dotted/__init__.py +0 -0
  11. {dotted_notation-0.44.9 → dotted_notation-0.44.11}/dotted/__main__.py +0 -0
  12. {dotted_notation-0.44.9 → dotted_notation-0.44.11}/dotted/access.py +0 -0
  13. {dotted_notation-0.44.9 → dotted_notation-0.44.11}/dotted/base.py +0 -0
  14. {dotted_notation-0.44.9 → dotted_notation-0.44.11}/dotted/cli/__init__.py +0 -0
  15. {dotted_notation-0.44.9 → dotted_notation-0.44.11}/dotted/cli/_compat.py +0 -0
  16. {dotted_notation-0.44.9 → dotted_notation-0.44.11}/dotted/cli/formats.py +0 -0
  17. {dotted_notation-0.44.9 → dotted_notation-0.44.11}/dotted/cli/main.py +0 -0
  18. {dotted_notation-0.44.9 → dotted_notation-0.44.11}/dotted/containers.py +0 -0
  19. {dotted_notation-0.44.9 → dotted_notation-0.44.11}/dotted/filters.py +0 -0
  20. {dotted_notation-0.44.9 → dotted_notation-0.44.11}/dotted/grammar.py +0 -0
  21. {dotted_notation-0.44.9 → dotted_notation-0.44.11}/dotted/groups.py +0 -0
  22. {dotted_notation-0.44.9 → dotted_notation-0.44.11}/dotted/matchers.py +0 -0
  23. {dotted_notation-0.44.9 → dotted_notation-0.44.11}/dotted/predicates.py +0 -0
  24. {dotted_notation-0.44.9 → dotted_notation-0.44.11}/dotted/recursive.py +0 -0
  25. {dotted_notation-0.44.9 → dotted_notation-0.44.11}/dotted/results.py +0 -0
  26. {dotted_notation-0.44.9 → dotted_notation-0.44.11}/dotted/sql/__init__.py +0 -0
  27. {dotted_notation-0.44.9 → dotted_notation-0.44.11}/dotted/sql/core.py +0 -0
  28. {dotted_notation-0.44.9 → dotted_notation-0.44.11}/dotted/sql/pg.py +0 -0
  29. {dotted_notation-0.44.9 → dotted_notation-0.44.11}/dotted/transforms.py +0 -0
  30. {dotted_notation-0.44.9 → dotted_notation-0.44.11}/dotted/utils.py +0 -0
  31. {dotted_notation-0.44.9 → dotted_notation-0.44.11}/dotted/utypes.py +0 -0
  32. {dotted_notation-0.44.9 → dotted_notation-0.44.11}/dotted/wrappers.py +0 -0
  33. {dotted_notation-0.44.9 → dotted_notation-0.44.11}/dotted_notation.egg-info/SOURCES.txt +0 -0
  34. {dotted_notation-0.44.9 → dotted_notation-0.44.11}/dotted_notation.egg-info/dependency_links.txt +0 -0
  35. {dotted_notation-0.44.9 → dotted_notation-0.44.11}/dotted_notation.egg-info/entry_points.txt +0 -0
  36. {dotted_notation-0.44.9 → dotted_notation-0.44.11}/dotted_notation.egg-info/requires.txt +0 -0
  37. {dotted_notation-0.44.9 → dotted_notation-0.44.11}/dotted_notation.egg-info/top_level.txt +0 -0
  38. {dotted_notation-0.44.9 → dotted_notation-0.44.11}/setup.cfg +0 -0
@@ -3,6 +3,46 @@
3
3
  All notable changes to `dotted` are recorded here. Versions prior to
4
4
  the ones listed are omitted — browse git history for earlier entries.
5
5
 
6
+ ## [0.44.11]
7
+
8
+ ### Changed
9
+ - `build()` copies its leaves with the standard library's
10
+ `copy.deepcopy` even when copium is installed. copium 0.1.0 gets slow
11
+ at small copies once it has copied something large in the same
12
+ process ([copium#54](https://github.com/percolab/copium/issues/54)),
13
+ which made `build` slower with the extra than without it. copium is
14
+ still used for the whole-object copy made by `mutable=False`.
15
+
16
+ ## [0.44.10]
17
+
18
+ ### Performance
19
+ - `build()` and `build_multi()` keep the parsed paths they expand
20
+ instead of assembling each one to a string and parsing it again. A
21
+ pattern matching more paths than the parse cache holds (300) used to
22
+ miss on every one; `build` over 1000 matches is about 35x faster.
23
+
24
+ ### Changed
25
+ - Three edge cases of `build()` change with the string round trip gone:
26
+ with `strict=True`, a trailing `[]` or `[:]` now creates the empty
27
+ list where it was a no-op, and raises `TypeError` on a list root; a
28
+ wildcard over keys that cannot be written as a path, such as `None` or
29
+ `True`, now succeeds where it raised `AttributeError`.
30
+
31
+ ### Added
32
+ - Benchmark suite: `python -m benchmarks` or `make bench`. Times reads
33
+ and writes at two data sizes, and the copying cases under both
34
+ `copy.deepcopy` and copium. Results can be saved and compared.
35
+
36
+ ### Fixed
37
+ - `make` targets failed because the install rule depended on
38
+ `setup.py`, removed in the move to `pyproject.toml`.
39
+
40
+ ### Documentation
41
+ - README caveat for the `copium` extra: copium 0.1.0 gets slower at
42
+ copying small objects once it has copied a large one in the same
43
+ process. Reported upstream as
44
+ [copium#54](https://github.com/percolab/copium/issues/54).
45
+
6
46
  ## [0.44.9]
7
47
 
8
48
  ### Performance
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dotted_notation
3
- Version: 0.44.9
3
+ Version: 0.44.11
4
4
  Summary: Dotted notation for safe nested data traversal with optional chaining, pattern matching, and transforms
5
5
  Author-email: Frey Waid <logophage1@gmail.com>
6
6
  License: MIT
@@ -83,6 +83,12 @@ For faster `mutable=False` updates and removes, install the
83
83
 
84
84
  pip install dotted-notation[copium]
85
85
 
86
+ > **Caveat (copium 0.1.0):** after copium copies a large object, its copies of
87
+ > small objects in the same process become slower than `copy.deepcopy` and stay
88
+ > that way. Copying whole documents is 3-9x faster, but a long-running process
89
+ > that mixes one large copy with many small ones can come out slower overall.
90
+ > Tracked upstream in [copium#54](https://github.com/percolab/copium/issues/54).
91
+
86
92
  ## Table of Contents
87
93
 
88
94
  - [Safe Traversal (Optional Chaining)](#safe-traversal-optional-chaining)
@@ -37,6 +37,12 @@ For faster `mutable=False` updates and removes, install the
37
37
 
38
38
  pip install dotted-notation[copium]
39
39
 
40
+ > **Caveat (copium 0.1.0):** after copium copies a large object, its copies of
41
+ > small objects in the same process become slower than `copy.deepcopy` and stay
42
+ > that way. Copying whole documents is 3-9x faster, but a long-running process
43
+ > that mixes one large copy with many small ones can come out slower overall.
44
+ > Tracked upstream in [copium#54](https://github.com/percolab/copium/issues/54).
45
+
40
46
  ## Table of Contents
41
47
 
42
48
  - [Safe Traversal (Optional Chaining)](#safe-traversal-optional-chaining)
@@ -396,6 +396,23 @@ _mutable = mutable
396
396
  is_mutable = mutable
397
397
 
398
398
 
399
+ def _pluck_parsed(obj, ops, strict=False):
400
+ """
401
+ Yield deduped (parsed path, value) pairs from obj matching `ops`.
402
+ Like pluck_multi, but the paths stay parsed so callers that hand them
403
+ straight back to dotted skip the assemble and re-parse.
404
+ """
405
+ seen = set()
406
+ for path, val in engine.walk(ops, obj, paths=True, strict=strict):
407
+ if path is utypes.CUT_SENTINEL:
408
+ break
409
+ found = results.Dotted({'ops': path, 'transforms': ops.transforms})
410
+ if found in seen:
411
+ continue
412
+ seen.add(found)
413
+ yield (found, val)
414
+
415
+
399
416
  def build_multi(obj, paths, strict=False, bindings=None):
400
417
  """
401
418
  Build a subset/default obj based on concrete path fields
@@ -406,8 +423,9 @@ def build_multi(obj, paths, strict=False, bindings=None):
406
423
  if obj is AUTO:
407
424
  obj = _auto_root(((p, None) for p in paths))
408
425
  for path in paths:
409
- built = engine.build(parse(path, bindings=bindings, partial=False), obj, strict=strict)
410
- obj = update_multi(obj, pluck_multi(built, (path,), strict=strict), strict=strict)
426
+ ops = parse(path, bindings=bindings, partial=False)
427
+ built = engine.build(ops, obj, strict=strict)
428
+ obj = update_multi(obj, _pluck_parsed(built, ops, strict=strict), strict=strict)
411
429
  return obj
412
430
 
413
431
 
@@ -3,10 +3,10 @@ Traversal engine for dotted path operations.
3
3
 
4
4
  Core traversal functions (walk, gets, updates, removes, expands).
5
5
  """
6
+ import copy
6
7
 
7
8
  from . import base
8
9
  from . import matchers
9
- from . import utils
10
10
  from . import wrappers
11
11
  from .access import Attr, Slot
12
12
  from .results import Dotted
@@ -42,7 +42,9 @@ def build(ops, node, deepcopy=True, **kwargs):
42
42
  built = node.__class__()
43
43
  for k,v in cur.items(node, **kwargs):
44
44
  if not ops:
45
- built = cur.update(built, k, utils.deepcopy(v) if deepcopy else v)
45
+ # stdlib copy, not utils.deepcopy: copium gets slow at small
46
+ # copies like these after a large one (percolab/copium#54)
47
+ built = cur.update(built, k, copy.deepcopy(v) if deepcopy else v)
46
48
  else:
47
49
  built = cur.update(built, k, build(ops, v, deepcopy=deepcopy, **kwargs))
48
50
  return built or build_default([cur]+ops)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dotted_notation
3
- Version: 0.44.9
3
+ Version: 0.44.11
4
4
  Summary: Dotted notation for safe nested data traversal with optional chaining, pattern matching, and transforms
5
5
  Author-email: Frey Waid <logophage1@gmail.com>
6
6
  License: MIT
@@ -83,6 +83,12 @@ For faster `mutable=False` updates and removes, install the
83
83
 
84
84
  pip install dotted-notation[copium]
85
85
 
86
+ > **Caveat (copium 0.1.0):** after copium copies a large object, its copies of
87
+ > small objects in the same process become slower than `copy.deepcopy` and stay
88
+ > that way. Copying whole documents is 3-9x faster, but a long-running process
89
+ > that mixes one large copy with many small ones can come out slower overall.
90
+ > Tracked upstream in [copium#54](https://github.com/percolab/copium/issues/54).
91
+
86
92
  ## Table of Contents
87
93
 
88
94
  - [Safe Traversal (Optional Chaining)](#safe-traversal-optional-chaining)
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "dotted_notation"
7
- version = "0.44.9"
7
+ version = "0.44.11"
8
8
  description = "Dotted notation for safe nested data traversal with optional chaining, pattern matching, and transforms"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.6"