dotted-notation 0.44.8__tar.gz → 0.44.9__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.
- {dotted_notation-0.44.8 → dotted_notation-0.44.9}/CHANGELOG.md +21 -0
- {dotted_notation-0.44.8/dotted_notation.egg-info → dotted_notation-0.44.9}/PKG-INFO +18 -2
- {dotted_notation-0.44.8 → dotted_notation-0.44.9}/README.md +11 -1
- {dotted_notation-0.44.8 → dotted_notation-0.44.9}/dotted/api.py +5 -5
- {dotted_notation-0.44.8 → dotted_notation-0.44.9}/dotted/engine.py +2 -2
- {dotted_notation-0.44.8 → dotted_notation-0.44.9}/dotted/utils.py +6 -0
- {dotted_notation-0.44.8 → dotted_notation-0.44.9/dotted_notation.egg-info}/PKG-INFO +18 -2
- dotted_notation-0.44.9/dotted_notation.egg-info/requires.txt +29 -0
- {dotted_notation-0.44.8 → dotted_notation-0.44.9}/pyproject.toml +8 -1
- dotted_notation-0.44.8/dotted_notation.egg-info/requires.txt +0 -17
- {dotted_notation-0.44.8 → dotted_notation-0.44.9}/LICENSE +0 -0
- {dotted_notation-0.44.8 → dotted_notation-0.44.9}/MANIFEST.in +0 -0
- {dotted_notation-0.44.8 → dotted_notation-0.44.9}/dotted/__init__.py +0 -0
- {dotted_notation-0.44.8 → dotted_notation-0.44.9}/dotted/__main__.py +0 -0
- {dotted_notation-0.44.8 → dotted_notation-0.44.9}/dotted/access.py +0 -0
- {dotted_notation-0.44.8 → dotted_notation-0.44.9}/dotted/base.py +0 -0
- {dotted_notation-0.44.8 → dotted_notation-0.44.9}/dotted/cli/__init__.py +0 -0
- {dotted_notation-0.44.8 → dotted_notation-0.44.9}/dotted/cli/_compat.py +0 -0
- {dotted_notation-0.44.8 → dotted_notation-0.44.9}/dotted/cli/formats.py +0 -0
- {dotted_notation-0.44.8 → dotted_notation-0.44.9}/dotted/cli/main.py +0 -0
- {dotted_notation-0.44.8 → dotted_notation-0.44.9}/dotted/containers.py +0 -0
- {dotted_notation-0.44.8 → dotted_notation-0.44.9}/dotted/filters.py +0 -0
- {dotted_notation-0.44.8 → dotted_notation-0.44.9}/dotted/grammar.py +0 -0
- {dotted_notation-0.44.8 → dotted_notation-0.44.9}/dotted/groups.py +0 -0
- {dotted_notation-0.44.8 → dotted_notation-0.44.9}/dotted/matchers.py +0 -0
- {dotted_notation-0.44.8 → dotted_notation-0.44.9}/dotted/predicates.py +0 -0
- {dotted_notation-0.44.8 → dotted_notation-0.44.9}/dotted/recursive.py +0 -0
- {dotted_notation-0.44.8 → dotted_notation-0.44.9}/dotted/results.py +0 -0
- {dotted_notation-0.44.8 → dotted_notation-0.44.9}/dotted/sql/__init__.py +0 -0
- {dotted_notation-0.44.8 → dotted_notation-0.44.9}/dotted/sql/core.py +0 -0
- {dotted_notation-0.44.8 → dotted_notation-0.44.9}/dotted/sql/pg.py +0 -0
- {dotted_notation-0.44.8 → dotted_notation-0.44.9}/dotted/transforms.py +0 -0
- {dotted_notation-0.44.8 → dotted_notation-0.44.9}/dotted/utypes.py +0 -0
- {dotted_notation-0.44.8 → dotted_notation-0.44.9}/dotted/wrappers.py +0 -0
- {dotted_notation-0.44.8 → dotted_notation-0.44.9}/dotted_notation.egg-info/SOURCES.txt +0 -0
- {dotted_notation-0.44.8 → dotted_notation-0.44.9}/dotted_notation.egg-info/dependency_links.txt +0 -0
- {dotted_notation-0.44.8 → dotted_notation-0.44.9}/dotted_notation.egg-info/entry_points.txt +0 -0
- {dotted_notation-0.44.8 → dotted_notation-0.44.9}/dotted_notation.egg-info/top_level.txt +0 -0
- {dotted_notation-0.44.8 → dotted_notation-0.44.9}/setup.cfg +0 -0
|
@@ -3,6 +3,27 @@
|
|
|
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.9]
|
|
7
|
+
|
|
8
|
+
### Performance
|
|
9
|
+
- Optional [copium](https://github.com/Bobronium/copium) support: a C
|
|
10
|
+
implementation of `copy.deepcopy` with the same semantics. When
|
|
11
|
+
installed, the copies made by `mutable=False` updates and removes and
|
|
12
|
+
by `build()` use it (roughly 5-20x faster on plain nested data);
|
|
13
|
+
otherwise dotted falls back to `copy.deepcopy`. Install with
|
|
14
|
+
`pip install dotted-notation[copium]` (CPython 3.10+).
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
- `copium` extra, and a `formats` extra bundling YAML and TOML support.
|
|
18
|
+
|
|
19
|
+
### Deprecated
|
|
20
|
+
- The `all` extra. It is an alias for `formats` and will be removed in
|
|
21
|
+
a future release.
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
- When copium is installed the test suite runs every test function
|
|
25
|
+
under both deepcopy implementations.
|
|
26
|
+
|
|
6
27
|
## [0.44.8]
|
|
7
28
|
|
|
8
29
|
### Added
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dotted_notation
|
|
3
|
-
Version: 0.44.
|
|
3
|
+
Version: 0.44.9
|
|
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
|
|
@@ -27,11 +27,17 @@ Requires-Python: >=3.6
|
|
|
27
27
|
Description-Content-Type: text/markdown
|
|
28
28
|
License-File: LICENSE
|
|
29
29
|
Requires-Dist: pyparsing>=3.0
|
|
30
|
+
Provides-Extra: copium
|
|
31
|
+
Requires-Dist: copium>=0.1.0; (python_version >= "3.10" and platform_python_implementation == "CPython") and extra == "copium"
|
|
30
32
|
Provides-Extra: yaml
|
|
31
33
|
Requires-Dist: PyYAML>=5.0; extra == "yaml"
|
|
32
34
|
Provides-Extra: toml
|
|
33
35
|
Requires-Dist: tomli>=1.0; python_version < "3.11" and extra == "toml"
|
|
34
36
|
Requires-Dist: tomli_w>=1.0; extra == "toml"
|
|
37
|
+
Provides-Extra: formats
|
|
38
|
+
Requires-Dist: PyYAML>=5.0; extra == "formats"
|
|
39
|
+
Requires-Dist: tomli>=1.0; python_version < "3.11" and extra == "formats"
|
|
40
|
+
Requires-Dist: tomli_w>=1.0; extra == "formats"
|
|
35
41
|
Provides-Extra: all
|
|
36
42
|
Requires-Dist: PyYAML>=5.0; extra == "all"
|
|
37
43
|
Requires-Dist: tomli>=1.0; python_version < "3.11" and extra == "all"
|
|
@@ -61,12 +67,22 @@ Since this package includes the [**`dq`** command-line tool](#cli-dq), several d
|
|
|
61
67
|
|
|
62
68
|
To install optional format support:
|
|
63
69
|
|
|
64
|
-
pip install dotted-notation[
|
|
70
|
+
pip install dotted-notation[formats]
|
|
65
71
|
|
|
66
72
|
Or pick only what you need:
|
|
67
73
|
|
|
68
74
|
pip install dotted-notation[yaml,toml]
|
|
69
75
|
|
|
76
|
+
> **Deprecated:** the `all` extra is an alias for `formats` and will be removed
|
|
77
|
+
> in a future release. Use `formats` instead.
|
|
78
|
+
|
|
79
|
+
For faster `mutable=False` updates and removes, install the
|
|
80
|
+
[copium](https://github.com/Bobronium/copium) extra, a C implementation of
|
|
81
|
+
`copy.deepcopy` (CPython 3.10+). Dotted uses it when present and falls back to
|
|
82
|
+
`copy.deepcopy` otherwise:
|
|
83
|
+
|
|
84
|
+
pip install dotted-notation[copium]
|
|
85
|
+
|
|
70
86
|
## Table of Contents
|
|
71
87
|
|
|
72
88
|
- [Safe Traversal (Optional Chaining)](#safe-traversal-optional-chaining)
|
|
@@ -21,12 +21,22 @@ Since this package includes the [**`dq`** command-line tool](#cli-dq), several d
|
|
|
21
21
|
|
|
22
22
|
To install optional format support:
|
|
23
23
|
|
|
24
|
-
pip install dotted-notation[
|
|
24
|
+
pip install dotted-notation[formats]
|
|
25
25
|
|
|
26
26
|
Or pick only what you need:
|
|
27
27
|
|
|
28
28
|
pip install dotted-notation[yaml,toml]
|
|
29
29
|
|
|
30
|
+
> **Deprecated:** the `all` extra is an alias for `formats` and will be removed
|
|
31
|
+
> in a future release. Use `formats` instead.
|
|
32
|
+
|
|
33
|
+
For faster `mutable=False` updates and removes, install the
|
|
34
|
+
[copium](https://github.com/Bobronium/copium) extra, a C implementation of
|
|
35
|
+
`copy.deepcopy` (CPython 3.10+). Dotted uses it when present and falls back to
|
|
36
|
+
`copy.deepcopy` otherwise:
|
|
37
|
+
|
|
38
|
+
pip install dotted-notation[copium]
|
|
39
|
+
|
|
30
40
|
## Table of Contents
|
|
31
41
|
|
|
32
42
|
- [Safe Traversal (Optional Chaining)](#safe-traversal-optional-chaining)
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"""
|
|
2
2
|
Main api
|
|
3
3
|
"""
|
|
4
|
-
import copy
|
|
5
4
|
import enum
|
|
6
5
|
import functools
|
|
7
6
|
import itertools
|
|
@@ -14,6 +13,7 @@ from . import transforms
|
|
|
14
13
|
from . import base
|
|
15
14
|
from . import access
|
|
16
15
|
from . import matchers
|
|
16
|
+
from . import utils
|
|
17
17
|
from . import utypes
|
|
18
18
|
|
|
19
19
|
|
|
@@ -544,7 +544,7 @@ def update_if(obj, path, val, pred=lambda val: val is not None, mutable=True, ap
|
|
|
544
544
|
if obj is AUTO:
|
|
545
545
|
obj = _auto_root_from_path(path)
|
|
546
546
|
if not mutable and _is_mutable_container(obj):
|
|
547
|
-
obj =
|
|
547
|
+
obj = utils.deepcopy(obj)
|
|
548
548
|
mutable = True
|
|
549
549
|
|
|
550
550
|
if pred is not None and not pred(val):
|
|
@@ -562,7 +562,7 @@ def update_if_multi(obj, items, pred=lambda val: val is not None, mutable=True,
|
|
|
562
562
|
{'a': 1, 'c': 3}
|
|
563
563
|
"""
|
|
564
564
|
if not mutable and _is_mutable_container(obj):
|
|
565
|
-
obj =
|
|
565
|
+
obj = utils.deepcopy(obj)
|
|
566
566
|
mutable = True
|
|
567
567
|
for item in items:
|
|
568
568
|
path, val, *rest = item
|
|
@@ -646,7 +646,7 @@ def remove_if(obj, path, pred=lambda path: path is not None, val=ANY, mutable=Tr
|
|
|
646
646
|
if obj is AUTO:
|
|
647
647
|
obj = _auto_root_from_path(path)
|
|
648
648
|
if not mutable and _is_mutable_container(obj):
|
|
649
|
-
obj =
|
|
649
|
+
obj = utils.deepcopy(obj)
|
|
650
650
|
mutable = True
|
|
651
651
|
|
|
652
652
|
if pred is not None and not pred(path):
|
|
@@ -663,7 +663,7 @@ def remove_if_multi(obj, items, paths_only=True, pred=lambda path: path is not N
|
|
|
663
663
|
{}
|
|
664
664
|
"""
|
|
665
665
|
if not mutable and _is_mutable_container(obj):
|
|
666
|
-
obj =
|
|
666
|
+
obj = utils.deepcopy(obj)
|
|
667
667
|
mutable = True
|
|
668
668
|
|
|
669
669
|
if paths_only:
|
|
@@ -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
|
|
7
6
|
|
|
8
7
|
from . import base
|
|
9
8
|
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,7 @@ 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,
|
|
45
|
+
built = cur.update(built, k, utils.deepcopy(v) if deepcopy else v)
|
|
46
46
|
else:
|
|
47
47
|
built = cur.update(built, k, build(ops, v, deepcopy=deepcopy, **kwargs))
|
|
48
48
|
return built or build_default([cur]+ops)
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
"""
|
|
2
2
|
Shared type-checking helpers (duck-typing).
|
|
3
3
|
"""
|
|
4
|
+
try:
|
|
5
|
+
# C implementation of copy.deepcopy with identical semantics;
|
|
6
|
+
# installed by the [copium] extra.
|
|
7
|
+
from copium import deepcopy
|
|
8
|
+
except ImportError:
|
|
9
|
+
from copy import deepcopy
|
|
4
10
|
|
|
5
11
|
class lazyprop:
|
|
6
12
|
"""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dotted_notation
|
|
3
|
-
Version: 0.44.
|
|
3
|
+
Version: 0.44.9
|
|
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
|
|
@@ -27,11 +27,17 @@ Requires-Python: >=3.6
|
|
|
27
27
|
Description-Content-Type: text/markdown
|
|
28
28
|
License-File: LICENSE
|
|
29
29
|
Requires-Dist: pyparsing>=3.0
|
|
30
|
+
Provides-Extra: copium
|
|
31
|
+
Requires-Dist: copium>=0.1.0; (python_version >= "3.10" and platform_python_implementation == "CPython") and extra == "copium"
|
|
30
32
|
Provides-Extra: yaml
|
|
31
33
|
Requires-Dist: PyYAML>=5.0; extra == "yaml"
|
|
32
34
|
Provides-Extra: toml
|
|
33
35
|
Requires-Dist: tomli>=1.0; python_version < "3.11" and extra == "toml"
|
|
34
36
|
Requires-Dist: tomli_w>=1.0; extra == "toml"
|
|
37
|
+
Provides-Extra: formats
|
|
38
|
+
Requires-Dist: PyYAML>=5.0; extra == "formats"
|
|
39
|
+
Requires-Dist: tomli>=1.0; python_version < "3.11" and extra == "formats"
|
|
40
|
+
Requires-Dist: tomli_w>=1.0; extra == "formats"
|
|
35
41
|
Provides-Extra: all
|
|
36
42
|
Requires-Dist: PyYAML>=5.0; extra == "all"
|
|
37
43
|
Requires-Dist: tomli>=1.0; python_version < "3.11" and extra == "all"
|
|
@@ -61,12 +67,22 @@ Since this package includes the [**`dq`** command-line tool](#cli-dq), several d
|
|
|
61
67
|
|
|
62
68
|
To install optional format support:
|
|
63
69
|
|
|
64
|
-
pip install dotted-notation[
|
|
70
|
+
pip install dotted-notation[formats]
|
|
65
71
|
|
|
66
72
|
Or pick only what you need:
|
|
67
73
|
|
|
68
74
|
pip install dotted-notation[yaml,toml]
|
|
69
75
|
|
|
76
|
+
> **Deprecated:** the `all` extra is an alias for `formats` and will be removed
|
|
77
|
+
> in a future release. Use `formats` instead.
|
|
78
|
+
|
|
79
|
+
For faster `mutable=False` updates and removes, install the
|
|
80
|
+
[copium](https://github.com/Bobronium/copium) extra, a C implementation of
|
|
81
|
+
`copy.deepcopy` (CPython 3.10+). Dotted uses it when present and falls back to
|
|
82
|
+
`copy.deepcopy` otherwise:
|
|
83
|
+
|
|
84
|
+
pip install dotted-notation[copium]
|
|
85
|
+
|
|
70
86
|
## Table of Contents
|
|
71
87
|
|
|
72
88
|
- [Safe Traversal (Optional Chaining)](#safe-traversal-optional-chaining)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
pyparsing>=3.0
|
|
2
|
+
|
|
3
|
+
[all]
|
|
4
|
+
PyYAML>=5.0
|
|
5
|
+
tomli_w>=1.0
|
|
6
|
+
|
|
7
|
+
[all:python_version < "3.11"]
|
|
8
|
+
tomli>=1.0
|
|
9
|
+
|
|
10
|
+
[copium]
|
|
11
|
+
|
|
12
|
+
[copium:python_version >= "3.10" and platform_python_implementation == "CPython"]
|
|
13
|
+
copium>=0.1.0
|
|
14
|
+
|
|
15
|
+
[formats]
|
|
16
|
+
PyYAML>=5.0
|
|
17
|
+
tomli_w>=1.0
|
|
18
|
+
|
|
19
|
+
[formats:python_version < "3.11"]
|
|
20
|
+
tomli>=1.0
|
|
21
|
+
|
|
22
|
+
[toml]
|
|
23
|
+
tomli_w>=1.0
|
|
24
|
+
|
|
25
|
+
[toml:python_version < "3.11"]
|
|
26
|
+
tomli>=1.0
|
|
27
|
+
|
|
28
|
+
[yaml]
|
|
29
|
+
PyYAML>=5.0
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "dotted_notation"
|
|
7
|
-
version = "0.44.
|
|
7
|
+
version = "0.44.9"
|
|
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"
|
|
@@ -44,8 +44,15 @@ dependencies = [
|
|
|
44
44
|
]
|
|
45
45
|
|
|
46
46
|
[project.optional-dependencies]
|
|
47
|
+
copium = ['copium>=0.1.0;python_version>="3.10" and platform_python_implementation=="CPython"']
|
|
47
48
|
yaml = ["PyYAML>=5.0"]
|
|
48
49
|
toml = ['tomli>=1.0;python_version<"3.11"', "tomli_w>=1.0"]
|
|
50
|
+
formats = [
|
|
51
|
+
"PyYAML>=5.0",
|
|
52
|
+
'tomli>=1.0;python_version<"3.11"',
|
|
53
|
+
"tomli_w>=1.0",
|
|
54
|
+
]
|
|
55
|
+
# DEPRECATED: legacy alias for formats, to be removed in a future release
|
|
49
56
|
all = [
|
|
50
57
|
"PyYAML>=5.0",
|
|
51
58
|
'tomli>=1.0;python_version<"3.11"',
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dotted_notation-0.44.8 → dotted_notation-0.44.9}/dotted_notation.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|