csvpath 0.0.494__tar.gz → 0.0.496__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.
Files changed (249) hide show
  1. {csvpath-0.0.494 → csvpath-0.0.496}/PKG-INFO +1 -1
  2. {csvpath-0.0.494 → csvpath-0.0.496}/config/config.ini +5 -0
  3. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/csvpath.py +129 -233
  4. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/csvpaths.py +125 -24
  5. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/managers/file_manager.py +13 -1
  6. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/managers/file_registrar.py +1 -1
  7. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/managers/line_spooler.py +8 -0
  8. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/managers/paths_registrar.py +1 -1
  9. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/managers/result.py +28 -8
  10. csvpath-0.0.496/csvpath/managers/result_registrar.py +129 -0
  11. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/managers/result_serializer.py +27 -9
  12. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/managers/results_manager.py +80 -3
  13. csvpath-0.0.496/csvpath/managers/results_registrar.py +69 -0
  14. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/args.py +13 -1
  15. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/function.py +2 -2
  16. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/strings/regex.py +4 -4
  17. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/productions/expression.py +7 -2
  18. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/util/runtime_data_collector.py +58 -2
  19. csvpath-0.0.496/csvpath/modes/explain_mode.py +41 -0
  20. csvpath-0.0.496/csvpath/modes/files_mode.py +61 -0
  21. csvpath-0.0.496/csvpath/modes/logic_mode.py +66 -0
  22. csvpath-0.0.496/csvpath/modes/mode_controller.py +70 -0
  23. csvpath-0.0.496/csvpath/modes/print_mode.py +57 -0
  24. csvpath-0.0.496/csvpath/modes/return_mode.py +46 -0
  25. csvpath-0.0.496/csvpath/modes/run_mode.py +43 -0
  26. csvpath-0.0.496/csvpath/modes/source_mode.py +25 -0
  27. csvpath-0.0.496/csvpath/modes/transfer_mode.py +46 -0
  28. csvpath-0.0.496/csvpath/modes/unmatched_mode.py +30 -0
  29. csvpath-0.0.496/csvpath/modes/validation_mode.py +165 -0
  30. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/util/config.py +33 -1
  31. csvpath-0.0.496/csvpath/util/csvpaths_registrar.py +99 -0
  32. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/util/error.py +4 -4
  33. {csvpath-0.0.494 → csvpath-0.0.496}/pyproject.toml +1 -1
  34. {csvpath-0.0.494 → csvpath-0.0.496}/LICENSE +0 -0
  35. {csvpath-0.0.494 → csvpath-0.0.496}/README.md +0 -0
  36. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/__init__.py +0 -0
  37. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/cli/__init__.py +0 -0
  38. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/cli/cli.py +0 -0
  39. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/cli/drill_down.py +0 -0
  40. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/managers/__init__.py +0 -0
  41. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/managers/paths_manager.py +0 -0
  42. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/__init__.py +0 -0
  43. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/__init__.py +0 -0
  44. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/boolean/all.py +0 -0
  45. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/boolean/andf.py +0 -0
  46. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/boolean/any.py +0 -0
  47. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/boolean/between.py +0 -0
  48. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/boolean/empty.py +0 -0
  49. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/boolean/exists.py +0 -0
  50. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/boolean/inf.py +0 -0
  51. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/boolean/no.py +0 -0
  52. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/boolean/notf.py +0 -0
  53. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/boolean/orf.py +0 -0
  54. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/boolean/yes.py +0 -0
  55. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/counting/count.py +0 -0
  56. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/counting/count_bytes.py +0 -0
  57. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/counting/count_headers.py +0 -0
  58. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/counting/count_lines.py +0 -0
  59. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/counting/count_scans.py +0 -0
  60. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/counting/counter.py +0 -0
  61. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/counting/every.py +0 -0
  62. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/counting/has_matches.py +0 -0
  63. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/counting/increment.py +0 -0
  64. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/counting/tally.py +0 -0
  65. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/counting/total_lines.py +0 -0
  66. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/dates/now.py +0 -0
  67. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/function_factory.py +0 -0
  68. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/function_finder.py +0 -0
  69. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/function_focus.py +0 -0
  70. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/headers/append.py +0 -0
  71. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/headers/collect.py +0 -0
  72. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/headers/empty_stack.py +0 -0
  73. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/headers/end.py +0 -0
  74. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/headers/header_name.py +0 -0
  75. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/headers/header_names_mismatch.py +0 -0
  76. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/headers/headers.py +0 -0
  77. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/headers/mismatch.py +0 -0
  78. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/headers/replace.py +0 -0
  79. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/headers/reset_headers.py +0 -0
  80. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/lines/advance.py +0 -0
  81. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/lines/after_blank.py +0 -0
  82. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/lines/dups.py +0 -0
  83. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/lines/first.py +0 -0
  84. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/lines/first_line.py +0 -0
  85. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/lines/last.py +0 -0
  86. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/lines/stop.py +0 -0
  87. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/math/above.py +0 -0
  88. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/math/add.py +0 -0
  89. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/math/divide.py +0 -0
  90. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/math/equals.py +0 -0
  91. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/math/intf.py +0 -0
  92. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/math/mod.py +0 -0
  93. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/math/multiply.py +0 -0
  94. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/math/round.py +0 -0
  95. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/math/subtotal.py +0 -0
  96. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/math/subtract.py +0 -0
  97. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/math/sum.py +0 -0
  98. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/misc/fingerprint.py +0 -0
  99. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/misc/importf.py +0 -0
  100. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/misc/random.py +0 -0
  101. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/print/jinjaf.py +0 -0
  102. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/print/print_line.py +0 -0
  103. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/print/print_queue.py +0 -0
  104. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/print/printf.py +0 -0
  105. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/print/table.py +0 -0
  106. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/stats/minf.py +0 -0
  107. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/stats/percent.py +0 -0
  108. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/stats/percent_unique.py +0 -0
  109. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/stats/stdev.py +0 -0
  110. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/strings/concat.py +0 -0
  111. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/strings/length.py +0 -0
  112. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/strings/lower.py +0 -0
  113. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/strings/metaphone.py +0 -0
  114. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/strings/starts_with.py +0 -0
  115. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/strings/strip.py +0 -0
  116. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/strings/substring.py +0 -0
  117. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/strings/upper.py +0 -0
  118. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/testing/debug.py +0 -0
  119. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/types/__init__.py +0 -0
  120. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/types/boolean.py +0 -0
  121. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/types/datef.py +0 -0
  122. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/types/decimal.py +0 -0
  123. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/types/nonef.py +0 -0
  124. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/types/string.py +0 -0
  125. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/types/type.py +0 -0
  126. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/validity/fail.py +0 -0
  127. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/validity/failed.py +0 -0
  128. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/validity/line.py +0 -0
  129. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/variables/get.py +0 -0
  130. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/variables/pushpop.py +0 -0
  131. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/variables/put.py +0 -0
  132. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/variables/track.py +0 -0
  133. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/functions/variables/variables.py +0 -0
  134. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/lark_parser.py +0 -0
  135. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/lark_transformer.py +0 -0
  136. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/matcher.py +0 -0
  137. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/productions/__init__.py +0 -0
  138. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/productions/equality.py +0 -0
  139. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/productions/header.py +0 -0
  140. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/productions/matchable.py +0 -0
  141. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/productions/qualified.py +0 -0
  142. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/productions/reference.py +0 -0
  143. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/productions/term.py +0 -0
  144. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/productions/variable.py +0 -0
  145. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/util/exceptions.py +0 -0
  146. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/util/expression_encoder.py +0 -0
  147. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/util/expression_utility.py +0 -0
  148. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/util/lark_print_parser.py +0 -0
  149. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/matching/util/print_parser.py +0 -0
  150. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/scanning/__init__.py +0 -0
  151. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/scanning/exceptions.py +0 -0
  152. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/scanning/parser.out +0 -0
  153. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/scanning/parsetab.py +0 -0
  154. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/scanning/scanner.py +0 -0
  155. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/scanning/scanning_lexer.py +0 -0
  156. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/util/cache.py +0 -0
  157. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/util/config_exception.py +0 -0
  158. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/util/exceptions.py +0 -0
  159. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/util/file_readers.py +0 -0
  160. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/util/last_line_stats.py +0 -0
  161. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/util/line_counter.py +0 -0
  162. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/util/line_monitor.py +0 -0
  163. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/util/log_utility.py +0 -0
  164. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/util/metadata_parser.py +0 -0
  165. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/util/pandas_data_reader.py +0 -0
  166. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/util/printer.py +0 -0
  167. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/util/reference_parser.py +0 -0
  168. {csvpath-0.0.494 → csvpath-0.0.496}/csvpath/util/s3_data_reader.py +0 -0
  169. {csvpath-0.0.494 → csvpath-0.0.496}/docs/asbool.md +0 -0
  170. {csvpath-0.0.494 → csvpath-0.0.496}/docs/assignment.md +0 -0
  171. {csvpath-0.0.494 → csvpath-0.0.496}/docs/comments.md +0 -0
  172. {csvpath-0.0.494 → csvpath-0.0.496}/docs/config.md +0 -0
  173. {csvpath-0.0.494 → csvpath-0.0.496}/docs/examples.md +0 -0
  174. {csvpath-0.0.494 → csvpath-0.0.496}/docs/files.md +0 -0
  175. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/above.md +0 -0
  176. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/advance.md +0 -0
  177. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/after_blank.md +0 -0
  178. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/all.md +0 -0
  179. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/andor.md +0 -0
  180. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/any.md +0 -0
  181. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/average.md +0 -0
  182. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/between.md +0 -0
  183. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/collect.md +0 -0
  184. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/correlate.md +0 -0
  185. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/count.md +0 -0
  186. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/count_bytes.md +0 -0
  187. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/count_headers.md +0 -0
  188. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/counter.md +0 -0
  189. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/date.md +0 -0
  190. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/empty.md +0 -0
  191. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/empty_stack.md +0 -0
  192. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/end.md +0 -0
  193. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/every.md +0 -0
  194. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/fail.md +0 -0
  195. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/fingerprint.md +0 -0
  196. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/first.md +0 -0
  197. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/get.md +0 -0
  198. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/has_dups.md +0 -0
  199. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/has_matches.md +0 -0
  200. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/header.md +0 -0
  201. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/header_name.md +0 -0
  202. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/header_names_mismatch.md +0 -0
  203. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/implementing_functions.md +0 -0
  204. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/import.md +0 -0
  205. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/in.md +0 -0
  206. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/increment.md +0 -0
  207. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/intf.md +0 -0
  208. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/jinja.md +0 -0
  209. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/last.md +0 -0
  210. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/line.md +0 -0
  211. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/line_number.md +0 -0
  212. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/max.md +0 -0
  213. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/metaphone.md +0 -0
  214. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/mismatch.md +0 -0
  215. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/no.md +0 -0
  216. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/not.md +0 -0
  217. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/now.md +0 -0
  218. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/percent_unique.md +0 -0
  219. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/pop.md +0 -0
  220. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/print.md +0 -0
  221. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/print_line.md +0 -0
  222. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/print_queue.md +0 -0
  223. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/random.md +0 -0
  224. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/regex.md +0 -0
  225. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/replace.md +0 -0
  226. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/reset_headers.md +0 -0
  227. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/stdev.md +0 -0
  228. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/stop.md +0 -0
  229. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/string_functions.md +0 -0
  230. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/subtotal.md +0 -0
  231. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/subtract.md +0 -0
  232. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/sum.md +0 -0
  233. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/tally.md +0 -0
  234. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/total_lines.md +0 -0
  235. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/track.md +0 -0
  236. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/types.md +0 -0
  237. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/variables.md +0 -0
  238. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions/variables_and_headers.md +0 -0
  239. {csvpath-0.0.494 → csvpath-0.0.496}/docs/functions.md +0 -0
  240. {csvpath-0.0.494 → csvpath-0.0.496}/docs/grammar.md +0 -0
  241. {csvpath-0.0.494 → csvpath-0.0.496}/docs/headers.md +0 -0
  242. {csvpath-0.0.494 → csvpath-0.0.496}/docs/images/logo-wordmark-white-on-black-trimmed-padded.png +0 -0
  243. {csvpath-0.0.494 → csvpath-0.0.496}/docs/images/logo-wordmark-white-trimmed.png +0 -0
  244. {csvpath-0.0.494 → csvpath-0.0.496}/docs/paths.md +0 -0
  245. {csvpath-0.0.494 → csvpath-0.0.496}/docs/printing.md +0 -0
  246. {csvpath-0.0.494 → csvpath-0.0.496}/docs/qualifiers.md +0 -0
  247. {csvpath-0.0.494 → csvpath-0.0.496}/docs/references.md +0 -0
  248. {csvpath-0.0.494 → csvpath-0.0.496}/docs/terms.md +0 -0
  249. {csvpath-0.0.494 → csvpath-0.0.496}/docs/variables.md +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: csvpath
