dotted-notation 0.49.0__tar.gz → 0.49.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.49.0 → dotted_notation-0.49.1}/CHANGELOG.md +9 -0
- {dotted_notation-0.49.0/dotted_notation.egg-info → dotted_notation-0.49.1}/PKG-INFO +20 -5
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/README.md +19 -4
- {dotted_notation-0.49.0 → dotted_notation-0.49.1/dotted_notation.egg-info}/PKG-INFO +20 -5
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/pyproject.toml +1 -1
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/setup.py +15 -1
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/LICENSE +0 -0
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/MANIFEST.in +0 -0
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/dotted/__init__.py +0 -0
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/dotted/__main__.py +0 -0
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/dotted/access.pxd +0 -0
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/dotted/access.py +0 -0
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/dotted/api.py +0 -0
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/dotted/base.pxd +0 -0
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/dotted/base.py +0 -0
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/dotted/cli/__init__.py +0 -0
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/dotted/cli/_compat.py +0 -0
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/dotted/cli/formats.py +0 -0
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/dotted/cli/main.py +0 -0
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/dotted/containers.py +0 -0
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/dotted/engine.pxd +0 -0
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/dotted/engine.py +0 -0
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/dotted/filters.pxd +0 -0
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/dotted/filters.py +0 -0
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/dotted/grammar.py +0 -0
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/dotted/groups.pxd +0 -0
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/dotted/groups.py +0 -0
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/dotted/matchers.pxd +0 -0
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/dotted/matchers.py +0 -0
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/dotted/native.py +0 -0
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/dotted/predicates.py +0 -0
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/dotted/recursive.pxd +0 -0
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/dotted/recursive.py +0 -0
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/dotted/results.py +0 -0
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/dotted/sql/__init__.py +0 -0
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/dotted/sql/core.py +0 -0
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/dotted/sql/pg.py +0 -0
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/dotted/transforms.py +0 -0
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/dotted/utils.py +0 -0
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/dotted/utypes.py +0 -0
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/dotted/wrappers.pxd +0 -0
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/dotted/wrappers.py +0 -0
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/dotted_notation.egg-info/SOURCES.txt +0 -0
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/dotted_notation.egg-info/dependency_links.txt +0 -0
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/dotted_notation.egg-info/entry_points.txt +0 -0
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/dotted_notation.egg-info/requires.txt +0 -0
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/dotted_notation.egg-info/top_level.txt +0 -0
- {dotted_notation-0.49.0 → dotted_notation-0.49.1}/setup.cfg +0 -0
|
@@ -3,6 +3,15 @@
|
|
|
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.49.1]
|
|
7
|
+
|
|
8
|
+
### Documentation
|
|
9
|
+
- The README describes a reference, `$$(expr)`, as an inline evaluation
|
|
10
|
+
expression: the dotted expression inside, transforms included, is
|
|
11
|
+
evaluated during traversal and its value stands where it is written. In a
|
|
12
|
+
transform argument, guard or filter value that is the value itself; in an
|
|
13
|
+
access position it is the key looked up.
|
|
14
|
+
|
|
6
15
|
## [0.49.0]
|
|
7
16
|
|
|
8
17
|
### Added
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dotted_notation
|
|
3
|
-
Version: 0.49.
|
|
3
|
+
Version: 0.49.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
|
|
@@ -1396,7 +1396,8 @@ To chain through the items, use a pattern instead:
|
|
|
1396
1396
|
## Substitutions and References
|
|
1397
1397
|
|
|
1398
1398
|
All `$`-prefixed syntax falls into two categories: **substitutions** (resolved
|
|
1399
|
-
at replace time) and **references
|
|
1399
|
+
at replace time) and **references**, inline expressions evaluated during
|
|
1400
|
+
traversal.
|
|
1400
1401
|
|
|
1401
1402
|
| Syntax | Type | Resolved against |
|
|
1402
1403
|
|---|---|---|
|
|
@@ -1502,14 +1503,22 @@ the parsed result, so a path used many times can be compiled once:
|
|
|
1502
1503
|
<a id="references"></a>
|
|
1503
1504
|
### References
|
|
1504
1505
|
|
|
1505
|
-
A **reference
|
|
1506
|
-
|
|
1506
|
+
A **reference**, `$$(expr)`, is an inline evaluation expression. The dotted
|
|
1507
|
+
expression inside is evaluated during traversal, as `get` would evaluate it
|
|
1508
|
+
against the root, and its value stands where the reference is written. The
|
|
1509
|
+
expression is a full dotted path, so it may carry patterns and transforms:
|
|
1510
|
+
`$$(config.offset|mul:10)` is the value of `config.offset`, times ten.
|
|
1511
|
+
|
|
1512
|
+
Where the reference stands decides what its value does. In a transform
|
|
1513
|
+
argument, a guard value or a filter value it is the value itself (see
|
|
1514
|
+
[References in transforms and guards](#references-in-transforms-and-guards)).
|
|
1515
|
+
In an access position, as a key or slot, it is the key to look up:
|
|
1507
1516
|
|
|
1508
1517
|
>>> data = {'config': {'field': 'name'}, 'name': 'Alice'}
|
|
1509
1518
|
>>> dotted.get(data, '$$(config.field)')
|
|
1510
1519
|
'Alice'
|
|
1511
1520
|
|
|
1512
|
-
Here `$$(config.field)`
|
|
1521
|
+
Here `$$(config.field)` evaluates to `'name'`, then looks up `data['name']`.
|
|
1513
1522
|
|
|
1514
1523
|
References work with all access types and in any position:
|
|
1515
1524
|
|
|
@@ -1606,6 +1615,12 @@ and so on:
|
|
|
1606
1615
|
>>> dotted.get(data, 'n|add:$$(config.offset)')
|
|
1607
1616
|
15
|
|
1608
1617
|
|
|
1618
|
+
The expression inside may chain transforms of its own; they apply to its value
|
|
1619
|
+
before it is passed:
|
|
1620
|
+
|
|
1621
|
+
>>> dotted.get(data, 'n|add:$$(config.offset|mul:10)')
|
|
1622
|
+
105
|
|
1623
|
+
|
|
1609
1624
|
>>> data = {'items': [{'price': 100, 'rate': 1.5}, {'price': 20, 'rate': 2}]}
|
|
1610
1625
|
>>> dotted.get(data, 'items[*].price|mul:$$(^^rate)')
|
|
1611
1626
|
(150.0, 40)
|
|
@@ -1349,7 +1349,8 @@ To chain through the items, use a pattern instead:
|
|
|
1349
1349
|
## Substitutions and References
|
|
1350
1350
|
|
|
1351
1351
|
All `$`-prefixed syntax falls into two categories: **substitutions** (resolved
|
|
1352
|
-
at replace time) and **references
|
|
1352
|
+
at replace time) and **references**, inline expressions evaluated during
|
|
1353
|
+
traversal.
|
|
1353
1354
|
|
|
1354
1355
|
| Syntax | Type | Resolved against |
|
|
1355
1356
|
|---|---|---|
|
|
@@ -1455,14 +1456,22 @@ the parsed result, so a path used many times can be compiled once:
|
|
|
1455
1456
|
<a id="references"></a>
|
|
1456
1457
|
### References
|
|
1457
1458
|
|
|
1458
|
-
A **reference
|
|
1459
|
-
|
|
1459
|
+
A **reference**, `$$(expr)`, is an inline evaluation expression. The dotted
|
|
1460
|
+
expression inside is evaluated during traversal, as `get` would evaluate it
|
|
1461
|
+
against the root, and its value stands where the reference is written. The
|
|
1462
|
+
expression is a full dotted path, so it may carry patterns and transforms:
|
|
1463
|
+
`$$(config.offset|mul:10)` is the value of `config.offset`, times ten.
|
|
1464
|
+
|
|
1465
|
+
Where the reference stands decides what its value does. In a transform
|
|
1466
|
+
argument, a guard value or a filter value it is the value itself (see
|
|
1467
|
+
[References in transforms and guards](#references-in-transforms-and-guards)).
|
|
1468
|
+
In an access position, as a key or slot, it is the key to look up:
|
|
1460
1469
|
|
|
1461
1470
|
>>> data = {'config': {'field': 'name'}, 'name': 'Alice'}
|
|
1462
1471
|
>>> dotted.get(data, '$$(config.field)')
|
|
1463
1472
|
'Alice'
|
|
1464
1473
|
|
|
1465
|
-
Here `$$(config.field)`
|
|
1474
|
+
Here `$$(config.field)` evaluates to `'name'`, then looks up `data['name']`.
|
|
1466
1475
|
|
|
1467
1476
|
References work with all access types and in any position:
|
|
1468
1477
|
|
|
@@ -1559,6 +1568,12 @@ and so on:
|
|
|
1559
1568
|
>>> dotted.get(data, 'n|add:$$(config.offset)')
|
|
1560
1569
|
15
|
|
1561
1570
|
|
|
1571
|
+
The expression inside may chain transforms of its own; they apply to its value
|
|
1572
|
+
before it is passed:
|
|
1573
|
+
|
|
1574
|
+
>>> dotted.get(data, 'n|add:$$(config.offset|mul:10)')
|
|
1575
|
+
105
|
|
1576
|
+
|
|
1562
1577
|
>>> data = {'items': [{'price': 100, 'rate': 1.5}, {'price': 20, 'rate': 2}]}
|
|
1563
1578
|
>>> dotted.get(data, 'items[*].price|mul:$$(^^rate)')
|
|
1564
1579
|
(150.0, 40)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dotted_notation
|
|
3
|
-
Version: 0.49.
|
|
3
|
+
Version: 0.49.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
|
|
@@ -1396,7 +1396,8 @@ To chain through the items, use a pattern instead:
|
|
|
1396
1396
|
## Substitutions and References
|
|
1397
1397
|
|
|
1398
1398
|
All `$`-prefixed syntax falls into two categories: **substitutions** (resolved
|
|
1399
|
-
at replace time) and **references
|
|
1399
|
+
at replace time) and **references**, inline expressions evaluated during
|
|
1400
|
+
traversal.
|
|
1400
1401
|
|
|
1401
1402
|
| Syntax | Type | Resolved against |
|
|
1402
1403
|
|---|---|---|
|
|
@@ -1502,14 +1503,22 @@ the parsed result, so a path used many times can be compiled once:
|
|
|
1502
1503
|
<a id="references"></a>
|
|
1503
1504
|
### References
|
|
1504
1505
|
|
|
1505
|
-
A **reference
|
|
1506
|
-
|
|
1506
|
+
A **reference**, `$$(expr)`, is an inline evaluation expression. The dotted
|
|
1507
|
+
expression inside is evaluated during traversal, as `get` would evaluate it
|
|
1508
|
+
against the root, and its value stands where the reference is written. The
|
|
1509
|
+
expression is a full dotted path, so it may carry patterns and transforms:
|
|
1510
|
+
`$$(config.offset|mul:10)` is the value of `config.offset`, times ten.
|
|
1511
|
+
|
|
1512
|
+
Where the reference stands decides what its value does. In a transform
|
|
1513
|
+
argument, a guard value or a filter value it is the value itself (see
|
|
1514
|
+
[References in transforms and guards](#references-in-transforms-and-guards)).
|
|
1515
|
+
In an access position, as a key or slot, it is the key to look up:
|
|
1507
1516
|
|
|
1508
1517
|
>>> data = {'config': {'field': 'name'}, 'name': 'Alice'}
|
|
1509
1518
|
>>> dotted.get(data, '$$(config.field)')
|
|
1510
1519
|
'Alice'
|
|
1511
1520
|
|
|
1512
|
-
Here `$$(config.field)`
|
|
1521
|
+
Here `$$(config.field)` evaluates to `'name'`, then looks up `data['name']`.
|
|
1513
1522
|
|
|
1514
1523
|
References work with all access types and in any position:
|
|
1515
1524
|
|
|
@@ -1606,6 +1615,12 @@ and so on:
|
|
|
1606
1615
|
>>> dotted.get(data, 'n|add:$$(config.offset)')
|
|
1607
1616
|
15
|
|
1608
1617
|
|
|
1618
|
+
The expression inside may chain transforms of its own; they apply to its value
|
|
1619
|
+
before it is passed:
|
|
1620
|
+
|
|
1621
|
+
>>> dotted.get(data, 'n|add:$$(config.offset|mul:10)')
|
|
1622
|
+
105
|
|
1623
|
+
|
|
1609
1624
|
>>> data = {'items': [{'price': 100, 'rate': 1.5}, {'price': 20, 'rate': 2}]}
|
|
1610
1625
|
>>> dotted.get(data, 'items[*].price|mul:$$(^^rate)')
|
|
1611
1626
|
(150.0, 40)
|
|
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
|
|
|
6
6
|
|
|
7
7
|
[project]
|
|
8
8
|
name = "dotted_notation"
|
|
9
|
-
version = "0.49.
|
|
9
|
+
version = "0.49.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"
|
|
@@ -11,6 +11,7 @@ same files run as Python.
|
|
|
11
11
|
import os
|
|
12
12
|
|
|
13
13
|
from setuptools import Extension, setup
|
|
14
|
+
from setuptools.command.build_ext import build_ext as _build_ext
|
|
14
15
|
|
|
15
16
|
# The engine and the ops it runs. grammar.py, the parser, is left out on
|
|
16
17
|
# purpose: pyparsing inspects its parse actions as Python functions.
|
|
@@ -47,7 +48,20 @@ def extensions():
|
|
|
47
48
|
return cythonize(
|
|
48
49
|
[Extension('dotted.' + name, ['dotted/' + name + '.py'], optional=True) for name in MODULES],
|
|
49
50
|
compiler_directives={'language_level': 3},
|
|
51
|
+
nthreads=os.cpu_count() or 1,
|
|
50
52
|
)
|
|
51
53
|
|
|
52
54
|
|
|
53
|
-
|
|
55
|
+
class build_ext(_build_ext):
|
|
56
|
+
"""
|
|
57
|
+
Compile the extensions one per core. setuptools builds them one after
|
|
58
|
+
another unless -j is given; the modules are independent, so a release
|
|
59
|
+
wheel compiles in a fraction of the time on a multi-core runner.
|
|
60
|
+
"""
|
|
61
|
+
def finalize_options(self):
|
|
62
|
+
super().finalize_options()
|
|
63
|
+
if self.parallel is None:
|
|
64
|
+
self.parallel = os.cpu_count() or 1
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
setup(ext_modules=extensions(), cmdclass={'build_ext': build_ext})
|
|
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
|
|
File without changes
|
|
File without changes
|
{dotted_notation-0.49.0 → dotted_notation-0.49.1}/dotted_notation.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|