dotted-notation 0.49.3__cp315-cp315-win_amd64.whl

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 (70) hide show
  1. dotted/__init__.py +105 -0
  2. dotted/__main__.py +7 -0
  3. dotted/access.c +101933 -0
  4. dotted/access.cp315-win_amd64.pyd +0 -0
  5. dotted/access.pxd +57 -0
  6. dotted/access.py +1199 -0
  7. dotted/api.c +53248 -0
  8. dotted/api.cp315-win_amd64.pyd +0 -0
  9. dotted/api.py +1390 -0
  10. dotted/base.c +47800 -0
  11. dotted/base.cp315-win_amd64.pyd +0 -0
  12. dotted/base.pxd +77 -0
  13. dotted/base.py +623 -0
  14. dotted/cli/__init__.py +0 -0
  15. dotted/cli/_compat.py +52 -0
  16. dotted/cli/formats.py +419 -0
  17. dotted/cli/main.py +347 -0
  18. dotted/containers.c +59206 -0
  19. dotted/containers.cp315-win_amd64.pyd +0 -0
  20. dotted/containers.py +1025 -0
  21. dotted/engine.c +22512 -0
  22. dotted/engine.cp315-win_amd64.pyd +0 -0
  23. dotted/engine.pxd +18 -0
  24. dotted/engine.py +238 -0
  25. dotted/filters.c +68727 -0
  26. dotted/filters.cp315-win_amd64.pyd +0 -0
  27. dotted/filters.pxd +60 -0
  28. dotted/filters.py +716 -0
  29. dotted/grammar.py +1182 -0
  30. dotted/groups.c +69177 -0
  31. dotted/groups.cp315-win_amd64.pyd +0 -0
  32. dotted/groups.pxd +34 -0
  33. dotted/groups.py +1011 -0
  34. dotted/matchers.c +59317 -0
  35. dotted/matchers.cp315-win_amd64.pyd +0 -0
  36. dotted/matchers.pxd +87 -0
  37. dotted/matchers.py +580 -0
  38. dotted/native.py +59 -0
  39. dotted/predicates.c +19950 -0
  40. dotted/predicates.cp315-win_amd64.pyd +0 -0
  41. dotted/predicates.py +174 -0
  42. dotted/recursive.c +41952 -0
  43. dotted/recursive.cp315-win_amd64.pyd +0 -0
  44. dotted/recursive.pxd +24 -0
  45. dotted/recursive.py +486 -0
  46. dotted/results.c +31573 -0
  47. dotted/results.cp315-win_amd64.pyd +0 -0
  48. dotted/results.py +327 -0
  49. dotted/sql/__init__.py +51 -0
  50. dotted/sql/core.py +807 -0
  51. dotted/sql/pg.py +1040 -0
  52. dotted/transforms.c +26600 -0
  53. dotted/transforms.cp315-win_amd64.pyd +0 -0
  54. dotted/transforms.py +587 -0
  55. dotted/utils.c +15239 -0
  56. dotted/utils.cp315-win_amd64.pyd +0 -0
  57. dotted/utils.py +153 -0
  58. dotted/utypes.c +12768 -0
  59. dotted/utypes.cp315-win_amd64.pyd +0 -0
  60. dotted/utypes.py +58 -0
  61. dotted/wrappers.c +65635 -0
  62. dotted/wrappers.cp315-win_amd64.pyd +0 -0
  63. dotted/wrappers.pxd +27 -0
  64. dotted/wrappers.py +816 -0
  65. dotted_notation-0.49.3.dist-info/METADATA +3981 -0
  66. dotted_notation-0.49.3.dist-info/RECORD +70 -0
  67. dotted_notation-0.49.3.dist-info/WHEEL +5 -0
  68. dotted_notation-0.49.3.dist-info/entry_points.txt +2 -0
  69. dotted_notation-0.49.3.dist-info/licenses/LICENSE +21 -0
  70. dotted_notation-0.49.3.dist-info/top_level.txt +1 -0