3
- Version: 0.0.494
3
+ Version: 0.0.496
4
4
  Summary: A declarative language for validating CSV, Excel, and other tabular data files
5
5
  Author: David Kershaw
6
6
  Author-email: dk107dk@hotmail.com
@@ -27,3 +27,8 @@ imports = config/functions.imports
27
27
  [results]
28
28
  archive = archive
29
29
 
30
+ [inputs]
31
+ files = inputs/named_files
32
+ csvpaths = inputs/named_paths
33
+ on_unmatched_file_fingerprints = halt
34
+
@@ -29,6 +29,7 @@ from .matching.util.exceptions import MatchException
29
29
  from csvpath.util.printer import Printer
30
30
  from csvpath.util.file_readers import DataFileReader
31
31
  from csvpath.managers.line_spooler import LineSpooler, ListLineSpooler
32
+ from csvpath.modes.mode_controller import ModeController
32
33
 
33
34
 
34
35
  class CsvPathPublic(ABC):
@@ -110,12 +111,17 @@ class CsvPath(CsvPathPublic, ErrorCollector, Printer): # pylint: disable=R0902,
110
111
  # a parent CsvPaths may manage a CsvPath instance. if so, it will enable
111
112
  # the use of named files and named paths, print capture, error handling,
112
113
  # results collection, reference handling, etc. if a CsvPaths is not present
