dotted-notation 0.51.0__tar.gz → 0.51.1__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.51.0 → dotted_notation-0.51.1}/CHANGELOG.md +7 -0
- {dotted_notation-0.51.0/dotted_notation.egg-info → dotted_notation-0.51.1}/PKG-INFO +10 -8
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/README.md +9 -7
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/dotted/base.py +4 -3
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/dotted/grammar.py +5 -2
- {dotted_notation-0.51.0 → dotted_notation-0.51.1/dotted_notation.egg-info}/PKG-INFO +10 -8
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/pyproject.toml +1 -1
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/LICENSE +0 -0
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/MANIFEST.in +0 -0
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/dotted/__init__.py +0 -0
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/dotted/__main__.py +0 -0
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/dotted/access.pxd +0 -0
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/dotted/access.py +0 -0
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/dotted/api.py +0 -0
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/dotted/base.pxd +0 -0
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/dotted/cli/__init__.py +0 -0
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/dotted/cli/_compat.py +0 -0
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/dotted/cli/formats.py +0 -0
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/dotted/cli/main.py +0 -0
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/dotted/containers.py +0 -0
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/dotted/engine.pxd +0 -0
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/dotted/engine.py +0 -0
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/dotted/filters.pxd +0 -0
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/dotted/filters.py +0 -0
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/dotted/groups.pxd +0 -0
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/dotted/groups.py +0 -0
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/dotted/matchers.pxd +0 -0
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/dotted/matchers.py +0 -0
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/dotted/native.py +0 -0
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/dotted/predicates.py +0 -0
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/dotted/recursive.pxd +0 -0
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/dotted/recursive.py +0 -0
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/dotted/results.py +0 -0
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/dotted/sql/__init__.py +0 -0
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/dotted/sql/core.py +0 -0
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/dotted/sql/pg.py +0 -0
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/dotted/transforms.py +0 -0
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/dotted/utils.py +0 -0
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/dotted/utypes.py +0 -0
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/dotted/wrappers.pxd +0 -0
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/dotted/wrappers.py +0 -0
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/dotted_notation.egg-info/SOURCES.txt +0 -0
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/dotted_notation.egg-info/dependency_links.txt +0 -0
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/dotted_notation.egg-info/entry_points.txt +0 -0
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/dotted_notation.egg-info/requires.txt +0 -0
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/dotted_notation.egg-info/top_level.txt +0 -0
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/setup.cfg +0 -0
- {dotted_notation-0.51.0 → dotted_notation-0.51.1}/setup.py +0 -0
|
@@ -3,6 +3,13 @@
|
|
|
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.51.1]
|
|
7
|
+
|
|
8
|
+
### Added
|
|
9
|
+
- `ReferenceResolver.lex` is offered a bare transform argument too,
|
|
10
|
+
`|sub:taken`, in the position `'transforms'`. Answering `None` leaves
|
|
11
|
+
it the plain string it was.
|
|
12
|
+
|
|
6
13
|
## [0.51.0]
|
|
7
14
|
|
|
8
15
|
### Added
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dotted_notation
|
|
3
|
-
Version: 0.51.
|
|
3
|
+
Version: 0.51.1
|
|
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-Expression: MIT
|
|
@@ -1771,12 +1771,14 @@ path's segment values, and a slice of a parsed path, `ops[1:]`, is a path.
|
|
|
1771
1771
|
|
|
1772
1772
|
A host's own names may stand where dotted has no reading for a bare token:
|
|
1773
1773
|
a slot, `merged[k]`, a slice bound, `items[:n]`, a filter value,
|
|
1774
|
-
`[*&cur=want]`,
|
|
1775
|
-
`lex(text, position)` is offered each such
|
|
1776
|
-
whole, with its position, one of `'slots'`,
|
|
1777
|
-
`'guards'`. It answers with dotted
|
|
1778
|
-
to
|
|
1779
|
-
|
|
1774
|
+
`[*&cur=want]`, a guard value, `a=k`, or a transform argument,
|
|
1775
|
+
`|sub:taken`. The parse-time hook `lex(text, position)` is offered each such
|
|
1776
|
+
token as written, a dotted name whole, with its position, one of `'slots'`,
|
|
1777
|
+
`'slices'`, `'filters'`, `'guards'` or `'transforms'`. It answers with dotted
|
|
1778
|
+
text to read in the token's place, `None` to leave the `ParseError` (a
|
|
1779
|
+
transform argument stays the plain string it was), or raises to fail the
|
|
1780
|
+
parse at the token. The answer must be one token dotted reads there, and is
|
|
1781
|
+
not offered again.
|
|
1780
1782
|
|
|
1781
1783
|
>>> class Names(dotted.ReferenceResolver):
|
|
1782
1784
|
... def lex(self, text, position):
|
|
@@ -1787,7 +1789,7 @@ answer must be one token dotted reads there, and is not offered again.
|
|
|
1787
1789
|
>>> dotted.get(d, 'merged[c.account]', resolver=Names())
|
|
1788
1790
|
2
|
|
1789
1791
|
|
|
1790
|
-
A token dotted reads, `m[$x]` or `|sub
|
|
1792
|
+
A token dotted reads, `m[$x]` or `|sub:$taken`, is never offered to `lex()`;
|
|
1791
1793
|
a host that means something else by one remaps it at run time, through
|
|
1792
1794
|
`literals`. `parse` takes `resolver=` too, and a path is cached per resolver
|
|
1793
1795
|
that lexes.
|
|
@@ -1723,12 +1723,14 @@ path's segment values, and a slice of a parsed path, `ops[1:]`, is a path.
|
|
|
1723
1723
|
|
|
1724
1724
|
A host's own names may stand where dotted has no reading for a bare token:
|
|
1725
1725
|
a slot, `merged[k]`, a slice bound, `items[:n]`, a filter value,
|
|
1726
|
-
`[*&cur=want]`,
|
|
1727
|
-
`lex(text, position)` is offered each such
|
|
1728
|
-
whole, with its position, one of `'slots'`,
|
|
1729
|
-
`'guards'`. It answers with dotted
|
|
1730
|
-
to
|
|
1731
|
-
|
|
1726
|
+
`[*&cur=want]`, a guard value, `a=k`, or a transform argument,
|
|
1727
|
+
`|sub:taken`. The parse-time hook `lex(text, position)` is offered each such
|
|
1728
|
+
token as written, a dotted name whole, with its position, one of `'slots'`,
|
|
1729
|
+
`'slices'`, `'filters'`, `'guards'` or `'transforms'`. It answers with dotted
|
|
1730
|
+
text to read in the token's place, `None` to leave the `ParseError` (a
|
|
1731
|
+
transform argument stays the plain string it was), or raises to fail the
|
|
1732
|
+
parse at the token. The answer must be one token dotted reads there, and is
|
|
1733
|
+
not offered again.
|
|
1732
1734
|
|
|
1733
1735
|
>>> class Names(dotted.ReferenceResolver):
|
|
1734
1736
|
... def lex(self, text, position):
|
|
@@ -1739,7 +1741,7 @@ answer must be one token dotted reads there, and is not offered again.
|
|
|
1739
1741
|
>>> dotted.get(d, 'merged[c.account]', resolver=Names())
|
|
1740
1742
|
2
|
|
1741
1743
|
|
|
1742
|
-
A token dotted reads, `m[$x]` or `|sub
|
|
1744
|
+
A token dotted reads, `m[$x]` or `|sub:$taken`, is never offered to `lex()`;
|
|
1743
1745
|
a host that means something else by one remaps it at run time, through
|
|
1744
1746
|
`literals`. `parse` takes `resolver=` too, and a path is cached per resolver
|
|
1745
1747
|
that lexes.
|
|
@@ -155,8 +155,8 @@ class NOP(metaclass=MetaNOP):
|
|
|
155
155
|
LITERALS = ('segments', 'transforms', 'guards', 'filters')
|
|
156
156
|
|
|
157
157
|
# The positions a resolver's lex() may be offered a token in: a slot, a
|
|
158
|
-
# slice bound, a filter value and a
|
|
159
|
-
LEXED = ('slots', 'slices', 'filters', 'guards')
|
|
158
|
+
# slice bound, a filter value, a guard value and a transform argument.
|
|
159
|
+
LEXED = ('slots', 'slices', 'filters', 'guards', 'transforms')
|
|
160
160
|
|
|
161
161
|
|
|
162
162
|
class Resolver:
|
|
@@ -203,7 +203,8 @@ class Resolver:
|
|
|
203
203
|
position it stands in, one of LEXED. A dotted name is one token,
|
|
204
204
|
merged[a.b] offering 'a.b'. It answers with dotted text to read
|
|
205
205
|
in the token's place, '$$(k)' making the path merged[$$(k)], or
|
|
206
|
-
None to leave the path unparsed
|
|
206
|
+
None to leave the path unparsed (a transform argument, |sub:k,
|
|
207
|
+
a plain string, as it was); raising fails the parse at the
|
|
207
208
|
token. The text is read in that position as one token, and is
|
|
208
209
|
not offered to lex() again. A token dotted reads is never
|
|
209
210
|
offered: a host that means something else by one says so at run
|
|
@@ -686,8 +686,11 @@ guard_value = (value + _ends) | Lexed('guards', value, _value_stops, end=True)
|
|
|
686
686
|
_key_atom = _commons | numeric_extended | non_integer | numeric_key | word
|
|
687
687
|
_slot_atom = _commons | numeric_extended | numeric_slot
|
|
688
688
|
|
|
689
|
-
# Transform: |name or |name:param — defined early so filters and guards can reference it
|
|
690
|
-
|
|
689
|
+
# Transform: |name or |name:param — defined early so filters and guards can reference it.
|
|
690
|
+
# A param dotted has no reading for is offered to the lexer before it is
|
|
691
|
+
# taken as a plain string, so a lexer answering None leaves it one.
|
|
692
|
+
_targ_read = concrete_value | _arg_sigil | var | quoted | ppc.number | none | true | false
|
|
693
|
+
targ = (_targ_read + _ends) | Lexed('transforms', _targ_read, '|:', end=True) | pp.CharsNotIn('|:')
|
|
691
694
|
param = (colon + targ) | colon.copy().set_parse_action(lambda: [None])
|
|
692
695
|
transform = (transform_name.copy() + ZM(param)).set_parse_action(lambda s, loc, t: base.Transform(*t))
|
|
693
696
|
transforms = ZM(pipe + transform)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dotted_notation
|
|
3
|
-
Version: 0.51.
|
|
3
|
+
Version: 0.51.1
|
|
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-Expression: MIT
|
|
@@ -1771,12 +1771,14 @@ path's segment values, and a slice of a parsed path, `ops[1:]`, is a path.
|
|
|
1771
1771
|
|
|
1772
1772
|
A host's own names may stand where dotted has no reading for a bare token:
|
|
1773
1773
|
a slot, `merged[k]`, a slice bound, `items[:n]`, a filter value,
|
|
1774
|
-
`[*&cur=want]`,
|
|
1775
|
-
`lex(text, position)` is offered each such
|
|
1776
|
-
whole, with its position, one of `'slots'`,
|
|
1777
|
-
`'guards'`. It answers with dotted
|
|
1778
|
-
to
|
|
1779
|
-
|
|
1774
|
+
`[*&cur=want]`, a guard value, `a=k`, or a transform argument,
|
|
1775
|
+
`|sub:taken`. The parse-time hook `lex(text, position)` is offered each such
|
|
1776
|
+
token as written, a dotted name whole, with its position, one of `'slots'`,
|
|
1777
|
+
`'slices'`, `'filters'`, `'guards'` or `'transforms'`. It answers with dotted
|
|
1778
|
+
text to read in the token's place, `None` to leave the `ParseError` (a
|
|
1779
|
+
transform argument stays the plain string it was), or raises to fail the
|
|
1780
|
+
parse at the token. The answer must be one token dotted reads there, and is
|
|
1781
|
+
not offered again.
|
|
1780
1782
|
|
|
1781
1783
|
>>> class Names(dotted.ReferenceResolver):
|
|
1782
1784
|
... def lex(self, text, position):
|
|
@@ -1787,7 +1789,7 @@ answer must be one token dotted reads there, and is not offered again.
|
|
|
1787
1789
|
>>> dotted.get(d, 'merged[c.account]', resolver=Names())
|
|
1788
1790
|
2
|
|
1789
1791
|
|
|
1790
|
-
A token dotted reads, `m[$x]` or `|sub
|
|
1792
|
+
A token dotted reads, `m[$x]` or `|sub:$taken`, is never offered to `lex()`;
|
|
1791
1793
|
a host that means something else by one remaps it at run time, through
|
|
1792
1794
|
`literals`. `parse` takes `resolver=` too, and a path is cached per resolver
|
|
1793
1795
|
that lexes.
|
|
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
|
|
|
6
6
|
|
|
7
7
|
[project]
|
|
8
8
|
name = "dotted_notation"
|
|
9
|
-
version = "0.51.
|
|
9
|
+
version = "0.51.1"
|
|
10
10
|
description = "Dotted notation for safe nested data traversal with optional chaining, pattern matching, and transforms"
|
|
11
11
|
readme = "README.md"
|
|
12
12
|
requires-python = ">=3.6"
|
|
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
|
|
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.51.0 → dotted_notation-0.51.1}/dotted_notation.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|