dotted/__init__.py ADDED
@@ -0,0 +1,105 @@
1
+ """
2
+ Dotted notation for safe nested data traversal with optional chaining,
3
+ pattern matching, and transforms.
4
+
5
+ Missing keys and attributes are handled gracefully—no KeyError or AttributeError.
6
+ Use dotted to fetch, update, and remove data from deeply nested structures.
7
+
8
+ >>> import dotted
9
+ >>> d = {'hi': {'there': [1, 2, 3]}}
10
+ >>> dotted.get(d, 'hi.there[1]')
11
+ 2
12
+
13
+ Core Operations
14
+ ---------------
15
+ get(obj, path) Get value at dotted path
16
+ update(obj, path, val) Update value at dotted path
17
+ remove(obj, path) Remove value at dotted path
18
+ has(obj, path) Check if path exists
19
+ setdefault(obj, p, v) Set value only if path missing
20
+ is_mutable(obj, path) Check if update would mutate in place
21
+
22
+ Pattern Matching
23
+ ----------------
24
+ match(pattern, path) Match pattern to path
25
+ replace(template, bind) Substitute $N in template path
26
+ expand(obj, pattern) Expand pattern to concrete paths
27
+
28
+ Building & Plucking
29
+ -------------------
30
+ build(obj, path) Build default structure for path
31
+ pack(pathvalues) Build object from path-value pairs
32
+ pluck(obj, pattern) Extract (path, value) pairs
33
+ walk(obj, pattern) Yield (path, value) pairs (lazy)
34
+ unpack(obj) Extract to dotted normal form
35
+ keys(obj) Dotted paths of obj
36
+ values(obj) Leaf values of obj
37
+ items(obj) (path, value) pairs as dict_items view
38
+
39
+ Transforms
40
+ ----------
41
+ Append transforms with |: 'field|int', 'field|str:fmt'
42
+
43
+ >>> dotted.get({'n': '42'}, 'n|int')
44
+ 42
45
+
46
+ register(name, fn) Register custom transform
47
+ transform(name) Decorator for custom transforms
48
+
49
+ Constants
50
+ ---------
51
+ ANY Match any value (for remove)
52
+ AUTO Auto-infer root container type ({} or []) from first path
53
+
54
+ For full documentation including all options and flags:
55
+ $ pydoc dotted.api
56
+ or see README.md
57
+ """
58
+ from . import native
59
+
60
+ # before anything else of dotted's is imported: see dotted.native
61
+ if not native.wanted():
62
+ native.use_source()
63
+
64
+ from .api import \
65
+ parse, compile, is_pattern, is_template, is_reference, is_indeterminate, is_simple, \
66
+ is_inverted, is_mutable, mutable, quote, ANY, AUTO, Attrs, GroupMode, \
67
+ set_simple_fastpath, set_parse_cache, \
68
+ register, transform, set_resolver, get_resolver, \
69
+ assemble, assemble_multi, \
70
+ build, build_multi, \
71
+ expand, expand_multi, \
72
+ match, match_multi, replace, overlaps, translate, translate_multi, \
73
+ apply, apply_multi, \
74
+ get, get_multi, \
75
+ has, setdefault, setdefault_multi, \
76
+ update, update_multi, pack, update_if, update_if_multi, \
77
+ remove, remove_multi, remove_if, remove_if_multi, \
78
+ pluck, pluck_multi, walk, walk_multi, unpack, keys, values, items
79
+ from .sql import sqlize, TranslationError, SQLFragment, Resolver, ParamStyle, ParamPool
80
+ # the run-time reference resolver; sqlize's Resolver, above, has the plain name
81
+ from .base import Resolver as ReferenceResolver, UnresolvedReference
82
+
83
+ __all__ = [
84
+ # Core
85
+ 'get', 'update', 'remove', 'has', 'setdefault',
86
+ 'ReferenceResolver', 'UnresolvedReference', 'set_resolver', 'get_resolver',
87
+ # Multi
88
+ 'get_multi', 'update_multi', 'pack', 'update_if', 'update_if_multi', 'remove_multi', 'remove_if', 'remove_if_multi', 'setdefault_multi',
89
+ # Pattern
90
+ 'match', 'match_multi', 'replace', 'overlaps', 'translate', 'translate_multi', 'expand', 'expand_multi',
91
+ # Build/Pluck
92
+ 'build', 'build_multi', 'pluck', 'pluck_multi', 'walk', 'walk_multi', 'unpack', 'keys', 'values', 'items',
93
+ # Transform
94
+ 'apply', 'apply_multi', 'register', 'transform',
95
+ # Utility
96
+ 'parse', 'compile', 'assemble', 'assemble_multi', 'quote',
97
+ 'is_pattern', 'is_template', 'is_reference',
98
+ 'is_indeterminate', 'is_simple',
99
+ 'is_inverted', 'is_mutable', 'mutable',
100
+ 'set_simple_fastpath', 'set_parse_cache',
101
+ # SQL
102
+ 'sqlize', 'Resolver', 'SQLFragment', 'ParamStyle', 'ParamPool', 'TranslationError',
103
+ # Constants
104
+ 'ANY', 'AUTO', 'Attrs', 'GroupMode',
105
+ ]
dotted/__main__.py ADDED
@@ -0,0 +1,7 @@
1
+ """
2
+ Support for python -m dotted.
3
+ """
4
+ from dotted.cli.main import main
5
+
6
+ if __name__ == '__main__':
7
+ main()