113
- # the CsvPath instance is responsible for all its own upkeep and does not have
114
- # some of those capabilities.
114
+ # the CsvPath instance is responsible for all its own upkeep and does not
115
+ # have some of those capabilities.
115
116
  #
116
117
  self.csvpaths = csvpaths
117
118
  #
119
+ # modes are set in external comments
118
120
  #
121
+ self.modes = ModeController(self)
122
+ #
123
+ # captures the number of lines up front and tracks line stats as the
124
+ # run progresses
119
125
  #
120
126
  self._line_monitor = None
121
127
  #
@@ -127,27 +133,14 @@ class CsvPath(CsvPathPublic, ErrorCollector, Printer): # pylint: disable=R0902,
127
133
  #
128
134
  self.match = None
129
135
  #
130
- # when AND is True we do a logical AND of the match components
131
- # to see if there is a match. this is the default. when AND is
132
- # False (or set OR to True) the match components are ORed to
133
- # determine if a line matches. in the former case all the match
134
- # components must agree for a line to match. in the latter case,
135
- # if any one match component votes True the line is matched.
136
- # technically you can switch from AND to OR, or vice versa, in
137
- # the middle of iterating a file using next(). probably not a
138
- # good idea, tho.
139
- #
140
- self._AND = True # pylint: disable=C0103
141
- #
142
136
  # when True the lines that do not match are returned from next()
