csvpath 0.0.466__tar.gz → 0.0.468__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.
- {csvpath-0.0.466 → csvpath-0.0.468}/PKG-INFO +1 -1
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/csvpath.py +18 -1
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/counting/tally.py +5 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/function_factory.py +3 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/print/table.py +0 -1
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/strings/metaphone.py +1 -1
- csvpath-0.0.468/csvpath/matching/functions/strings/num.py +28 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/validation.py +5 -1
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/productions/reference.py +33 -4
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/scanning/scanner.py +10 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/pyproject.toml +1 -1
- {csvpath-0.0.466 → csvpath-0.0.468}/LICENSE +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/README.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/config/config.ini +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/__init__.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/csvpaths.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/managers/__init__.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/managers/csvpath_result.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/managers/csvpaths_manager.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/managers/files_manager.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/managers/results_manager.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/__init__.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/__init__.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/boolean/all.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/boolean/andf.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/boolean/any.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/boolean/between.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/boolean/empty.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/boolean/exists.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/boolean/inf.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/boolean/no.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/boolean/notf.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/boolean/orf.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/boolean/yes.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/counting/count.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/counting/count_headers.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/counting/count_lines.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/counting/count_scans.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/counting/every.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/counting/has_matches.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/counting/increment.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/counting/total_lines.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/dates/datef.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/dates/now.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/function.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/function_focus.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/headers/collect.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/headers/empty_stack.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/headers/end.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/headers/header_name.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/headers/header_names_mismatch.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/headers/headers.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/headers/mismatch.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/headers/replace.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/headers/reset_headers.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/lines/advance.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/lines/after_blank.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/lines/dups.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/lines/first.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/lines/first_line.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/lines/last.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/lines/stop.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/math/above.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/math/add.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/math/divide.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/math/equals.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/math/mod.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/math/multiply.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/math/round.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/math/subtract.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/math/sum.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/misc/importf.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/misc/intf.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/misc/nonef.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/misc/random.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/print/jinjaf.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/print/print_line.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/print/print_queue.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/print/printf.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/stats/correlate.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/stats/minf.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/stats/percent.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/stats/percent_unique.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/stats/stdev.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/strings/concat.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/strings/length.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/strings/lower.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/strings/regex.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/strings/starts_with.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/strings/strip.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/strings/substring.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/strings/upper.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/testing/debug.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/validity/fail.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/validity/failed.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/variables/get.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/variables/pushpop.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/variables/put.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/variables/track.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/variables/variables.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/lark_parser.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/lark_transformer.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/matcher.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/productions/__init__.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/productions/equality.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/productions/expression.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/productions/header.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/productions/matchable.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/productions/qualified.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/productions/term.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/productions/variable.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/util/exceptions.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/util/expression_encoder.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/util/expression_utility.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/util/lark_print_parser.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/util/print_parser.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/scanning/__init__.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/scanning/exceptions.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/scanning/parser.out +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/scanning/parsetab.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/scanning/scanning_lexer.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/util/config.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/util/config_exception.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/util/error.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/util/exceptions.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/util/last_line_stats.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/util/line_monitor.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/util/log_utility.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/util/metadata_parser.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/csvpath/util/printer.py +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/asbool.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/assignment.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/config.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/examples.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/files.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/above.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/advance.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/after_blank.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/all.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/andor.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/any.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/average.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/between.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/collect.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/correlate.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/count.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/count_headers.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/date.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/empty.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/empty_stack.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/end.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/every.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/fail.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/first.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/get.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/has_dups.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/header.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/header_name.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/header_names_mismatch.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/implementing_functions.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/import.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/in.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/increment.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/jinja.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/last.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/line_number.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/max.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/metaphone.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/mismatch.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/no.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/not.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/now.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/percent_unique.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/pop.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/print.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/print_line.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/print_queue.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/regex.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/replace.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/reset_headers.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/stdev.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/stop.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/string_functions.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/subtract.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/sum.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/tally.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/total_lines.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/track.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/variables.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions/variables_and_headers.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/functions.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/grammar.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/headers.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/images/logo-wordmark-white-on-black-trimmed-padded.png +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/images/logo-wordmark-white-trimmed.png +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/paths.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/qualifiers.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/references.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/terms.md +0 -0
- {csvpath-0.0.466 → csvpath-0.0.468}/docs/variables.md +0 -0
|
@@ -633,6 +633,13 @@ class CsvPath(CsvPathPublic, ErrorCollector): # pylint: disable=R0902, R0904
|
|
|
633
633
|
raise MatchException(msg)
|
|
634
634
|
yield line
|
|
635
635
|
if self.stopped:
|
|
636
|
+
self.logger.info(
|
|
637
|
+
"CsvPath has been stopped at line %s",
|
|
638
|
+
self.line_monitor.physical_line_number,
|
|
639
|
+
)
|
|
640
|
+
print(
|
|
641
|
+
f"CsvPath.next: self.stopped: {self.stopped} at {self.line_monitor.physical_line_number}"
|
|
642
|
+
)
|
|
636
643
|
break
|
|
637
644
|
self.finalize()
|
|
638
645
|
# moving to finalize
|
|
@@ -673,7 +680,8 @@ class CsvPath(CsvPathPublic, ErrorCollector): # pylint: disable=R0902, R0904
|
|
|
673
680
|
# this method can run multiple times w/np, but that
|
|
674
681
|
# shouldn't happen anyway.
|
|
675
682
|
self._freeze_path = True
|
|
676
|
-
self.matcher
|
|
683
|
+
if self.matcher:
|
|
684
|
+
self.matcher.clear_caches()
|
|
677
685
|
|
|
678
686
|
def track_line(self, line) -> None:
|
|
679
687
|
"""csvpaths needs to handle some of the iteration logic, and we don't want
|
|
@@ -728,6 +736,15 @@ class CsvPath(CsvPathPublic, ErrorCollector): # pylint: disable=R0902, R0904
|
|
|
728
736
|
self.logger.debug(
|
|
729
737
|
"CsvPath.matches:703: %s: matches: %s", self.identity, matches
|
|
730
738
|
)
|
|
739
|
+
#
|
|
740
|
+
# if we are done scanning we can stop
|
|
741
|
+
#
|
|
742
|
+
if self.scanner.is_last(self.line_monitor.physical_line_number):
|
|
743
|
+
pln = self.line_monitor.physical_line_number
|
|
744
|
+
print(
|
|
745
|
+
f"CsvPath._consider_line: stopping at {pln}? {self.scanner.is_last(pln)}"
|
|
746
|
+
)
|
|
747
|
+
self.stop()
|
|
731
748
|
if matches is True:
|
|
732
749
|
#
|
|
733
750
|
# _current_match_count is a placeholder that
|
|
@@ -36,6 +36,11 @@ class Tally(ValueProducer):
|
|
|
36
36
|
name = self.first_non_term_qualifier("tally")
|
|
37
37
|
else:
|
|
38
38
|
name = f"""{self.first_non_term_qualifier("tally")}_{name}"""
|
|
39
|
+
if f"{value}".strip() == "":
|
|
40
|
+
self.matcher.csvpath.logger.warn(
|
|
41
|
+
"Cannot store an empty tracking value in %s. >>%s<<", name, value
|
|
42
|
+
)
|
|
43
|
+
return
|
|
39
44
|
count = self.matcher.get_variable(name, tracking=value)
|
|
40
45
|
if count is None:
|
|
41
46
|
count = 0
|
|
@@ -11,6 +11,7 @@ from .strings.strip import Strip
|
|
|
11
11
|
from .strings.length import Length, MinMaxLength
|
|
12
12
|
from .strings.regex import Regex
|
|
13
13
|
from .strings.concat import Concat
|
|
14
|
+
from .strings.num import Num
|
|
14
15
|
from .strings.metaphone import Metaphone
|
|
15
16
|
from .counting.count import Count
|
|
16
17
|
from .counting.has_matches import HasMatches
|
|
@@ -357,6 +358,8 @@ class FunctionFactory:
|
|
|
357
358
|
f = VarTable(matcher, name, child)
|
|
358
359
|
elif name == "empty_stack":
|
|
359
360
|
f = EmptyStack(matcher, name, child)
|
|
361
|
+
elif name == "num":
|
|
362
|
+
f = Num(matcher, name, child)
|
|
360
363
|
|
|
361
364
|
else:
|
|
362
365
|
if (
|
|
@@ -10,7 +10,7 @@ class Metaphone(ValueProducer):
|
|
|
10
10
|
first arg and expects a reference in the second arg. the
|
|
11
11
|
reference must point to a lookup variable. the lookup variable
|
|
12
12
|
must be in the form: Dict[metaphone,canonical]. the most
|
|
13
|
-
likely way of creating that variable today is to use
|
|
13
|
+
likely way of creating that variable today is to use track(),
|
|
14
14
|
passing something like: tally(metaphone(#header), #header)"""
|
|
15
15
|
|
|
16
16
|
def check_valid(self) -> None:
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# pylint: disable=C0114
|
|
2
|
+
from csvpath.matching.productions import Term, Variable, Header
|
|
3
|
+
from csvpath.matching.util.expression_utility import ExpressionUtility
|
|
4
|
+
from ..function_focus import ValueProducer
|
|
5
|
+
from ..function import Function
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class Num(ValueProducer):
|
|
9
|
+
"""parses a string to a number, if possible"""
|
|
10
|
+
|
|
11
|
+
def check_valid(self) -> None:
|
|
12
|
+
self.validate_one_arg(types=[Term, Variable, Header, Function])
|
|
13
|
+
super().check_valid()
|
|
14
|
+
|
|
15
|
+
def _produce_value(self, skip=None) -> None:
|
|
16
|
+
value = self.children[0].to_value(skip=skip)
|
|
17
|
+
if value is None:
|
|
18
|
+
self.value = 0
|
|
19
|
+
elif isinstance(value, int):
|
|
20
|
+
self.value = value
|
|
21
|
+
elif isinstance(value, float):
|
|
22
|
+
self.value = value
|
|
23
|
+
else:
|
|
24
|
+
self.value = ExpressionUtility.to_float(value)
|
|
25
|
+
|
|
26
|
+
def _decide_match(self, skip=None) -> None:
|
|
27
|
+
self.to_value(skip=skip)
|
|
28
|
+
self.match = self._noop_match()
|
|
@@ -104,7 +104,9 @@ class Validation(Matchable):
|
|
|
104
104
|
raise ChildrenException(f"{self.name}()'s argument must be {first_arg}")
|
|
105
105
|
else:
|
|
106
106
|
if not self.children[0].op == ",":
|
|
107
|
-
raise ChildrenException(
|
|
107
|
+
raise ChildrenException(
|
|
108
|
+
f"{self.name}'s children opperation is incorrect"
|
|
109
|
+
)
|
|
108
110
|
if not self._class_match(self.children[0].left, first_arg):
|
|
109
111
|
raise ChildrenException(
|
|
110
112
|
f"{self.name}()'s first argument must be {first_arg}"
|
|
@@ -113,6 +115,8 @@ class Validation(Matchable):
|
|
|
113
115
|
raise ChildrenException(
|
|
114
116
|
f"{self.name}()'s second argument must be {second_arg}"
|
|
115
117
|
)
|
|
118
|
+
if len(self.children[0].children) > 2:
|
|
119
|
+
raise ChildrenException(f"{self.name} can have at most 2 args")
|
|
116
120
|
|
|
117
121
|
def validate_one_arg(self, types=None) -> None: # pylint: disable=C0116
|
|
118
122
|
if types is None:
|
|
@@ -24,7 +24,7 @@ class Reference(Matchable):
|
|
|
24
24
|
) # pragma: no cover
|
|
25
25
|
#
|
|
26
26
|
# references are in the form:
|
|
27
|
-
# $
|
|
27
|
+
# $path.(csvpath|metadata|variable|header).name[.tracking_name/index]
|
|
28
28
|
#
|
|
29
29
|
# results are always the most recent unless we pull specific results for a
|
|
30
30
|
# header ref using a tracking value against an "id" or "name" metadata
|
|
@@ -102,6 +102,28 @@ class Reference(Matchable):
|
|
|
102
102
|
self._cache_vars = self.value
|
|
103
103
|
return self.value
|
|
104
104
|
|
|
105
|
+
def data_type(self):
|
|
106
|
+
ref = self._get_reference()
|
|
107
|
+
return ref["var_or_header"]
|
|
108
|
+
|
|
109
|
+
def is_header(self):
|
|
110
|
+
return self.data_type() == "headers"
|
|
111
|
+
|
|
112
|
+
def is_variable(self):
|
|
113
|
+
return self.data_type() != "headers"
|
|
114
|
+
|
|
115
|
+
def data_name(self):
|
|
116
|
+
"""this is the name of the datum being referred to. however, it
|
|
117
|
+
is not the tracking value. that is on the "tracking" key in the ref."""
|
|
118
|
+
ref = self._get_reference()
|
|
119
|
+
return ref["name"]
|
|
120
|
+
|
|
121
|
+
def tracking_name(self):
|
|
122
|
+
"""this is the name of the tracking value."""
|
|
123
|
+
ref = self._get_reference()
|
|
124
|
+
return ref["tracking"]
|
|
125
|
+
|
|
126
|
+
""""
|
|
105
127
|
def _get_results(self):
|
|
106
128
|
cs = self.matcher.csvpath.csvpaths
|
|
107
129
|
if cs is None:
|
|
@@ -122,7 +144,6 @@ class Reference(Matchable):
|
|
|
122
144
|
#
|
|
123
145
|
results_list = cs.results_manager.get_named_results(ref["paths_name"])
|
|
124
146
|
if results_list and len(results_list) > 0:
|
|
125
|
-
# if self.ref["paths_name"] is None:
|
|
126
147
|
results = results_list[0]
|
|
127
148
|
# else:
|
|
128
149
|
# for r in results_list:
|
|
@@ -144,6 +165,7 @@ class Reference(Matchable):
|
|
|
144
165
|
#
|
|
145
166
|
raise MatchException("Results cannot be None for reference %s", self)
|
|
146
167
|
return results
|
|
168
|
+
"""
|
|
147
169
|
|
|
148
170
|
def _get_reference(self) -> Dict[str, str]:
|
|
149
171
|
if self.ref is None:
|
|
@@ -197,6 +219,11 @@ class Reference(Matchable):
|
|
|
197
219
|
return ret
|
|
198
220
|
|
|
199
221
|
def _header_value(self) -> Any:
|
|
222
|
+
ref = self._get_reference()
|
|
223
|
+
r = self.get_results()
|
|
224
|
+
return self._get_value_from_results(ref, r)
|
|
225
|
+
|
|
226
|
+
def get_results(self) -> Any:
|
|
200
227
|
ref = self._get_reference()
|
|
201
228
|
name = ref["paths_name"]
|
|
202
229
|
rm = self.matcher.csvpath.csvpaths.results_manager
|
|
@@ -207,7 +234,8 @@ class Reference(Matchable):
|
|
|
207
234
|
#
|
|
208
235
|
if rm.get_number_of_results(name) == 1:
|
|
209
236
|
rs = rm.get_named_results(name)
|
|
210
|
-
|
|
237
|
+
return rs[0]
|
|
238
|
+
# ret = self._get_value_from_results(ref, rs[0])
|
|
211
239
|
elif ref["tracking"]:
|
|
212
240
|
#
|
|
213
241
|
# find the specific path if we have a tracking value.
|
|
@@ -223,7 +251,8 @@ class Reference(Matchable):
|
|
|
223
251
|
ref["tracking"],
|
|
224
252
|
self,
|
|
225
253
|
)
|
|
226
|
-
ret = self._get_value_from_results(ref, r)
|
|
254
|
+
# ret = self._get_value_from_results(ref, r)
|
|
255
|
+
return r
|
|
227
256
|
else:
|
|
228
257
|
#
|
|
229
258
|
# are we really going to aggregate all the values from all the
|
|
@@ -53,6 +53,16 @@ class Scanner: # pylint: disable=R0902
|
|
|
53
53
|
to_line = self.to_line if to_line == -1 else to_line
|
|
54
54
|
all_lines = self.all_lines if all_lines is None else all_lines
|
|
55
55
|
these = self.these if these is None else these
|
|
56
|
+
#
|
|
57
|
+
# what if from is > to? shouldn't be but we originally wanted
|
|
58
|
+
# to support that, way back, so we can do this swap.
|
|
59
|
+
#
|
|
60
|
+
if from_line and to_line and from_line > to_line:
|
|
61
|
+
_ = from_line
|
|
62
|
+
from_line = to_line
|
|
63
|
+
to_line = _
|
|
64
|
+
|
|
65
|
+
# end exp
|
|
56
66
|
if all_lines:
|
|
57
67
|
return (
|
|
58
68
|
line == self.csvpath.line_monitor.physical_end_line_number
|
|
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
|
|
File without changes
|
|
File without changes
|
{csvpath-0.0.466 → csvpath-0.0.468}/csvpath/matching/functions/headers/header_names_mismatch.py
RENAMED
|
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
|
|
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
|
|
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
|
|
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
|
{csvpath-0.0.466 → csvpath-0.0.468}/docs/images/logo-wordmark-white-on-black-trimmed-padded.png
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|