143
137
  # and collect(). this effectively switches CsvPath from being an
144
- # AND machine to being a NOT AND machine. we do not actually
145
138
  # create an OR expression in this case. in the default, we say:
146
139
  # are all of these things true?
147
140
  # but when collect_when_not_matched is True we ask:
148
141
  # are any of these things not true?
149
142
  #
150
- self._when_not_matched = False
143
+ # self._when_not_matched = False
151
144
  self._headers = None
152
145
  self.variables: Dict[str, Any] = {}
153
146
  self.delimiter = delimiter
@@ -169,16 +162,6 @@ class CsvPath(CsvPathPublic, ErrorCollector, Printer): # pylint: disable=R0902,
169
162
  #
170
163
  self._freeze_path = False
171
164
  #
172
- # explain-mode: explain
173
- # turns on capturing match reasoning and dumps the captured decisions to INFO
174
- # at the end of a match. the reasoning is already present in the DEBUG but it
175
- # is harder to see amid all the noise. we don't want to dump explainations
176
- # all the time tho because it is very expensive -- potentially 25% worse
177
- # performance. the explainations could be improved. atm this is an experimental
178
- # feature.
179
- #
180
- self._explain = False
181
- #
182
165
  # counts are 1-based
183
166
  #
184
167
  self.scan_count = 0
@@ -272,30 +255,6 @@ class CsvPath(CsvPathPublic, ErrorCollector, Printer): # pylint: disable=R0902,
272
255
  # way.
273
256
  self._config = config
274
257
  #
275
- # these settings determine how we report function args validation
276
- # errors. e.g. if print(True) the validation check fails because
277
- # print() expects a string. the more recent trend is to get all
278
- # the errors and print statements in the same place controlled by
279
- # the same properties. for now this stays because there is a minor
280
- # benefit to being able to suppress runtime arg validation and only
281
- # use match component rules and exceptions to generate validation
282
- # info. but long term this capability may go away.
283
- #
284
- self._log_validation_errors = True
285
- self._print_validation_errors = True
286
- self._raise_validation_errors = None
287
- self._match_validation_errors = None
288
- self._stop_on_validation_errors = None
289
- self._fail_on_validation_errors = None
290
- #
291
- # run mode determines if a csvpath gets run or if it is skipped. the
292
- # main reasons to set run-mode: no-run vs. run are: you want to import
293
- # it into other csvpaths that are in the same named-paths group, or
294
- # you want to switch off a csvpath in a named-paths group for testing
295
- # a similar reason.
296
- #
297
- self._run_mode = True
298
- #
299
258
  # there are two logger components one for CsvPath and one for CsvPaths.
300
259
  # the default levels are set in config.ini. to change the levels pass LogUtility
301
260
  # your component instance and the logging level. e.g.:
@@ -304,23 +263,31 @@ class CsvPath(CsvPathPublic, ErrorCollector, Printer): # pylint: disable=R0902,
304
263
  self.logger = LogUtility.logger(self)
305
264
  self.logger.info("initialized CsvPath")
306
265
  self._ecoms = ErrorCommsManager(csvpath=self)
266
+ #
267
+ # _function_times_match collects the time a function spends doing its matches()
268
+ #
307
269
  self._function_times_match = {}
270
+ #
271
+ # _function_times_value collects the time a function spends doing its to_value()
272
+ #
308
273
  self._function_times_value = {}
309
274
  self._created_at = datetime.now()
310
275
  self._run_started_at = None
311
-
312
276
  self._collecting = False
277
+ #
278
+ # holds the unmatched lines when lines are being collected and
279
+ # _unmatched_available is True. it is analogous to the lines returned
280
+ # by collect(), but is the lines not returned by collect().
281
+ #
313
282
  self._unmatched = None
314
- self._unmatched_available = False
315
- self._data_from_preceding = False
316
283
 
317
284
  @property
318
285
  def data_from_preceding(self) -> bool:
319
- return self._data_from_preceding
286
+ return self.modes.source_mode.value
320
287
 
321
288
  @data_from_preceding.setter
322
289
  def data_from_preceding(self, dfp: bool) -> None:
323
- self._data_from_preceding = dfp
290
+ self.modes.source_mode.value = dfp
324
291
 
325
292
  @property
326
293
  def unmatched(self) -> list[list[Any]]:
@@ -338,22 +305,13 @@ class CsvPath(CsvPathPublic, ErrorCollector, Printer): # pylint: disable=R0902,
338
305
  def collecting(self, c: bool) -> None:
339
306
  self._collecting = c
340
307
 
341
- def set_unmatched_availability(self) -> None:
342
- um = self.metadata.get("unmatched-mode")
343
- if um is not None and um.find("no-keep") > -1:
344
- self.unmatched_available = False
345
- elif um is not None and um.find("keep") > -1:
346
- self.unmatched_available = True
347
- else:
348
- self.unmatched_available = False
349
-
350
308
  @property
351
309
  def unmatched_available(self) -> bool:
352
- return self._unmatched_available
310
+ return self.modes.unmatched_mode.value
353
311
 
354
312
  @unmatched_available.setter
355
313
  def unmatched_available(self, ua: bool) -> None:
356
- self._unmatched_available = ua
314
+ self.modes.unmatched_mode.value = ua
357
315
 
358
316
  @property
359
317
  def created_at(self) -> datetime:
@@ -364,13 +322,16 @@ class CsvPath(CsvPathPublic, ErrorCollector, Printer): # pylint: disable=R0902,
364
322
  return self._run_started_at
365
323
 
366
324
  @property
367
- def run_mode(self) -> bool:
368
- return self._run_mode
325
+ def will_run(self) -> bool:
326
+ return self.modes.run_mode.value
369
327
 
370
- @run_mode.setter
371
- def run_mode(self, mode) -> None:
372
- self._run_mode = mode
328
+ @will_run.setter
329
+ def will_run(self, mode) -> None:
330
+ self.self.modes.run_mode.value = mode
373
331
 
332
+ #
333
+ # increases the total accumulated time spent doing c.matches() by t
334
+ #
374
335
  def _up_function_time_match(self, c, t) -> None:
375
336
  if c not in self.function_times_match:
376
337
  self.function_times_match[c] = 0
@@ -382,6 +343,9 @@ class CsvPath(CsvPathPublic, ErrorCollector, Printer): # pylint: disable=R0902,
382
343
  def function_times_match(self) -> int:
383
344
  return self._function_times_match
384
345
 
346
+ #
347
+ # increases the total accumulated time spent doing c.to_value() by t
348
+ #
385
349
  def _up_function_time_value(self, c, t) -> None:
386
350
  if c not in self.function_times_value:
387
351
  self.function_times_value[c] = 0
@@ -426,19 +390,19 @@ class CsvPath(CsvPathPublic, ErrorCollector, Printer): # pylint: disable=R0902,
426
390
 
427
391
  @property
428
392
  def AND(self) -> bool: # pylint: disable=C0103
429
- return self._AND
393
+ return self.modes.logic_mode.value
430
394
 
431
395
  @AND.setter
432
396
  def AND(self, a: bool) -> bool: # pylint: disable=C0103
433
- self._AND = a
397
+ self.modes.logic_mode.value = a
434
398
 
435
399
  @property
436
400
  def OR(self) -> bool: # pylint: disable=C0103
437
- return not self._AND
401
+ return not self.modes.logic_mode.value
438
402
 
439
403
  @OR.setter
440
404
  def OR(self, a: bool) -> bool: # pylint: disable=C0103
441
- self._AND = not a
405
+ self.modes.logic_mode.value = not a
442
406
 
443
407
  @property
444
408
  def identity(self) -> str:
@@ -449,6 +413,7 @@ class CsvPath(CsvPathPublic, ErrorCollector, Printer): # pylint: disable=R0902,
449
413
  is preferred over name. E.g.:
450
414
  ~ name: my path description: an example ~
451
415
  """
416
+ # this ordering is relied on in Result and possibly elsewhere
452
417
  if not self.metadata:
453
418
  return ""
454
419
  if "id" in self.metadata:
@@ -471,7 +436,7 @@ class CsvPath(CsvPathPublic, ErrorCollector, Printer): # pylint: disable=R0902,
471
436
  self._config = Config()
472
437
  return self._config
473
438
 
474
- def has_errors(self) -> bool: # pylint: disable=C0116
439
+ def has_errors(self) -> bool:
475
440
  if self.errors and len(self.errors) > 0:
476
441
  return True
477
442
  if self.error_collector:
@@ -507,86 +472,29 @@ class CsvPath(CsvPathPublic, ErrorCollector, Printer): # pylint: disable=R0902,
507
472
  self._errors = []
508
473
  self._errors.append(error)
509
474
 
510
- #
511
- # validation error handling overrides the error policy in config. this
512
- # is because the validation handling is:
513
- # - different. it is built-in. it deals with programmatic decisions
514
- # about how functions work and is the basis for structural (schema)
515
- # validation.
516
- # - set on a per csvpath basis in comments
517
- #
518
- # by default, validation errors do not impact matching. they are print
519
- # and raise only. however, you can set them to raise or match/not-match
520
- # and/or suppress printing.
521
- #
522
- def set_validation_error_handling(self, veh) -> None:
523
- # print prints to the Printer(s), not std.out. atm, no
524
- # customization of messages is possible, so there is likely
525
- # to be stylistic mismatch with other output.
526
- if veh and veh.find("no-print") > -1:
527
- self._print_validation_errors = False
528
- elif veh and veh.find("print") > -1:
529
- self._print_validation_errors = True
530
- else:
531
- self._print_validation_errors = None
532
- #
533
- if veh and veh.find("no-raise") > -1:
534
- self._raise_validation_errors = False
535
- elif veh and veh.find("raise") > -1:
536
- self._raise_validation_errors = True
537
- else:
538
- self._raise_validation_errors = None
539
- #
540
- # match, no-match, and None do:
541
- # match: return True on error
542
- # no-match: return False on error
543
- # None: default behavior: default_match() or result of matches()
544
- if veh and veh.find("no-match") > -1:
545
- self._match_validation_errors = False
546
- elif veh and veh.find("match") > -1:
547
- self._match_validation_errors = True
548
- else:
549
- self._match_validation_errors = None
550
- #
551
- # also stop and fail to match the config
552
- #
553
- if veh and veh.find("no-stop") > -1:
554
- self._stop_on_validation_errors = False
555
- elif veh and veh.find("stop") > -1:
556
- self._stop_on_validation_errors = True
557
- else:
558
- self._stop_on_validation_errors = None
559
- #
560
- if veh and veh.find("no-fail") > -1:
561
- self._fail_on_validation_errors = False
562
- elif veh and veh.find("fail") > -1:
563
- self._fail_on_validation_errors = True
564
- else:
565
- self._fail_on_validation_errors = None
566
-
567
475
  @property
568
476
  def stop_on_validation_errors(self) -> bool:
569
- return self._stop_on_validation_errors
477
+ return self.modes.validation_mode.stop_on_validation_errors
570
478
 
571
479
  @property
572
480
  def fail_on_validation_errors(self) -> bool:
573
- return self._fail_on_validation_errors
481
+ return self.modes.validation_mode.fail_on_validation_errors
574
482
 
575
483
  @property
576
484
  def print_validation_errors(self) -> bool:
577
- return self._print_validation_errors
485
+ return self.modes.validation_mode.print_validation_errors
578
486
 
579
487
  @property
580
488
  def log_validation_errors(self) -> bool:
581
- return self._log_validation_errors
489
+ return self.modes.validation_mode.log_validation_errors
582
490
 
583
491
  @property
584
492
  def raise_validation_errors(self) -> bool:
585
- return self._raise_validation_errors
493
+ return self.modes.validation_mode.raise_validation_errors
586
494
 
587
495
  @property
588
496
  def match_validation_errors(self) -> bool:
589
- return self._match_validation_errors
497
+ return self.modes.validation_mode.match_validation_errors
590
498
 
591
499
  def add_printer(self, printer) -> None: # pylint: disable=C0116
592
500
  if printer not in self.printers:
@@ -641,24 +549,24 @@ class CsvPath(CsvPathPublic, ErrorCollector, Printer): # pylint: disable=R0902,
641
549
  to INFO. this can be expensive. a 25% performance hit wouldn't
642
550
  be unexpected.
643
551
  """
644
- return self._explain
552
+ return self.modes.explain_mode.value
645
553
 
646
554
  @explain.setter
647
555
  def explain(self, yesno: bool) -> None:
648
- self._explain = yesno
556
+ self.modes.explain_mode.value = yesno
649
557
 
650
558
  @property
651
559
  def collect_when_not_matched(self) -> bool:
652
560
  """when this property is True CsvPath returns the lines that do not
653
561
  match the matchers match components"""
654
- return self._when_not_matched
562
+ return self.modes.return_mode.collect_when_not_matched
655
563
 
656
564
  @collect_when_not_matched.setter
657
565
  def collect_when_not_matched(self, yesno: bool) -> None:
658
- """when collect_when_not_matched is True we return the lines that failed
566
+ """when c ollect_when_not_matched is True we return the lines that failed
659
567
  to match, rather than the default behavior of returning the matches.
660
568
  """
661
- self._when_not_matched = yesno
569
+ self.modes.return_mode.collect_when_not_matched = yesno
662
570
 
663
571
  def parse(self, csvpath, disposably=False):
664
572
  """displosably is True when a Matcher is needed for some purpose other than
@@ -720,26 +628,60 @@ class CsvPath(CsvPathPublic, ErrorCollector, Printer): # pylint: disable=R0902,
720
628
  # - run-mode: no-run | run
721
629
  # - unmatched-mode: no-keep | keep
722
630
  # - source-mode: preceding | origin
631
+ # - files-mode: all | no-data | no-unmatched | no-printouts | data | unmatched | errors | meta | vars | printouts
723
632
  #
724
- self.update_logic_mode_if()
725
- self.update_run_mode_if()
726
- self.update_match_mode_if()
727
- self.update_print_mode_if()
728
- self.update_explain_mode_if()
729
- self.update_arg_validation_mode_if()
730
- self.update_unmatched_mode_if()
731
- self.update_data_from_preceding_if()
732
-
733
- def update_data_from_preceding_if(self) -> None:
734
- if self.metadata and "source-mode" in self.metadata:
735
- dfp = self.metadata["source-mode"]
736
- self.data_from_preceding = dfp == "preceding"
737
- else:
738
- self.data_from_preceding = False
633
+ self.modes.update()
634
+ # self.update_arg_validation_mode_if()
739
635
 
740
- def update_unmatched_mode_if(self) -> None:
741
- self.set_unmatched_availability()
636
+ # =====================
637
+
638
+ @property
639
+ def transfer_mode(self) -> str:
640
+ return self.metadata.get("transfer-mode")
641
+
642
+ @property
643
+ def source_mode(self) -> str:
644
+ return self.metadata.get("source-mode")
645
+
646
+ @property
647
+ def files_mode(self) -> str:
648
+ return self.metadata.get("files-mode")
742
649
 
650
+ @property
651
+ def validation_mode(self) -> str:
652
+ return self.metadata.get("validation-mode")
653
+
654
+ @property
655
+ def run_mode(self) -> str:
656
+ return self.metadata.get("run-mode")
657
+
658
+ @property
659
+ def logic_mode(self) -> str:
660
+ return self.metadata.get("logic-mode")
661
+
662
+ @property
663
+ def return_mode(self) -> str:
664
+ return self.modes.get("return-mode")
665
+
666
+ @property
667
+ def explain_mode(self) -> str:
668
+ return self.metadata.get("explain-mode")
669
+
670
+ @property
671
+ def print_mode(self) -> str:
672
+ return self.metadata.get("print-mode")
673
+
674
+ @property
675
+ def unmatched_mode(self) -> str:
676
+ return self.metadata.get("unmatched-mode")
677
+
678
+ # =====================
679
+
680
+ @property
681
+ def transfers(self) -> list[tuple[str, str]]:
682
+ return self.modes.transfer_mode.transfers
683
+
684
+ """
743
685
  def update_arg_validation_mode_if(self) -> None:
744
686
  if self.metadata and "validation-mode" in self.metadata:
745
687
  # sets arg validation reporting. one or more or none of:
@@ -754,75 +696,15 @@ class CsvPath(CsvPathPublic, ErrorCollector, Printer): # pylint: disable=R0902,
754
696
  "Setting 'validation-mode': %s",
755
697
  self.metadata["validation-mode"],
756
698
  )
699
+ """
757
700
 
758
- def update_run_mode_if(self) -> None:
759
- if self.metadata and "run-mode" in self.metadata:
760
- if f"{self.metadata['run-mode']}".strip() == "no-run":
761
- self.run_mode = False
762
- elif f"{self.metadata['run-mode']}".strip() == "run":
763
- self.run_mode = True
764
- else:
765
- self.logger.warning(
766
- "Incorrect metadata field value 'run-mode': %s",
767
- self.metadata["run-mode"],
768
- )
769
-
770
- def update_logic_mode_if(self) -> None:
771
- if self.metadata and "logic-mode" in self.metadata:
772
- if f"{self.metadata['logic-mode']}".strip() == "AND":
773
- self.AND = True
774
- elif f"{self.metadata['logic-mode']}".strip() == "OR":
775
- self.AND = False
776
- else:
777
- self.logger.warning(
778
- "Incorrect metadata field value 'logic-mode': %s",
779
- self.metadata["logic-mode"],
780
- )
701
+ @property
702
+ def all_expected_files(self) -> list[str]:
703
+ return self.modes.files_mode.all_expected_files
781
704
 
782
- def update_match_mode_if(self) -> None:
783
- if "return-mode" in self.metadata:
784
- if f"{self.metadata['return-mode']}".strip() == "matches":
785
- self.collect_when_not_matched = False
786
- elif f"{self.metadata['return-mode']}".strip() == "no-matches":
787
- self.collect_when_not_matched = True
788
- else:
789
- self.logger.warning(
790
- "Incorrect metadata field value 'return-mode': %s",
791
- self.metadata["return-mode"],
792
- )
793
-
794
- def update_explain_mode_if(self) -> None:
795
- if "explain-mode" in self.metadata:
796
- if f"{self.metadata['explain-mode']}".strip() == "no-explain":
797
- self._explain = False
798
- elif f"{self.metadata['explain-mode']}".strip() == "explain":
799
- self._explain = True
800
- else:
801
- self._explain = False
802
-
803
- def update_print_mode_if(self) -> None:
804
- if "print-mode" in self.metadata:
805
- if f"{self.metadata['print-mode']}".strip() == "no-default":
806
- remove = -1
807
- for i, p in enumerate(self.printers):
808
- if isinstance(p, StdOutPrinter):
809
- remove = i
810
- break
811
- if remove >= 0:
812
- del self.printers[remove]
813
- elif f"{self.metadata['print-mode']}".strip() == "default":
814
- done = False
815
- for i, p in enumerate(self.printers):
816
- if isinstance(p, StdOutPrinter):
817
- done = True
818
- break
819
- if not done:
820
- self.printers.append(StdOutPrinter())
821
- else:
822
- self.logger.warning(
823
- "Incorrect metadata field value 'print-mode': %s",
824
- self.metadata["print-mode"],
825
- )
705
+ @all_expected_files.setter
706
+ def all_expected_files(self, efs: list[str]) -> None:
707
+ self.modes.files_mode.all_expected_files = efs
826
708
 
827
709
  def _pick_named_path(self, name, *, specific=None) -> str:
828
710
  if not self.csvpaths:
@@ -972,6 +854,14 @@ class CsvPath(CsvPathPublic, ErrorCollector, Printer): # pylint: disable=R0902,
972
854
  def is_valid(self, tf: bool) -> None:
973
855
  self._is_valid = tf
974
856
 
857
+ @property
858
+ def completed(self) -> bool:
859
+ if not self.scanner or not self.line_monitor:
860
+ return False
861
+ if self.scanner.is_last(self.line_monitor.physical_line_number):
862
+ return True
863
+ return False
864
+
975
865
  @property
976
866
  def from_line(self): # pragma: no cover pylint: disable=C0116
977
867
  if self.scanner is None:
@@ -1066,12 +956,18 @@ class CsvPath(CsvPathPublic, ErrorCollector, Printer): # pylint: disable=R0902,
1066
956
  nexts -= 1
1067
957
  else:
1068
958
  break
1069
- # we don't want to hold on to lines more than needed.
1070
- # we do want to return them if we're not spooling. the
959
+ # we don't want to hold on to data more than needed. but
960
+ # we do want to return data if we're not spooling. the
1071
961
  # way we do that is to keep the local var available with the
1072
962
  # list and/or the spooler. the caller needs to be aware of
1073
963
  # both possibilities, but both offer __len__ and append.
1074
- self.lines = None
964
+ #
965
+ # we keep the self.lines if it is not a list because that
966
+ # makes it available to the runtime data collector so we can
967
+ # see the line count in the metadata, saving opening a
968
+ # potentially large data.csv to find out how many lines.
969
+ if isinstance(self.lines, list):
970
+ self.lines = None
1075
971
  return lines
1076
972
 
1077
973
  def fast_forward(self, csvpath=None) -> None:
@@ -1090,7 +986,7 @@ class CsvPath(CsvPathPublic, ErrorCollector, Printer): # pylint: disable=R0902,
1090
986
  if self.scanner is None and csvpath is not None:
1091
987
  self.parse(csvpath)
1092
988
  start = time.time()
1093
- if self.run_mode is True:
989
+ if self.will_run is True:
1094
990
  for line in self._next_line():
1095
991
  b = self._consider_line(line)
1096
992
  if b:
@@ -1381,7 +1277,7 @@ class CsvPath(CsvPathPublic, ErrorCollector, Printer): # pylint: disable=R0902,
1381
1277
  self.matcher = Matcher(
1382
1278
  csvpath=self, data=self.match, line=line, headers=self.headers, myid=h
1383
1279
  )
1384
- self.matcher.AND = self._AND
1280
+ self.matcher.AND = self.AND
1385
1281
  else:
1386
1282
  self.logger.debug("Resetting and reloading matcher")
1387
1283
  self.matcher.reset()