keg2 0.1.0__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 (467) hide show
  1. keg2-0.1.0/PKG-INFO +190 -0
  2. keg2-0.1.0/README.md +169 -0
  3. keg2-0.1.0/pyproject.toml +58 -0
  4. keg2-0.1.0/setup.cfg +4 -0
  5. keg2-0.1.0/src/ch00_py/_ref/ch00_path.py +23 -0
  6. keg2-0.1.0/src/ch00_py/_ref/ch00_semantic_types.py +1 -0
  7. keg2-0.1.0/src/ch00_py/chapter_desc_main.py +38 -0
  8. keg2-0.1.0/src/ch00_py/csv_toolbox.py +172 -0
  9. keg2-0.1.0/src/ch00_py/db_toolbox.py +564 -0
  10. keg2-0.1.0/src/ch00_py/dict_toolbox.py +506 -0
  11. keg2-0.1.0/src/ch00_py/file_toolbox.py +394 -0
  12. keg2-0.1.0/src/ch00_py/keyword_class_builder.py +119 -0
  13. keg2-0.1.0/src/ch00_py/notebook_toolbox.py +187 -0
  14. keg2-0.1.0/src/ch00_py/plotly_toolbox.py +63 -0
  15. keg2-0.1.0/src/ch00_py/test/_util/ch00_examples.py +20 -0
  16. keg2-0.1.0/src/ch00_py/test/_util/test_ch00_path.py +87 -0
  17. keg2-0.1.0/src/ch00_py/test/dict/test__dict_sort.py +75 -0
  18. keg2-0.1.0/src/ch00_py/test/dict/test__dict_tool_.py +999 -0
  19. keg2-0.1.0/src/ch00_py/test/dict/test__dict_tool_json.py +135 -0
  20. keg2-0.1.0/src/ch00_py/test/dict/test__file_.py +682 -0
  21. keg2-0.1.0/src/ch00_py/test/dict/test__file_ch_desc.py +64 -0
  22. keg2-0.1.0/src/ch00_py/test/dict/test__file_counter.py +54 -0
  23. keg2-0.1.0/src/ch00_py/test/keywords/test_chapters_keywords.py +209 -0
  24. keg2-0.1.0/src/ch00_py/test/tool_db/test_csv_tool.py +148 -0
  25. keg2-0.1.0/src/ch00_py/test/tool_db/test_db_tool_.py +1212 -0
  26. keg2-0.1.0/src/ch00_py/test/tool_db/test_db_tool_row_types.py +68 -0
  27. keg2-0.1.0/src/ch00_py/test/tool_dir/test_dir_tool.py +46 -0
  28. keg2-0.1.0/src/ch00_py/test/tool_notebook/test__funcs_getter.py +116 -0
  29. keg2-0.1.0/src/ch00_py/test/tool_notebook/test__imports_getter.py +143 -0
  30. keg2-0.1.0/src/ch00_py/test/tool_notebook/test_marimo_create.py +337 -0
  31. keg2-0.1.0/src/ch01_allot/_ref/ch01_semantic_types.py +16 -0
  32. keg2-0.1.0/src/ch01_allot/allot.py +217 -0
  33. keg2-0.1.0/src/ch01_allot/test/_util/test_semantic_terms_.py +26 -0
  34. keg2-0.1.0/src/ch01_allot/test/test_allot/test_allot_scale_.py +694 -0
  35. keg2-0.1.0/src/ch01_allot/test/test_allot/test_allot_scale_nested.py +268 -0
  36. keg2-0.1.0/src/ch01_allot/test/test_allot/test_allot_semantic_numbers.py +54 -0
  37. keg2-0.1.0/src/ch02_contact/_ref/ch02_semantic_types.py +75 -0
  38. keg2-0.1.0/src/ch02_contact/contact.py +340 -0
  39. keg2-0.1.0/src/ch02_contact/group.py +256 -0
  40. keg2-0.1.0/src/ch02_contact/test/_util/test_ch02_semantic_types.py +149 -0
  41. keg2-0.1.0/src/ch02_contact/test/test__membership.py +455 -0
  42. keg2-0.1.0/src/ch02_contact/test/test_contact_.py +442 -0
  43. keg2-0.1.0/src/ch02_contact/test/test_contact_dict.py +289 -0
  44. keg2-0.1.0/src/ch02_contact/test/test_contact_membership.py +255 -0
  45. keg2-0.1.0/src/ch02_contact/test/test_group.py +155 -0
  46. keg2-0.1.0/src/ch02_contact/test/test_z_give_take_net.py +28 -0
  47. keg2-0.1.0/src/ch03_workforce/_ref/ch03_semantic_types.py +12 -0
  48. keg2-0.1.0/src/ch03_workforce/test/_util/test_ch03_semantic_types.py +1 -0
  49. keg2-0.1.0/src/ch03_workforce/test/test_workforce_.py +539 -0
  50. keg2-0.1.0/src/ch03_workforce/test/test_workforce_json.py +102 -0
  51. keg2-0.1.0/src/ch03_workforce/workforce.py +154 -0
  52. keg2-0.1.0/src/ch04_rope/_ref/ch04_doc_builder.py +132 -0
  53. keg2-0.1.0/src/ch04_rope/_ref/ch04_semantic_types.py +46 -0
  54. keg2-0.1.0/src/ch04_rope/rope.py +269 -0
  55. keg2-0.1.0/src/ch04_rope/test/_util/test_ch04_semantic_types.py +86 -0
  56. keg2-0.1.0/src/ch04_rope/test/test_rope_core.py +702 -0
  57. keg2-0.1.0/src/ch04_rope/test/test_unique_short_ropes.py +59 -0
  58. keg2-0.1.0/src/ch04_rope/test/test_z_rope_doc_builder.py +81 -0
  59. keg2-0.1.0/src/ch05_reason/_ref/ch05_semantic_types.py +32 -0
  60. keg2-0.1.0/src/ch05_reason/reason_main.py +684 -0
  61. keg2-0.1.0/src/ch05_reason/test/_util/test_ch05_semantic_types.py +25 -0
  62. keg2-0.1.0/src/ch05_reason/test/test__caseactivefinder.py +566 -0
  63. keg2-0.1.0/src/ch05_reason/test/test_caseunit.py +837 -0
  64. keg2-0.1.0/src/ch05_reason/test/test_fact.py +383 -0
  65. keg2-0.1.0/src/ch05_reason/test/test_reason.py +558 -0
  66. keg2-0.1.0/src/ch06_plan/_ref/ch06_semantic_types.py +21 -0
  67. keg2-0.1.0/src/ch06_plan/healer.py +37 -0
  68. keg2-0.1.0/src/ch06_plan/plan.py +1180 -0
  69. keg2-0.1.0/src/ch06_plan/range_toolbox.py +30 -0
  70. keg2-0.1.0/src/ch06_plan/test/_util/ch06_examples.py +31 -0
  71. keg2-0.1.0/src/ch06_plan/test/test_/test_healer.py +131 -0
  72. keg2-0.1.0/src/ch06_plan/test/test_/test_range_toolbox.py +113 -0
  73. keg2-0.1.0/src/ch06_plan/test/test_plan/test_plan_.py +666 -0
  74. keg2-0.1.0/src/ch06_plan/test/test_plan/test_plan_active.py +496 -0
  75. keg2-0.1.0/src/ch06_plan/test/test_plan/test_plan_attr_holder.py +152 -0
  76. keg2-0.1.0/src/ch06_plan/test/test_plan/test_plan_dict.py +262 -0
  77. keg2-0.1.0/src/ch06_plan/test/test_plan/test_plan_kid.py +217 -0
  78. keg2-0.1.0/src/ch06_plan/test/test_plan/test_plan_subsitute_rope.py +121 -0
  79. keg2-0.1.0/src/ch06_plan/test/test_plan/test_plans_calculated_float.py +168 -0
  80. keg2-0.1.0/src/ch07_person_logic/_ref/ch07_semantic_types.py +35 -0
  81. keg2-0.1.0/src/ch07_person_logic/person_config.py +218 -0
  82. keg2-0.1.0/src/ch07_person_logic/person_graphic.py +624 -0
  83. keg2-0.1.0/src/ch07_person_logic/person_main.py +1613 -0
  84. keg2-0.1.0/src/ch07_person_logic/person_report.py +59 -0
  85. keg2-0.1.0/src/ch07_person_logic/person_tool.py +419 -0
  86. keg2-0.1.0/src/ch07_person_logic/test/_util/ch07_examples.py +404 -0
  87. keg2-0.1.0/src/ch07_person_logic/test/_util/test_ch07_semantic_types.py +25 -0
  88. keg2-0.1.0/src/ch07_person_logic/test/test_person/test__person_config.py +885 -0
  89. keg2-0.1.0/src/ch07_person_logic/test/test_person/test_person_.py +279 -0
  90. keg2-0.1.0/src/ch07_person_logic/test/test_person/test_person_contacts_.py +190 -0
  91. keg2-0.1.0/src/ch07_person_logic/test/test_person/test_person_contacts_group.py +105 -0
  92. keg2-0.1.0/src/ch07_person_logic/test/test_person/test_person_contacts_pool.py +90 -0
  93. keg2-0.1.0/src/ch07_person_logic/test/test_person/test_person_json.py +446 -0
  94. keg2-0.1.0/src/ch07_person_logic/test/test_person/test_person_plan_crud.py +1113 -0
  95. keg2-0.1.0/src/ch07_person_logic/test/test_person/test_person_plan_lx_edit.py +193 -0
  96. keg2-0.1.0/src/ch07_person_logic/test/test_person/test_person_relevant_ropes.py +200 -0
  97. keg2-0.1.0/src/ch07_person_logic/test/test_person/test_person_set_fact.py +250 -0
  98. keg2-0.1.0/src/ch07_person_logic/test/test_person_conpute/test_init_plan_tree_walk.py +275 -0
  99. keg2-0.1.0/src/ch07_person_logic/test/test_person_conpute/test_set_planunits_range.py +498 -0
  100. keg2-0.1.0/src/ch07_person_logic/test/test_person_conpute/test_set_respect_ledgers.py +189 -0
  101. keg2-0.1.0/src/ch07_person_logic/test/test_person_conpute/test_tree_traverse_base.py +720 -0
  102. keg2-0.1.0/src/ch07_person_logic/test/test_person_conpute/test_tree_traverse_fund_distribution.py +1276 -0
  103. keg2-0.1.0/src/ch07_person_logic/test/test_person_conpute/test_tree_traverse_reason_plan.py +554 -0
  104. keg2-0.1.0/src/ch07_person_logic/test/test_person_conpute/test_tree_traverse_reason_workforce.py +210 -0
  105. keg2-0.1.0/src/ch07_person_logic/test/test_person_conpute/test_tree_traverse_z_fact.py +259 -0
  106. keg2-0.1.0/src/ch07_person_logic/test/test_person_conpute/test_tree_traverse_z_keep.py +163 -0
  107. keg2-0.1.0/src/ch07_person_logic/test/test_person_conpute/test_tree_traverse_z_task.py +885 -0
  108. keg2-0.1.0/src/ch07_person_logic/test/test_person_conpute/test_z_agenda.py +546 -0
  109. keg2-0.1.0/src/ch07_person_logic/test/test_person_conpute/test_z_person_range.py +166 -0
  110. keg2-0.1.0/src/ch07_person_logic/test/test_person_conpute/test_z_set_knot.py +160 -0
  111. keg2-0.1.0/src/ch07_person_logic/test/test_person_conpute/test_z_tree_metrics.py +179 -0
  112. keg2-0.1.0/src/ch07_person_logic/test/test_person_tool/test_add_frame.py +843 -0
  113. keg2-0.1.0/src/ch07_person_logic/test/test_person_tool/test_person_agenda_ledger.py +366 -0
  114. keg2-0.1.0/src/ch07_person_logic/test/test_person_tool/test_person_attr_exists.py +584 -0
  115. keg2-0.1.0/src/ch07_person_logic/test/test_person_tool/test_person_edit_attr_tools.py +94 -0
  116. keg2-0.1.0/src/ch07_person_logic/test/test_person_tool/test_person_facts_dict.py +233 -0
  117. keg2-0.1.0/src/ch07_person_logic/test/test_person_tool/test_person_get_obj.py +265 -0
  118. keg2-0.1.0/src/ch07_person_logic/test/test_person_tool/test_unique_label.py +61 -0
  119. keg2-0.1.0/src/ch07_person_logic/test/test_z_graphs/test_dataframe.py +123 -0
  120. keg2-0.1.0/src/ch07_person_logic/test/test_z_graphs/test_display_plantree.py +109 -0
  121. keg2-0.1.0/src/ch07_person_logic/test/test_z_graphs/test_plans.py +28 -0
  122. keg2-0.1.0/src/ch07_person_logic/tree_metric.py +89 -0
  123. keg2-0.1.0/src/ch08_person_atom/_ref/ch08_semantic_types.py +28 -0
  124. keg2-0.1.0/src/ch08_person_atom/atom_config.py +308 -0
  125. keg2-0.1.0/src/ch08_person_atom/atom_graphic.py +281 -0
  126. keg2-0.1.0/src/ch08_person_atom/atom_main.py +704 -0
  127. keg2-0.1.0/src/ch08_person_atom/normal_model.py +106 -0
  128. keg2-0.1.0/src/ch08_person_atom/test/test_atom/test_atom_config.py +728 -0
  129. keg2-0.1.0/src/ch08_person_atom/test/test_atom/test_atom_core.py +290 -0
  130. keg2-0.1.0/src/ch08_person_atom/test/test_atom/test_atom_graphic.py +18 -0
  131. keg2-0.1.0/src/ch08_person_atom/test/test_atom/test_atom_json.py +64 -0
  132. keg2-0.1.0/src/ch08_person_atom/test/test_atom/test_atom_row.py +265 -0
  133. keg2-0.1.0/src/ch08_person_atom/test/test_atom/test_atom_sift_delete.py +333 -0
  134. keg2-0.1.0/src/ch08_person_atom/test/test_atom/test_atom_sift_insert.py +296 -0
  135. keg2-0.1.0/src/ch08_person_atom/test/test_atom/test_atom_sift_update.py +284 -0
  136. keg2-0.1.0/src/ch08_person_atom/test/test_atom/test_atom_sql.py +112 -0
  137. keg2-0.1.0/src/ch08_person_atom/test/test_normal_models/test_normal_models.py +186 -0
  138. keg2-0.1.0/src/ch09_person_lesson/_ref/ch09_path.py +68 -0
  139. keg2-0.1.0/src/ch09_person_lesson/_ref/ch09_semantic_types.py +34 -0
  140. keg2-0.1.0/src/ch09_person_lesson/delta.py +921 -0
  141. keg2-0.1.0/src/ch09_person_lesson/lasso.py +39 -0
  142. keg2-0.1.0/src/ch09_person_lesson/legible.py +640 -0
  143. keg2-0.1.0/src/ch09_person_lesson/lesson_filehandler.py +344 -0
  144. keg2-0.1.0/src/ch09_person_lesson/lesson_main.py +223 -0
  145. keg2-0.1.0/src/ch09_person_lesson/test/_test_lasso/test__lasso.py +91 -0
  146. keg2-0.1.0/src/ch09_person_lesson/test/_util/ch09_examples.py +147 -0
  147. keg2-0.1.0/src/ch09_person_lesson/test/_util/test_ch09_path.py +244 -0
  148. keg2-0.1.0/src/ch09_person_lesson/test/_util/test_ch09_semantic_types.py +13 -0
  149. keg2-0.1.0/src/ch09_person_lesson/test/test_delta/test_delta_.py +639 -0
  150. keg2-0.1.0/src/ch09_person_lesson/test/test_delta/test_delta_after_person.py +1037 -0
  151. keg2-0.1.0/src/ch09_person_lesson/test/test_delta/test_delta_dimen_removing.py +35 -0
  152. keg2-0.1.0/src/ch09_person_lesson/test/test_delta/test_delta_get_person_difference.py +1281 -0
  153. keg2-0.1.0/src/ch09_person_lesson/test/test_delta/test_delta_legible_contact_membership.py +126 -0
  154. keg2-0.1.0/src/ch09_person_lesson/test/test_delta/test_delta_legible_contactunit.py +135 -0
  155. keg2-0.1.0/src/ch09_person_lesson/test/test_delta/test_delta_legible_personunit.py +95 -0
  156. keg2-0.1.0/src/ch09_person_lesson/test/test_delta/test_delta_legible_plan_awardunit.py +134 -0
  157. keg2-0.1.0/src/ch09_person_lesson/test/test_delta/test_delta_legible_plan_factunit.py +141 -0
  158. keg2-0.1.0/src/ch09_person_lesson/test/test_delta/test_delta_legible_plan_healerunit.py +51 -0
  159. keg2-0.1.0/src/ch09_person_lesson/test/test_delta/test_delta_legible_plan_reason_caseunit.py +147 -0
  160. keg2-0.1.0/src/ch09_person_lesson/test/test_delta/test_delta_legible_plan_reasonunit.py +124 -0
  161. keg2-0.1.0/src/ch09_person_lesson/test/test_delta/test_delta_legible_plan_workforcelink.py +51 -0
  162. keg2-0.1.0/src/ch09_person_lesson/test/test_delta/test_delta_legible_planunit.py +109 -0
  163. keg2-0.1.0/src/ch09_person_lesson/test/test_delta/test_delta_sift_delete.py +67 -0
  164. keg2-0.1.0/src/ch09_person_lesson/test/test_delta/test_delta_sift_insert.py +65 -0
  165. keg2-0.1.0/src/ch09_person_lesson/test/test_delta/test_delta_sift_update.py +34 -0
  166. keg2-0.1.0/src/ch09_person_lesson/test/test_lesson_main/test_lesson_.py +584 -0
  167. keg2-0.1.0/src/ch09_person_lesson/test/test_lesson_main/test_lesson_file.py +255 -0
  168. keg2-0.1.0/src/ch09_person_lesson/test/test_lesson_z_filehandler/test_lessonfilehandler__core.py +95 -0
  169. keg2-0.1.0/src/ch09_person_lesson/test/test_lesson_z_filehandler/test_lessonfilehandler_atom.py +253 -0
  170. keg2-0.1.0/src/ch09_person_lesson/test/test_lesson_z_filehandler/test_lessonfilehandler_gut.py +255 -0
  171. keg2-0.1.0/src/ch09_person_lesson/test/test_lesson_z_filehandler/test_lessonfilehandler_lesson.py +558 -0
  172. keg2-0.1.0/src/ch10_person_listen/_ref/ch10_path.py +159 -0
  173. keg2-0.1.0/src/ch10_person_listen/_ref/ch10_semantic_types.py +22 -0
  174. keg2-0.1.0/src/ch10_person_listen/basis_person.py +43 -0
  175. keg2-0.1.0/src/ch10_person_listen/keep_tool.py +309 -0
  176. keg2-0.1.0/src/ch10_person_listen/listen_main.py +430 -0
  177. keg2-0.1.0/src/ch10_person_listen/test/_util/ch10_examples.py +150 -0
  178. keg2-0.1.0/src/ch10_person_listen/test/_util/test_ch10_path.py +466 -0
  179. keg2-0.1.0/src/ch10_person_listen/test/test__keep_tool/test_duty_crud.py +103 -0
  180. keg2-0.1.0/src/ch10_person_listen/test/test__keep_tool/test_keep_ropes.py +162 -0
  181. keg2-0.1.0/src/ch10_person_listen/test/test__keep_tool/test_keep_tools.py +226 -0
  182. keg2-0.1.0/src/ch10_person_listen/test/test__keep_tool/test_perspective.py +87 -0
  183. keg2-0.1.0/src/ch10_person_listen/test/test_listen/listen_graphic.py +311 -0
  184. keg2-0.1.0/src/ch10_person_listen/test/test_listen/test_agenda.py +312 -0
  185. keg2-0.1.0/src/ch10_person_listen/test/test_listen/test_agendas__gut_job_initial.py +264 -0
  186. keg2-0.1.0/src/ch10_person_listen/test/test_listen/test_agendas_duty_vision.py +473 -0
  187. keg2-0.1.0/src/ch10_person_listen/test/test_listen/test_agendas_gut_job.py +310 -0
  188. keg2-0.1.0/src/ch10_person_listen/test/test_listen/test_basis_persons.py +148 -0
  189. keg2-0.1.0/src/ch10_person_listen/test/test_listen/test_ingest.py +156 -0
  190. keg2-0.1.0/src/ch10_person_listen/test/test_listen/test_listen_all_fact.py +243 -0
  191. keg2-0.1.0/src/ch10_person_listen/test/test_listen/test_listen_duty_vision.py +431 -0
  192. keg2-0.1.0/src/ch10_person_listen/test/test_listen/test_listen_duty_vision_facts.py +478 -0
  193. keg2-0.1.0/src/ch10_person_listen/test/test_listen/test_listen_plotly_graphic.py +25 -0
  194. keg2-0.1.0/src/ch11_bud/_ref/ch11_path.py +174 -0
  195. keg2-0.1.0/src/ch11_bud/_ref/ch11_semantic_types.py +35 -0
  196. keg2-0.1.0/src/ch11_bud/bud_filehandler.py +255 -0
  197. keg2-0.1.0/src/ch11_bud/bud_main.py +345 -0
  198. keg2-0.1.0/src/ch11_bud/cell_main.py +268 -0
  199. keg2-0.1.0/src/ch11_bud/test/_util/ch11_examples.py +60 -0
  200. keg2-0.1.0/src/ch11_bud/test/_util/test_ch11_path.py +529 -0
  201. keg2-0.1.0/src/ch11_bud/test/test_bud/test_brokerunit.py +370 -0
  202. keg2-0.1.0/src/ch11_bud/test/test_bud/test_budunit_.py +269 -0
  203. keg2-0.1.0/src/ch11_bud/test/test_bud/test_tran_.py +631 -0
  204. keg2-0.1.0/src/ch11_bud/test/test_bud/test_tran_join.py +31 -0
  205. keg2-0.1.0/src/ch11_bud/test/test_cell/test_cell_.py +1019 -0
  206. keg2-0.1.0/src/ch11_bud/test/test_cell/test_cell_json.py +222 -0
  207. keg2-0.1.0/src/ch11_bud/test/test_phandler/test_phandler_tool.py +717 -0
  208. keg2-0.1.0/src/ch11_bud/test/test_weighted_facts_tool.py +337 -0
  209. keg2-0.1.0/src/ch11_bud/weighted_facts_tool.py +57 -0
  210. keg2-0.1.0/src/ch12_keep/_ref/ch12_semantic_types.py +30 -0
  211. keg2-0.1.0/src/ch12_keep/keep_graphic.py +702 -0
  212. keg2-0.1.0/src/ch12_keep/rivercycle.py +222 -0
  213. keg2-0.1.0/src/ch12_keep/riverrun.py +304 -0
  214. keg2-0.1.0/src/ch12_keep/test/_util/ch12_examples.py +65 -0
  215. keg2-0.1.0/src/ch12_keep/test/_util/test_ch12_semantic_types.py +12 -0
  216. keg2-0.1.0/src/ch12_keep/test/test_keep_plotly_graphic.py +18 -0
  217. keg2-0.1.0/src/ch12_keep/test/test_riverbook.py +89 -0
  218. keg2-0.1.0/src/ch12_keep/test/test_rivercycle.py +302 -0
  219. keg2-0.1.0/src/ch12_keep/test/test_rivergrade.py +216 -0
  220. keg2-0.1.0/src/ch12_keep/test/test_riverrun_.py +229 -0
  221. keg2-0.1.0/src/ch12_keep/test/test_riverrun_crud_grade.py +121 -0
  222. keg2-0.1.0/src/ch12_keep/test/test_riverrun_crud_need_due.py +306 -0
  223. keg2-0.1.0/src/ch12_keep/test/test_riverrun_crud_need_yield.py +327 -0
  224. keg2-0.1.0/src/ch12_keep/test/test_riverrun_levy.py +97 -0
  225. keg2-0.1.0/src/ch12_keep/test/test_riverrun_metrics.py +258 -0
  226. keg2-0.1.0/src/ch12_keep/test/test_riverrun_saving_metrics.py +83 -0
  227. keg2-0.1.0/src/ch13_time/_ref/ch13_semantic_types.py +32 -0
  228. keg2-0.1.0/src/ch13_time/calendar_markdown.py +182 -0
  229. keg2-0.1.0/src/ch13_time/epoch_main.py +661 -0
  230. keg2-0.1.0/src/ch13_time/epoch_reason.py +439 -0
  231. keg2-0.1.0/src/ch13_time/epoch_str_func.py +72 -0
  232. keg2-0.1.0/src/ch13_time/test/_util/ch13_examples.py +426 -0
  233. keg2-0.1.0/src/ch13_time/test/test_/test_config_.py +541 -0
  234. keg2-0.1.0/src/ch13_time/test/test_/test_config_creg_.py +928 -0
  235. keg2-0.1.0/src/ch13_time/test/test_/test_config_creg_planunits_active.py +572 -0
  236. keg2-0.1.0/src/ch13_time/test/test_/test_config_creg_planunits_range.py +276 -0
  237. keg2-0.1.0/src/ch13_time/test/test_/test_date_attrs.py +305 -0
  238. keg2-0.1.0/src/ch13_time/test/test_/test_year_calc_func.py +57 -0
  239. keg2-0.1.0/src/ch13_time/test/test_calendar/test_calendar_markdown_generator.py +463 -0
  240. keg2-0.1.0/src/ch13_time/test/test_epoch_reason/test_base_setters.py +775 -0
  241. keg2-0.1.0/src/ch13_time/test/test_epoch_reason/test_combined_setters.py +664 -0
  242. keg2-0.1.0/src/ch13_time/test/test_epoch_reason/test_epoch_reason_agenda.py +156 -0
  243. keg2-0.1.0/src/ch13_time/test/test_epoch_reason/test_z_epoch_frame.py +902 -0
  244. keg2-0.1.0/src/ch13_time/test/test_epoch_str/test_epoch_str_func.py +249 -0
  245. keg2-0.1.0/src/ch13_time/test/test_person_epoch/test_person_dict_epoch.py +31 -0
  246. keg2-0.1.0/src/ch14_moment/_ref/ch14_path.py +19 -0
  247. keg2-0.1.0/src/ch14_moment/_ref/ch14_semantic_types.py +26 -0
  248. keg2-0.1.0/src/ch14_moment/moment_cell.py +341 -0
  249. keg2-0.1.0/src/ch14_moment/moment_config.py +113 -0
  250. keg2-0.1.0/src/ch14_moment/moment_frame.py +79 -0
  251. keg2-0.1.0/src/ch14_moment/moment_graphic.py +129 -0
  252. keg2-0.1.0/src/ch14_moment/moment_main.py +491 -0
  253. keg2-0.1.0/src/ch14_moment/moment_report.py +231 -0
  254. keg2-0.1.0/src/ch14_moment/test/_util/ch14_examples.py +263 -0
  255. keg2-0.1.0/src/ch14_moment/test/_util/test_ch14_path.py +48 -0
  256. keg2-0.1.0/src/ch14_moment/test/test_moment_/test_moment_.py +569 -0
  257. keg2-0.1.0/src/ch14_moment/test/test_moment_/test_moment_gut_epoch.py +76 -0
  258. keg2-0.1.0/src/ch14_moment/test/test_moment_/test_moment_json.py +289 -0
  259. keg2-0.1.0/src/ch14_moment/test/test_moment_/test_moment_kpis.py +176 -0
  260. keg2-0.1.0/src/ch14_moment/test/test_moment_/test_moment_pay_purchase.py +262 -0
  261. keg2-0.1.0/src/ch14_moment/test/test_moment_/test_moment_person_bud.py +291 -0
  262. keg2-0.1.0/src/ch14_moment/test/test_moment_/test_moment_person_job.py +279 -0
  263. keg2-0.1.0/src/ch14_moment/test/test_moment_config/test_moment_config_.py +216 -0
  264. keg2-0.1.0/src/ch14_moment/test/test_moment_frame/test_moment_frame.py +245 -0
  265. keg2-0.1.0/src/ch14_moment/test/test_moment_graphic/test_moment_plotly_graphic.py +8 -0
  266. keg2-0.1.0/src/ch14_moment/test/test_moment_z_cell/test_bud_mandates.py +121 -0
  267. keg2-0.1.0/src/ch14_moment/test/test_moment_z_cell/test_cell_tree__create__root.py +164 -0
  268. keg2-0.1.0/src/ch14_moment/test/test_moment_z_cell/test_cell_tree__create_nodes.py +412 -0
  269. keg2-0.1.0/src/ch14_moment/test/test_moment_z_cell/test_cell_tree_found_facts.py +110 -0
  270. keg2-0.1.0/src/ch14_moment/test/test_moment_z_cell/test_cell_tree_personsparks.py +99 -0
  271. keg2-0.1.0/src/ch14_moment/test/test_moment_z_cell/test_cell_tree_set_decrees.py +466 -0
  272. keg2-0.1.0/src/ch14_moment/test/test_moment_z_cell/test_cell_tree_set_mandates.py +442 -0
  273. keg2-0.1.0/src/ch15_nabu/_ref/ch15_semantic_types.py +26 -0
  274. keg2-0.1.0/src/ch15_nabu/nabu_config.py +56 -0
  275. keg2-0.1.0/src/ch15_nabu/nabu_epoch.py +83 -0
  276. keg2-0.1.0/src/ch15_nabu/test/test_nabu_config.py +197 -0
  277. keg2-0.1.0/src/ch15_nabu/test/test_nabu_epoch.py +397 -0
  278. keg2-0.1.0/src/ch15_nabu/test/test_nabuunit_crud_epoch.py +159 -0
  279. keg2-0.1.0/src/ch16_translate/_ref/ch16_semantic_types.py +26 -0
  280. keg2-0.1.0/src/ch16_translate/map_term.py +490 -0
  281. keg2-0.1.0/src/ch16_translate/test/_util/ch16_examples.py +425 -0
  282. keg2-0.1.0/src/ch16_translate/test/test__translate_config/test_translate_config_.py +160 -0
  283. keg2-0.1.0/src/ch16_translate/test/test_translate/test_map_contact.py +483 -0
  284. keg2-0.1.0/src/ch16_translate/test/test_translate/test_map_group.py +470 -0
  285. keg2-0.1.0/src/ch16_translate/test/test_translate/test_map_label.py +481 -0
  286. keg2-0.1.0/src/ch16_translate/test/test_translate/test_map_rope_.py +657 -0
  287. keg2-0.1.0/src/ch16_translate/test/test_translate/test_map_rope_reveal.py +164 -0
  288. keg2-0.1.0/src/ch16_translate/test/test_translate/test_translateunit_.py +476 -0
  289. keg2-0.1.0/src/ch16_translate/test/test_translate/test_translateunit_crud_contact.py +171 -0
  290. keg2-0.1.0/src/ch16_translate/test/test_translate/test_translateunit_crud_group.py +154 -0
  291. keg2-0.1.0/src/ch16_translate/test/test_translate/test_translateunit_crud_label.py +125 -0
  292. keg2-0.1.0/src/ch16_translate/test/test_translate/test_translateunit_crud_rope.py +154 -0
  293. keg2-0.1.0/src/ch16_translate/test/test_translate/test_translateunit_crud_z.py +283 -0
  294. keg2-0.1.0/src/ch16_translate/test/test_translate/test_translateunit_dict.py +104 -0
  295. keg2-0.1.0/src/ch16_translate/test/test_translate/test_translateunit_merge.py +149 -0
  296. keg2-0.1.0/src/ch16_translate/translate_config.py +247 -0
  297. keg2-0.1.0/src/ch16_translate/translate_main.py +382 -0
  298. keg2-0.1.0/src/ch17_idea/_ref/ch17_doc_builder.py +51 -0
  299. keg2-0.1.0/src/ch17_idea/_ref/ch17_semantic_types.py +26 -0
  300. keg2-0.1.0/src/ch17_idea/idea_config.py +971 -0
  301. keg2-0.1.0/src/ch17_idea/idea_csv_tool.py +526 -0
  302. keg2-0.1.0/src/ch17_idea/idea_db_tool.py +661 -0
  303. keg2-0.1.0/src/ch17_idea/idea_main.py +313 -0
  304. keg2-0.1.0/src/ch17_idea/test/_util/ch17_examples.py +414 -0
  305. keg2-0.1.0/src/ch17_idea/test/test_idea_/test_idea__config.py +906 -0
  306. keg2-0.1.0/src/ch17_idea/test/test_idea_/test_idea_column.py +162 -0
  307. keg2-0.1.0/src/ch17_idea/test/test_idea_/test_idea_csv_tools.py +59 -0
  308. keg2-0.1.0/src/ch17_idea/test/test_idea_/test_idea_format_builder.py +152 -0
  309. keg2-0.1.0/src/ch17_idea/test/test_idea_/test_idea_format_config.py +329 -0
  310. keg2-0.1.0/src/ch17_idea/test/test_idea_/test_idea_format_dataframes.py +264 -0
  311. keg2-0.1.0/src/ch17_idea/test/test_idea_/test_idea_format_generate_idea.py +181 -0
  312. keg2-0.1.0/src/ch17_idea/test/test_idea_/test_idea_format_import.py +68 -0
  313. keg2-0.1.0/src/ch17_idea/test/test_idea_db_tool/test_brick_intake_validation.py +24 -0
  314. keg2-0.1.0/src/ch17_idea/test/test_idea_db_tool/test_csvs_to_excel.py +112 -0
  315. keg2-0.1.0/src/ch17_idea/test/test_idea_db_tool/test_db_export.py +98 -0
  316. keg2-0.1.0/src/ch17_idea/test/test_idea_db_tool/test_idea_query_builder.py +156 -0
  317. keg2-0.1.0/src/ch17_idea/test/test_idea_db_tool/test_pandas_tool_.py +169 -0
  318. keg2-0.1.0/src/ch17_idea/test/test_idea_db_tool/test_pandas_tool_db.py +230 -0
  319. keg2-0.1.0/src/ch17_idea/test/test_idea_db_tool/test_pandas_tool_get_dict.py +152 -0
  320. keg2-0.1.0/src/ch17_idea/test/test_idea_db_tool/test_pandas_tool_sheet.py +599 -0
  321. keg2-0.1.0/src/ch17_idea/test/test_idea_db_tool/test_pandas_tool_translate_.py +295 -0
  322. keg2-0.1.0/src/ch17_idea/test/test_idea_db_tool/test_pandas_tool_translate_files.py +193 -0
  323. keg2-0.1.0/src/ch17_idea/test/test_translate_init/test_translate_init_tool.py +436 -0
  324. keg2-0.1.0/src/ch17_idea/test/test_z_moment_build/test_idea_csv_tool.py +582 -0
  325. keg2-0.1.0/src/ch17_idea/test/test_z_moment_build/test_idea_moment_build.py +179 -0
  326. keg2-0.1.0/src/ch17_idea/translate_toolbox.py +243 -0
  327. keg2-0.1.0/src/ch18_etl_config/_ref/ch18_path.py +51 -0
  328. keg2-0.1.0/src/ch18_etl_config/_ref/ch18_semantic_types.py +27 -0
  329. keg2-0.1.0/src/ch18_etl_config/etl_config.py +440 -0
  330. keg2-0.1.0/src/ch18_etl_config/etl_csv.py +74 -0
  331. keg2-0.1.0/src/ch18_etl_config/etl_sqlstr.py +1714 -0
  332. keg2-0.1.0/src/ch18_etl_config/idea_collector.py +38 -0
  333. keg2-0.1.0/src/ch18_etl_config/stance_tool.py +218 -0
  334. keg2-0.1.0/src/ch18_etl_config/test/_util/test_ch18_path.py +210 -0
  335. keg2-0.1.0/src/ch18_etl_config/test/etl_sqlstrs/test__csv_from_db.py +317 -0
  336. keg2-0.1.0/src/ch18_etl_config/test/etl_sqlstrs/test__etl_table.py +501 -0
  337. keg2-0.1.0/src/ch18_etl_config/test/etl_sqlstrs/test__idea_collector_.py +154 -0
  338. keg2-0.1.0/src/ch18_etl_config/test/etl_sqlstrs/test_etl_sqlstrs_prime.py +973 -0
  339. keg2-0.1.0/src/ch18_etl_config/test/etl_sqlstrs/test_etl_sqlstrs_z_job.py +104 -0
  340. keg2-0.1.0/src/ch18_etl_config/test/stance/test_stance_tool.py +262 -0
  341. keg2-0.1.0/src/ch18_etl_config/test/stance/test_stance_translate.py +358 -0
  342. keg2-0.1.0/src/ch19_etl_steps/_ref/ch19_semantic_types.py +27 -0
  343. keg2-0.1.0/src/ch19_etl_steps/etl_main.py +1014 -0
  344. keg2-0.1.0/src/ch19_etl_steps/obj2db_moment.py +149 -0
  345. keg2-0.1.0/src/ch19_etl_steps/obj2db_person.py +1264 -0
  346. keg2-0.1.0/src/ch19_etl_steps/test/_util/ch19_examples.py +22 -0
  347. keg2-0.1.0/src/ch19_etl_steps/test/brick/test_brick_agg_tables_to_sparks_brick_table.py +234 -0
  348. keg2-0.1.0/src/ch19_etl_steps/test/brick/test_brick_raw_tables_to_brick_agg_tables.py +313 -0
  349. keg2-0.1.0/src/ch19_etl_steps/test/brick/test_brick_valid_tables_to_sound_raw_tables.py +129 -0
  350. keg2-0.1.0/src/ch19_etl_steps/test/brick/test_input_sheets_to_brick_raw_tables.py +250 -0
  351. keg2-0.1.0/src/ch19_etl_steps/test/db2obj/test_db2obj_moment.py +595 -0
  352. keg2-0.1.0/src/ch19_etl_steps/test/db2obj/test_sql_insert_heard_agg.py +535 -0
  353. keg2-0.1.0/src/ch19_etl_steps/test/db2obj/test_sql_insert_job.py +748 -0
  354. keg2-0.1.0/src/ch19_etl_steps/test/db2obj/test_z_obj2db_h_agg.py +886 -0
  355. keg2-0.1.0/src/ch19_etl_steps/test/db2obj/test_z_obj2db_job.py +923 -0
  356. keg2-0.1.0/src/ch19_etl_steps/test/heard/test_heard_agg__update_casenum_pchap0.py +210 -0
  357. keg2-0.1.0/src/ch19_etl_steps/test/heard/test_heard_agg__update_casenum_pchap1.py +188 -0
  358. keg2-0.1.0/src/ch19_etl_steps/test/heard/test_heard_agg__update_casenum_pchap2.py +623 -0
  359. keg2-0.1.0/src/ch19_etl_steps/test/heard/test_heard_agg__update_casenum_pchapx.py +103 -0
  360. keg2-0.1.0/src/ch19_etl_steps/test/heard/test_heard_agg__update_factnum_pfhap0.py +206 -0
  361. keg2-0.1.0/src/ch19_etl_steps/test/heard/test_heard_agg__update_factnum_pfhap1.py +186 -0
  362. keg2-0.1.0/src/ch19_etl_steps/test/heard/test_heard_agg__update_factnum_pfhap2.py +154 -0
  363. keg2-0.1.0/src/ch19_etl_steps/test/heard/test_heard_agg__update_factnum_pfhapx.py +103 -0
  364. keg2-0.1.0/src/ch19_etl_steps/test/heard/test_heard_agg__update_moment_time_mxhap0.py +383 -0
  365. keg2-0.1.0/src/ch19_etl_steps/test/heard/test_heard_agg__update_timenums.py +164 -0
  366. keg2-0.1.0/src/ch19_etl_steps/test/heard/test_heard_agg_tables_to_heard_vld_tables.py +253 -0
  367. keg2-0.1.0/src/ch19_etl_steps/test/heard/test_heard_raw_tables_to_heard_agg_tables.py +278 -0
  368. keg2-0.1.0/src/ch19_etl_steps/test/heard/test_heard_raw_tables_translate_updates.py +341 -0
  369. keg2-0.1.0/src/ch19_etl_steps/test/heard/test_heard_vld_tables_to_moment_jsons.py +138 -0
  370. keg2-0.1.0/src/ch19_etl_steps/test/heard/test_heard_vld_tables_to_moment_ote1_agg.py +49 -0
  371. keg2-0.1.0/src/ch19_etl_steps/test/heard/test_heard_vld_tables_to_spark_csvs.py +132 -0
  372. keg2-0.1.0/src/ch19_etl_steps/test/json/test_create_last_run_metrics_json.py +45 -0
  373. keg2-0.1.0/src/ch19_etl_steps/test/json/test_etl_spark_person_csvs_to_lesson_jsons.py +142 -0
  374. keg2-0.1.0/src/ch19_etl_steps/test/json/test_moment_guts_set_epoch.py +34 -0
  375. keg2-0.1.0/src/ch19_etl_steps/test/json/test_moment_guts_to_moment_jobs.py +62 -0
  376. keg2-0.1.0/src/ch19_etl_steps/test/json/test_moment_job_jsons_to_job_tables.py +178 -0
  377. keg2-0.1.0/src/ch19_etl_steps/test/json/test_moment_json_contact_nets_to_table.py +83 -0
  378. keg2-0.1.0/src/ch19_etl_steps/test/json/test_moment_person_time_agg_csv_to_json.py +52 -0
  379. keg2-0.1.0/src/ch19_etl_steps/test/json/test_moment_sparks_lesson_jsons_to_personunit_json.py +171 -0
  380. keg2-0.1.0/src/ch19_etl_steps/test/json/test_spark_inherited_personunits_to_moment_gut.py +58 -0
  381. keg2-0.1.0/src/ch19_etl_steps/test/sound/test_sound_agg_tables_to_sound_vld_tables.py +267 -0
  382. keg2-0.1.0/src/ch19_etl_steps/test/sound/test_sound_agg_tables_to_translate_core_tables.py +1369 -0
  383. keg2-0.1.0/src/ch19_etl_steps/test/sound/test_sound_agg_tables_translate_errors_updates.py +176 -0
  384. keg2-0.1.0/src/ch19_etl_steps/test/sound/test_sound_raw_tables_to_sound_agg_tables.py +419 -0
  385. keg2-0.1.0/src/ch19_etl_steps/test/sound/test_sound_vld_tables_to_heard_raw_tables.py +201 -0
  386. keg2-0.1.0/src/ch19_etl_steps/test/z_net_ledgers/test_calc_moment_bud_contact_mandate.py +141 -0
  387. keg2-0.1.0/src/ch20_kpi/_ref/ch20_path.py +22 -0
  388. keg2-0.1.0/src/ch20_kpi/_ref/ch20_semantic_types.py +26 -0
  389. keg2-0.1.0/src/ch20_kpi/gcalendar.py +409 -0
  390. keg2-0.1.0/src/ch20_kpi/kpi_mstr.py +92 -0
  391. keg2-0.1.0/src/ch20_kpi/kpi_sqlstr.py +35 -0
  392. keg2-0.1.0/src/ch20_kpi/test/_util/ch20_examples.py +44 -0
  393. keg2-0.1.0/src/ch20_kpi/test/_util/test_ch20_path.py +69 -0
  394. keg2-0.1.0/src/ch20_kpi/test/test__kpi_sqlstrs.py +56 -0
  395. keg2-0.1.0/src/ch20_kpi/test/test_kpi_001.py +98 -0
  396. keg2-0.1.0/src/ch20_kpi/test/test_kpi_002.py +103 -0
  397. keg2-0.1.0/src/ch20_kpi/test/test_kpi_config.py +49 -0
  398. keg2-0.1.0/src/ch20_kpi/test/test_markdowns/test_moment_calendars.py +62 -0
  399. keg2-0.1.0/src/ch20_kpi/test/test_person_calendar/test_gcal__agenda_list.py +155 -0
  400. keg2-0.1.0/src/ch20_kpi/test/test_person_calendar/test_gcal__contacts_list.py +84 -0
  401. keg2-0.1.0/src/ch20_kpi/test/test_person_calendar/test_gcal__priorities_schedule.py +118 -0
  402. keg2-0.1.0/src/ch20_kpi/test/test_person_calendar/test_gcal_day_report.py +298 -0
  403. keg2-0.1.0/src/ch20_kpi/test/test_person_calendar/test_gcal_exportcsv.py +345 -0
  404. keg2-0.1.0/src/ch20_kpi/test/test_z_bundles.py +81 -0
  405. keg2-0.1.0/src/ch20_kpi/test/test_z_kpi_file.py +52 -0
  406. keg2-0.1.0/src/ch21_world/_ref/ch21_semantic_types.py +32 -0
  407. keg2-0.1.0/src/ch21_world/test/_util/ch21_examples.py +33 -0
  408. keg2-0.1.0/src/ch21_world/test/test_/test_world_.py +154 -0
  409. keg2-0.1.0/src/ch21_world/test/test_etl_pipeline/test_input_to_clarity.py +711 -0
  410. keg2-0.1.0/src/ch21_world/test/test_etl_pipeline/test_stance_to_clarity.py +198 -0
  411. keg2-0.1.0/src/ch21_world/test/test_output/test_gcal_day_output.py +139 -0
  412. keg2-0.1.0/src/ch21_world/test/test_output/test_stance_output.py +291 -0
  413. keg2-0.1.0/src/ch21_world/test/test_world_examples/test_world_examples.py +75 -0
  414. keg2-0.1.0/src/ch21_world/world.py +232 -0
  415. keg2-0.1.0/src/ch22_lobby/_ref/ch22_path.py +30 -0
  416. keg2-0.1.0/src/ch22_lobby/_ref/ch22_semantic_types.py +33 -0
  417. keg2-0.1.0/src/ch22_lobby/lobby.py +20 -0
  418. keg2-0.1.0/src/ch22_lobby/test/_util/test_ch22_path.py +91 -0
  419. keg2-0.1.0/src/ch22_lobby/test/test_lobby.py +29 -0
  420. keg2-0.1.0/src/ch23_finance/_ref/ch23_path.py +3 -0
  421. keg2-0.1.0/src/ch23_finance/_ref/ch23_semantic_types.py +28 -0
  422. keg2-0.1.0/src/ch23_finance/test/_util/test_ch23_path.py +6 -0
  423. keg2-0.1.0/src/ch24_person_viewer/_ref/ch24_semantic_types.py +1 -0
  424. keg2-0.1.0/src/ch24_person_viewer/person_viewer_app.py +121 -0
  425. keg2-0.1.0/src/ch24_person_viewer/person_viewer_example.py +179 -0
  426. keg2-0.1.0/src/ch24_person_viewer/person_viewer_tool.py +378 -0
  427. keg2-0.1.0/src/ch24_person_viewer/test/_util/ch24_examples.py +29 -0
  428. keg2-0.1.0/src/ch24_person_viewer/test/test__contacts_view_dict.py +350 -0
  429. keg2-0.1.0/src/ch24_person_viewer/test/test__groups_view_dict.py +283 -0
  430. keg2-0.1.0/src/ch24_person_viewer/test/test__plan_view_dict.py +533 -0
  431. keg2-0.1.0/src/ch24_person_viewer/test/test_person_viewer_readable.py +25 -0
  432. keg2-0.1.0/src/ch24_person_viewer/test/test_person_viewer_template.py +85 -0
  433. keg2-0.1.0/src/ch30_etl_app/_ref/ch30_semantic_types.py +28 -0
  434. keg2-0.1.0/src/ch30_etl_app/etl_gui.py +351 -0
  435. keg2-0.1.0/src/ch30_etl_app/test/test_etl_gui_tools.py +2 -0
  436. keg2-0.1.0/src/ch98_docs_builder/_ref/ch98_path.py +15 -0
  437. keg2-0.1.0/src/ch98_docs_builder/_ref/ch98_semantic_types.py +30 -0
  438. keg2-0.1.0/src/ch98_docs_builder/doc_builder.py +98 -0
  439. keg2-0.1.0/src/ch98_docs_builder/keg_terminology_builder.py +173 -0
  440. keg2-0.1.0/src/ch98_docs_builder/test/_util/test_ch98_path.py +65 -0
  441. keg2-0.1.0/src/ch98_docs_builder/test/test_files_md.py +76 -0
  442. keg2-0.1.0/src/ch98_docs_builder/test/test_keg_terminology.py +357 -0
  443. keg2-0.1.0/src/ch98_docs_builder/test/test_str_func_md.py +37 -0
  444. keg2-0.1.0/src/ch98_docs_builder/test/test_z_rebuild_docs.py +30 -0
  445. keg2-0.1.0/src/keg2.egg-info/PKG-INFO +190 -0
  446. keg2-0.1.0/src/keg2.egg-info/SOURCES.txt +465 -0
  447. keg2-0.1.0/src/keg2.egg-info/dependency_links.txt +1 -0
  448. keg2-0.1.0/src/keg2.egg-info/entry_points.txt +2 -0
  449. keg2-0.1.0/src/keg2.egg-info/requires.txt +13 -0
  450. keg2-0.1.0/src/keg2.egg-info/top_level.txt +29 -0
  451. keg2-0.1.0/src/linter/ch_move.py +70 -0
  452. keg2-0.1.0/src/linter/chapter_migration_tools.py +176 -0
  453. keg2-0.1.0/src/linter/create_notebook.py +56 -0
  454. keg2-0.1.0/src/linter/line_counter.py +51 -0
  455. keg2-0.1.0/src/linter/rename_paths.py +32 -0
  456. keg2-0.1.0/src/linter/style.py +498 -0
  457. keg2-0.1.0/src/linter/test/_linter_funcs/test_class_style.py +1 -0
  458. keg2-0.1.0/src/linter/test/_linter_funcs/test_linter_funcs.py +43 -0
  459. keg2-0.1.0/src/linter/test/apply_linter/test__py_file_chapter.py +53 -0
  460. keg2-0.1.0/src/linter/test/apply_linter/test_chapter_dirs.py +156 -0
  461. keg2-0.1.0/src/linter/test/apply_linter/test_chapter_filenames.py +49 -0
  462. keg2-0.1.0/src/linter/test/apply_linter/test_chapter_keywords.py +293 -0
  463. keg2-0.1.0/src/linter/test/apply_linter/test_chapter_z_functions.py +121 -0
  464. keg2-0.1.0/src/linter/test/migration_tools/test_directory_count.py +5 -0
  465. keg2-0.1.0/src/linter/test/migration_tools/test_find_replace.py +124 -0
  466. keg2-0.1.0/src/linter/test/migration_tools/test_rename_paths.py +289 -0
  467. keg2-0.1.0/src/ref/keywords.py +7590 -0
keg2-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,190 @@
1
+ Metadata-Version: 2.4
2
+ Name: keg2
3
+ Version: 0.1.0
4
+ Summary: A Python package for communicating across cultures.
5
+ Author-email: Emmanuel Schalk <emmanuelschalk@gmail.com>
6
+ License: MIT
7
+ Requires-Python: >=3.7
8
+ Description-Content-Type: text/markdown
9
+ Requires-Dist: compact_json
10
+ Requires-Dist: flask
11
+ Requires-Dist: flask_cors
12
+ Requires-Dist: importlib
13
+ Requires-Dist: pandas
14
+ Requires-Dist: plotly
15
+ Requires-Dist: openpyxl
16
+ Requires-Dist: sqlalchemy
17
+ Requires-Dist: xlsxwriter
18
+ Provides-Extra: test
19
+ Requires-Dist: pytest; extra == "test"
20
+ Requires-Dist: pytest-cov; extra == "test"
21
+
22
+ repo: https://github.com/jschalk/keg
23
+
24
+ ![keg logo](https://github.com/jschalk/keg/tree/main/logo/keg_64.png) keg
25
+
26
+ [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
27
+
28
+
29
+ KEG Version 0.0.0
30
+
31
+ `keg` is a python library for listening to the climate of a community.
32
+
33
+ ## 0.0 About keg
34
+
35
+ 'keg' is a tool that helps me listen to the people important to me in my life. I hope it can help you too. Let's assume I want to listen to you. If you give me a list of things that are important to you I want to be able to take your list, combine it with the lists of all the others I am about and get a output of a list of things I should do and metrics that describe my ability to do things . keg does this for all
36
+
37
+ 'keg' is based on the philosohpy of Emmanuel Levinas (1906-1995) as expressed in his book "Totality and Infinity: An Essay on Exteriority" (translated by Lingis, 1969) and taught to me by Jules Simon PhD (born 1959) Professor at The University of Texas at El Paso (UTEP). I took Jules's course "Levinas: Phenomenology of the Ethical" in 2014 and am still working through the implications. The most important idea that motivated keg was how Levinas describes murder as the act of not listening. It is painful to really listen, to listen in such a rope as to not know what is going to be said. To take in the suffering of the Other and bring them into myself and change myself in ropes that are by definition imaginable. Because if I could imagine them then they would not be a change. By definition I'm only listening if it changes me in ropes I can't predict.
38
+
39
+ So how do I listen? keg has an engine for converting the declarations (as data) into pledge lists. How to input the data? The most accessible method is using excel sheets.
40
+
41
+ # 0.0.1 "Moments" The foundation of keg
42
+ For Levinas all of reality is born from the face to face encounter. The same (me) welcomes the Other through the Face. The Face of the other tells me it's suffering and it's suffering becomes me. I then MOMENT to change who I am to ease that suffering. The suffering is infinitely deep and beyond my complete understanding so when I moment to respond to that suffering I am acting with confidence that I understand what the suffering is and that I know how to respond. That confidence stops the listening process, the Moment cuts the infinite into the finite and is the foundation for a world. When that Moment is created it can create a world. Worlds can hold a infinite amount of human experience. A small subset of that is logical systems. keg is uses programming to build that logic.
43
+
44
+ A Moment can create a world or change a current world. Each person can only make one moment at a time so a world that has been built by multiple moments implies each moment is from a different time. Keg indexs time by *spark_nums* with the assumption that *spark_num* is always an integer. A discrete indivisible unit of time.
45
+
46
+ For keg all data must have *spark_num*, *face_name*, and a rope, either *moment_rope* or *plan_rope*. These are the required keys.
47
+
48
+
49
+ ## 0.1 Short introduction to keg excel sheets
50
+
51
+ `keg` is a python library for listening to the needs of my neighbors and in turn letting them know what I need. Needs can be expressed in Excel sheets that range in complexity from a simple five column single row (example below) to 10+ columns that include configuration options that are usually set to defaults. Each row is translated and used to build the "lynx" data set. Even sheet with a single row like the example 0.1.0 below can be processed by keg.
52
+
53
+ # Input Example Excel file 0.1.0: fizz0.xlsx with sheet "br00000_buzz"
54
+ | spark_num | face_name | moment_rope | person_name | contact_name | tran_time | amount |
55
+ |-----------|-----------|-----------|------------|-----------|-----------|--------|
56
+ | 77 | Emmanuel | OxboxDean | Emmanuel | Dean | 891 | 7000 |
57
+
58
+ When keg processes example 0.1.0 it creates a Moment labeled "OxboxDean" that contains persons Emmanuel and Dean and a single transaction of 7000 OxboxDean from Emmanuel to Dean. Here's a metric:
59
+ | moment_rope | person_name | moment_fund_amount | moment_fund_rank | moment_pledges |
60
+ |--------------|---------------|--------------------|------------------|--------------|
61
+ | OxboxDean | Emmanuel | -7000 | 2 | 0 |
62
+ | OxboxDean | Dean | 7000 | 1 | 0 |
63
+
64
+
65
+ Output stance: emmanuel_stance.xlsx, sheet "br00000"
66
+ | spark_num | face_name | moment_rope | person_name | contact_name | tran_time | amount |
67
+ |-----------|-----------|--------------|---------------|-----------|-----------|--------|
68
+ | 77 | Emmanuel | OxboxDean | Emmanuel | Dean | 891 | 7000 |
69
+
70
+
71
+ <!-- # Input Example Excel file 0.1.2: fizz2.xlsx with sheet "br00000_buzz2"
72
+ | spark_num | face_name | moment_rope | person_name | contact_name | contact_cred_points | contact_debt_points |
73
+ |-----------|-----------|-----------|------------|-----------|---------------|---------------|
74
+ | 77 | Emmanuel | OxboxDean | Emmanuel | Dean | 100 | 15 |
75
+ | 77 | Emmanuel | OxboxDean | Emmanuel | Emmanuel | 50 | 75 |
76
+ | 78 | Sue | OxboxDean | Sue | Sue | 2 | 7 |
77
+ | 78 | Sue | OxboxDean | Sue | Sue | 50 | 75 |
78
+
79
+ -->
80
+
81
+ `keg` is a python library for listening to the climate of a community. Individual
82
+ positions are aggregated by a listener into a coherant agenda that can include pledges
83
+ to do and pledges of of existence. Listening and acting on it.
84
+
85
+ A contact's agenda in the community is built by the the stared intreprtation of
86
+ 1. Other contacts' agendas
87
+ 2. Their own independent agenda
88
+
89
+ Each agenda is saved as a JSON file.
90
+
91
+ This is mostly a one man projeect. Femi has significantly helped.
92
+
93
+
94
+ ### 1.0 Installing `keg`
95
+
96
+ <!-- TODO: add dependencies -->
97
+
98
+ Future enhancement: `keg` can be installed using `pip`
99
+
100
+ <!-- TODO: Get pip install to function correctly
101
+
102
+ pip install keg
103
+
104
+ If you have installed `keg` before, and you should ensure `pip` downloads the latest version (rather than using cache) you can use the follow ing commands:
105
+
106
+ pip uninstall keg
107
+ pip install --no-cache keg
108
+
109
+ -->
110
+
111
+ ### 1.1 Hello
112
+
113
+ <!-- TODO: Add simplest example
114
+
115
+ Should examples be found in a separate repository to ensure the `keg` repository stays
116
+ relatively small, whilst still providing a thorough knowledgebase of code-samples,
117
+ screenshots and elucidatory text.
118
+
119
+ -->
120
+
121
+ ## 1.2 Notes about data structure
122
+
123
+ <!-- TODO: Add elucidations -->
124
+ base attributes vs reason attributess
125
+
126
+ PersonUnit objects
127
+
128
+ PersonUnit ContactUnit objects
129
+
130
+ PersonUnit GroupUnit objects
131
+
132
+ PersonUnit PlanUnit objects
133
+
134
+ PersonUnit PlanUnit hierarchical structure
135
+
136
+ PersonUnit PlanUnit AwardUnit objects
137
+
138
+ PersonUnit PlanUnit AwardLine objects
139
+
140
+ PersonUnit PlanUnit AwardHeir objects
141
+
142
+ PersonUnit PlanUnit AwardHeir objects
143
+
144
+ PersonUnit PlanUnit Reason CaseUnit objects
145
+
146
+ PersonUnit PlanUnit Reason CaseHeir objects
147
+
148
+ PersonUnit PlanUnit FactUnit objects
149
+
150
+ PersonUnit PlanUnit FactHeir objects1
151
+
152
+
153
+ ## 1.3 Test-Driven-Development
154
+
155
+ keg was developed using Test-Driven-Development so every feature should have a test.
156
+ Tests can be hard to comprehend. Some tests have many variables and can be hard to follow.
157
+
158
+ <!-- TODO: Add examples
159
+ Should examples be in a separate repository to ensure the `keg` repository stays
160
+ relatively small? (whilst still providing a thorough knowledgebase of code-samples,
161
+ screenshots and elucidatory text.)
162
+ -->
163
+
164
+
165
+
166
+ ## 2. License
167
+
168
+ <!-- TODO: Consider which license to pick -->
169
+
170
+
171
+ ## 3. Acknowledgements
172
+
173
+ <!-- TODO: Consider which license to pick -->
174
+
175
+
176
+
177
+
178
+
179
+ <!-- TODO: Find out how to autopopulate the below modeled after the borb library
180
+ [![Corpus Coverage : 100.0%](https://img.shields.io/badge/corpus%20coverage-100.0%25-green)]()
181
+ [![Public Method Documentation : 100%](https://img.shields.io/badge/public%20method%20documentation-100%25-green)]()
182
+ [![Number of Tests : 615](https://img.shields.io/badge/number%20of%20tests-615-green)]()
183
+ [![Python : 3.8 | 3.9 | 3.10 ](https://img.shields.io/badge/python-3.8%20&#124;%203.9%20&#124;%203.10-green)]()
184
+
185
+ [![Downloads](https://pepy.tech/badge/borb)](https://pepy.tech/projeect/borb)
186
+ [![Downloads](https://pepy.tech/badge/borb/month)](https://pepy.tech/projeect/borb)
187
+ -->
188
+
189
+
190
+ ## Testing
keg2-0.1.0/README.md ADDED
@@ -0,0 +1,169 @@
1
+ repo: https://github.com/jschalk/keg
2
+
3
+ ![keg logo](https://github.com/jschalk/keg/tree/main/logo/keg_64.png) keg
4
+
5
+ [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
6
+
7
+
8
+ KEG Version 0.0.0
9
+
10
+ `keg` is a python library for listening to the climate of a community.
11
+
12
+ ## 0.0 About keg
13
+
14
+ 'keg' is a tool that helps me listen to the people important to me in my life. I hope it can help you too. Let's assume I want to listen to you. If you give me a list of things that are important to you I want to be able to take your list, combine it with the lists of all the others I am about and get a output of a list of things I should do and metrics that describe my ability to do things . keg does this for all
15
+
16
+ 'keg' is based on the philosohpy of Emmanuel Levinas (1906-1995) as expressed in his book "Totality and Infinity: An Essay on Exteriority" (translated by Lingis, 1969) and taught to me by Jules Simon PhD (born 1959) Professor at The University of Texas at El Paso (UTEP). I took Jules's course "Levinas: Phenomenology of the Ethical" in 2014 and am still working through the implications. The most important idea that motivated keg was how Levinas describes murder as the act of not listening. It is painful to really listen, to listen in such a rope as to not know what is going to be said. To take in the suffering of the Other and bring them into myself and change myself in ropes that are by definition imaginable. Because if I could imagine them then they would not be a change. By definition I'm only listening if it changes me in ropes I can't predict.
17
+
18
+ So how do I listen? keg has an engine for converting the declarations (as data) into pledge lists. How to input the data? The most accessible method is using excel sheets.
19
+
20
+ # 0.0.1 "Moments" The foundation of keg
21
+ For Levinas all of reality is born from the face to face encounter. The same (me) welcomes the Other through the Face. The Face of the other tells me it's suffering and it's suffering becomes me. I then MOMENT to change who I am to ease that suffering. The suffering is infinitely deep and beyond my complete understanding so when I moment to respond to that suffering I am acting with confidence that I understand what the suffering is and that I know how to respond. That confidence stops the listening process, the Moment cuts the infinite into the finite and is the foundation for a world. When that Moment is created it can create a world. Worlds can hold a infinite amount of human experience. A small subset of that is logical systems. keg is uses programming to build that logic.
22
+
23
+ A Moment can create a world or change a current world. Each person can only make one moment at a time so a world that has been built by multiple moments implies each moment is from a different time. Keg indexs time by *spark_nums* with the assumption that *spark_num* is always an integer. A discrete indivisible unit of time.
24
+
25
+ For keg all data must have *spark_num*, *face_name*, and a rope, either *moment_rope* or *plan_rope*. These are the required keys.
26
+
27
+
28
+ ## 0.1 Short introduction to keg excel sheets
29
+
30
+ `keg` is a python library for listening to the needs of my neighbors and in turn letting them know what I need. Needs can be expressed in Excel sheets that range in complexity from a simple five column single row (example below) to 10+ columns that include configuration options that are usually set to defaults. Each row is translated and used to build the "lynx" data set. Even sheet with a single row like the example 0.1.0 below can be processed by keg.
31
+
32
+ # Input Example Excel file 0.1.0: fizz0.xlsx with sheet "br00000_buzz"
33
+ | spark_num | face_name | moment_rope | person_name | contact_name | tran_time | amount |
34
+ |-----------|-----------|-----------|------------|-----------|-----------|--------|
35
+ | 77 | Emmanuel | OxboxDean | Emmanuel | Dean | 891 | 7000 |
36
+
37
+ When keg processes example 0.1.0 it creates a Moment labeled "OxboxDean" that contains persons Emmanuel and Dean and a single transaction of 7000 OxboxDean from Emmanuel to Dean. Here's a metric:
38
+ | moment_rope | person_name | moment_fund_amount | moment_fund_rank | moment_pledges |
39
+ |--------------|---------------|--------------------|------------------|--------------|
40
+ | OxboxDean | Emmanuel | -7000 | 2 | 0 |
41
+ | OxboxDean | Dean | 7000 | 1 | 0 |
42
+
43
+
44
+ Output stance: emmanuel_stance.xlsx, sheet "br00000"
45
+ | spark_num | face_name | moment_rope | person_name | contact_name | tran_time | amount |
46
+ |-----------|-----------|--------------|---------------|-----------|-----------|--------|
47
+ | 77 | Emmanuel | OxboxDean | Emmanuel | Dean | 891 | 7000 |
48
+
49
+
50
+ <!-- # Input Example Excel file 0.1.2: fizz2.xlsx with sheet "br00000_buzz2"
51
+ | spark_num | face_name | moment_rope | person_name | contact_name | contact_cred_points | contact_debt_points |
52
+ |-----------|-----------|-----------|------------|-----------|---------------|---------------|
53
+ | 77 | Emmanuel | OxboxDean | Emmanuel | Dean | 100 | 15 |
54
+ | 77 | Emmanuel | OxboxDean | Emmanuel | Emmanuel | 50 | 75 |
55
+ | 78 | Sue | OxboxDean | Sue | Sue | 2 | 7 |
56
+ | 78 | Sue | OxboxDean | Sue | Sue | 50 | 75 |
57
+
58
+ -->
59
+
60
+ `keg` is a python library for listening to the climate of a community. Individual
61
+ positions are aggregated by a listener into a coherant agenda that can include pledges
62
+ to do and pledges of of existence. Listening and acting on it.
63
+
64
+ A contact's agenda in the community is built by the the stared intreprtation of
65
+ 1. Other contacts' agendas
66
+ 2. Their own independent agenda
67
+
68
+ Each agenda is saved as a JSON file.
69
+
70
+ This is mostly a one man projeect. Femi has significantly helped.
71
+
72
+
73
+ ### 1.0 Installing `keg`
74
+
75
+ <!-- TODO: add dependencies -->
76
+
77
+ Future enhancement: `keg` can be installed using `pip`
78
+
79
+ <!-- TODO: Get pip install to function correctly
80
+
81
+ pip install keg
82
+
83
+ If you have installed `keg` before, and you should ensure `pip` downloads the latest version (rather than using cache) you can use the follow ing commands:
84
+
85
+ pip uninstall keg
86
+ pip install --no-cache keg
87
+
88
+ -->
89
+
90
+ ### 1.1 Hello
91
+
92
+ <!-- TODO: Add simplest example
93
+
94
+ Should examples be found in a separate repository to ensure the `keg` repository stays
95
+ relatively small, whilst still providing a thorough knowledgebase of code-samples,
96
+ screenshots and elucidatory text.
97
+
98
+ -->
99
+
100
+ ## 1.2 Notes about data structure
101
+
102
+ <!-- TODO: Add elucidations -->
103
+ base attributes vs reason attributess
104
+
105
+ PersonUnit objects
106
+
107
+ PersonUnit ContactUnit objects
108
+
109
+ PersonUnit GroupUnit objects
110
+
111
+ PersonUnit PlanUnit objects
112
+
113
+ PersonUnit PlanUnit hierarchical structure
114
+
115
+ PersonUnit PlanUnit AwardUnit objects
116
+
117
+ PersonUnit PlanUnit AwardLine objects
118
+
119
+ PersonUnit PlanUnit AwardHeir objects
120
+
121
+ PersonUnit PlanUnit AwardHeir objects
122
+
123
+ PersonUnit PlanUnit Reason CaseUnit objects
124
+
125
+ PersonUnit PlanUnit Reason CaseHeir objects
126
+
127
+ PersonUnit PlanUnit FactUnit objects
128
+
129
+ PersonUnit PlanUnit FactHeir objects1
130
+
131
+
132
+ ## 1.3 Test-Driven-Development
133
+
134
+ keg was developed using Test-Driven-Development so every feature should have a test.
135
+ Tests can be hard to comprehend. Some tests have many variables and can be hard to follow.
136
+
137
+ <!-- TODO: Add examples
138
+ Should examples be in a separate repository to ensure the `keg` repository stays
139
+ relatively small? (whilst still providing a thorough knowledgebase of code-samples,
140
+ screenshots and elucidatory text.)
141
+ -->
142
+
143
+
144
+
145
+ ## 2. License
146
+
147
+ <!-- TODO: Consider which license to pick -->
148
+
149
+
150
+ ## 3. Acknowledgements
151
+
152
+ <!-- TODO: Consider which license to pick -->
153
+
154
+
155
+
156
+
157
+
158
+ <!-- TODO: Find out how to autopopulate the below modeled after the borb library
159
+ [![Corpus Coverage : 100.0%](https://img.shields.io/badge/corpus%20coverage-100.0%25-green)]()
160
+ [![Public Method Documentation : 100%](https://img.shields.io/badge/public%20method%20documentation-100%25-green)]()
161
+ [![Number of Tests : 615](https://img.shields.io/badge/number%20of%20tests-615-green)]()
162
+ [![Python : 3.8 | 3.9 | 3.10 ](https://img.shields.io/badge/python-3.8%20&#124;%203.9%20&#124;%203.10-green)]()
163
+
164
+ [![Downloads](https://pepy.tech/badge/borb)](https://pepy.tech/projeect/borb)
165
+ [![Downloads](https://pepy.tech/badge/borb/month)](https://pepy.tech/projeect/borb)
166
+ -->
167
+
168
+
169
+ ## Testing
@@ -0,0 +1,58 @@
1
+ [project]
2
+ authors = [{name = "Emmanuel Schalk", email = "emmanuelschalk@gmail.com"}]
3
+ dependencies = [
4
+ "compact_json",
5
+ "flask",
6
+ "flask_cors",
7
+ "importlib",
8
+ "pandas",
9
+ "plotly",
10
+ "openpyxl",
11
+ "sqlalchemy",
12
+ "xlsxwriter",
13
+ ]
14
+ description = "A Python package for communicating across cultures."
15
+ license = {text = "MIT"}
16
+ name = "keg2"
17
+ readme = "README.md"
18
+ requires-python = ">=3.7"
19
+ version = "0.1.0"
20
+
21
+ [build-system]
22
+ build-backend = "setuptools.build_meta"
23
+ requires = ["setuptools", "wheel"]
24
+
25
+ [tool.isort]
26
+ combine_as_imports = true
27
+ force_sort_within_sections = true
28
+ no_sections = true
29
+ profile = "black"
30
+
31
+ [project.scripts]
32
+ listen = "listen:main"
33
+
34
+ [project.optional-dependencies]
35
+ test = [
36
+ "pytest",
37
+ "pytest-cov",
38
+ ]
39
+
40
+ # [tool.semantic_release]
41
+ # branch = "main"
42
+ # build_command = ""
43
+ # changelog_file = "CHANGELOG.md"
44
+ # plugins = [
45
+ # "semantic_release.hooks.commit_parser",
46
+ # "semantic_release.hooks.tag_formatter",
47
+ # ]
48
+ # tag_format = "v{version}"
49
+ # upload_to_pypi = false
50
+ # version_variable = "keg/__init__.py:__version__"
51
+
52
+ [tool.commitizen]
53
+ name = "cz_conventional_commits"
54
+ tag_format = "v$version"
55
+ version = "0.1.0"
56
+
57
+ [tool.setuptools.packages.find]
58
+ where = ["src"]
keg2-0.1.0/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,23 @@
1
+ from src.ch00_py.file_toolbox import create_path
2
+
3
+
4
+ def create_src_example_strs_path(src_dir: str) -> str:
5
+ """Returns path: src\\ref\\example_strs.json"""
6
+
7
+ ref_dir = create_path(src_dir, "ref")
8
+ return create_path(ref_dir, "example_strs.json")
9
+
10
+
11
+ def create_src_keywords_main_path(src_dir: str) -> str:
12
+ """Returns path: src\\ref\\keywords_main.json"""
13
+
14
+ ref_dir = create_path(src_dir, "ref")
15
+ return create_path(ref_dir, "keywords_main.json")
16
+
17
+
18
+ def create_keywords_classes_file_path(src_dir: str) -> str:
19
+ """Returns path: src\\ref\\keywords.py"""
20
+
21
+ # ref_dir = create_path(chapter_dir, "_ref")
22
+ ref_dir = create_path(src_dir, "ref")
23
+ return create_path(ref_dir, "keywords.py")
@@ -0,0 +1,38 @@
1
+ from src.ch00_py.file_toolbox import create_path, get_level1_dirs
2
+
3
+
4
+ def get_chapter_descs() -> dict[str, str]:
5
+ """Returns chapter_desc, chapter_dir for all Chapters"""
6
+ src_dir = "src"
7
+ chapter_descs = get_level1_dirs(src_dir)
8
+ """linter is not evaluated"""
9
+ chapter_descs.remove("linter")
10
+ chapter_descs.remove("ref")
11
+ return {
12
+ chapter_desc: create_path(src_dir, chapter_desc)
13
+ for chapter_desc in chapter_descs
14
+ }
15
+
16
+
17
+ def get_chapter_desc_prefix(chapter_desc: str) -> str:
18
+ # sourcery skip: str-prefix-suffix
19
+ """Returns chapter number in 2 character string."""
20
+ if chapter_desc[:2] == "ch":
21
+ return chapter_desc[:4]
22
+
23
+
24
+ def get_chapter_desc_str_number(chapter_desc: str) -> str:
25
+ # sourcery skip: str-prefix-suffix
26
+ """Returns chapter number in 2 character string."""
27
+ if chapter_desc[:2] == "ch":
28
+ return chapter_desc[2:4]
29
+
30
+
31
+ def valid_chapter_numbers(chapter_descs: dict[str, str]) -> bool:
32
+ x_chapter_numbers = set()
33
+ for chapter_desc in chapter_descs:
34
+ chapter_number = int(get_chapter_desc_str_number(chapter_desc))
35
+ if chapter_number in x_chapter_numbers:
36
+ return False
37
+ x_chapter_numbers.add(chapter_number)
38
+ return True
@@ -0,0 +1,172 @@
1
+ from csv import (
2
+ DictReader as csv_DictReader,
3
+ DictWriter as csv_DictWriter,
4
+ reader as csv_reader,
5
+ writer as csv_writer,
6
+ )
7
+ from io import StringIO as io_StringIO
8
+ from os import makedirs as os_makedirs
9
+ from os.path import exists as os_path_exists, join as os_path_join
10
+ from sqlite3 import connect as sqlite3_connect
11
+
12
+
13
+ def open_csv_with_types(csv_path: str, column_types: dict):
14
+ """
15
+ Reads a CSV file and returns a list of tuples where each value is converted
16
+ to a type from the provided column type dictionary.
17
+
18
+ :param csv_path: Path to the CSV file.
19
+ :param column_types: Dictionary mapping column names to data types.
20
+ :return: List of tuples with typed values.
21
+ """
22
+ with open(csv_path, newline="", encoding="utf-8") as csv_file:
23
+ reader = csv_reader(csv_file)
24
+ headers = next(reader) # Read the header row
25
+
26
+ result = [tuple(headers)]
27
+ for row in reader:
28
+ typed_list = []
29
+ for header, value in zip(headers, row):
30
+ try:
31
+ if column_types[header] == "INTEGER":
32
+ if value == "":
33
+ typed_list.append(None)
34
+ else:
35
+ typed_list.append(int(value))
36
+ elif column_types[header] == "TEXT":
37
+ typed_list.append(str(value))
38
+ elif column_types[header] == "REAL":
39
+ if value == "":
40
+ typed_list.append(None)
41
+ else:
42
+ typed_list.append(float(value))
43
+ elif column_types[header] == "BOOLEAN":
44
+ if value.lower() == "true":
45
+ typed_list.append(True)
46
+ elif value.lower() == "false":
47
+ typed_list.append(False)
48
+ else:
49
+ typed_list.append(None)
50
+ except Exception:
51
+ typed_list.append(value)
52
+
53
+ result.append(tuple(typed_list))
54
+
55
+ return result
56
+
57
+
58
+ def export_sqlite_tables_to_csv(db_path, output_dir="."):
59
+ """
60
+ Exports all tables from the SQLite database to CSV files.
61
+ Each file is named <table_name>_<row_count>.csv.
62
+
63
+ Args:
64
+ db_path (str): Path to the SQLite database file.
65
+ output_dir (str): Directory to save the CSV files (default is current directory).
66
+ """
67
+ if not os_path_exists(output_dir):
68
+ os_makedirs(output_dir)
69
+
70
+ with sqlite3_connect(db_path) as conn:
71
+ cursor = conn.cursor()
72
+
73
+ # Get list of all table names
74
+ cursor.execute(
75
+ "SELECT name FROM sqlite_master WHERE type='table' AND name NOT LIKE 'sqlite_%'"
76
+ )
77
+ tables = cursor.fetchall()
78
+
79
+ for (table_name,) in tables:
80
+ # Get row count
81
+ cursor.execute(f"SELECT COUNT(*) FROM {table_name}")
82
+ row_count = cursor.fetchone()[0]
83
+
84
+ # Get table data
85
+ cursor.execute(f"SELECT * FROM {table_name}")
86
+ rows = cursor.fetchall()
87
+
88
+ # Get column names
89
+ column_names = [description[0] for description in cursor.description]
90
+
91
+ # Write to CSV
92
+ filename = f"{table_name}_{row_count}.csv"
93
+ file_path = os_path_join(output_dir, filename)
94
+
95
+ with open(file_path, "w", newline="", encoding="utf-8") as f:
96
+ writer = csv_writer(f)
97
+ writer.writerow(column_names)
98
+ writer.writerows(rows)
99
+ conn.close()
100
+
101
+
102
+ def replace_csv_column_from_string(
103
+ csv_string: str, column_name: str, new_value: str
104
+ ) -> str:
105
+ """
106
+ Replace all values in the specified column with new_value in the input CSV string.
107
+
108
+ Args:
109
+ csv_string (str): CSV content as a string.
110
+ column_name (str): Name of the column to replace.
111
+ new_value (str): Value to insert in place of each column value.
112
+
113
+ Returns:
114
+ str: Modified CSV content as a string.
115
+ """
116
+ input_io = io_StringIO(csv_string)
117
+ output_io = io_StringIO()
118
+
119
+ reader = csv_DictReader(input_io)
120
+ fieldnames = reader.fieldnames
121
+
122
+ if fieldnames is None:
123
+ snippet = input_io.getvalue()[:100] # Show up to 100 chars of the input
124
+ raise ValueError(
125
+ f"csv_string cannot be parsed into columns with headers. "
126
+ f"Input length: {len(input_io.getvalue())}. "
127
+ f"Input snippet: {snippet!r}"
128
+ )
129
+ if column_name not in fieldnames:
130
+ raise ValueError(f"Column '{column_name}' not found in CSV headers.")
131
+
132
+ writer = csv_DictWriter(output_io, fieldnames=fieldnames)
133
+ writer.writeheader()
134
+
135
+ for row in reader:
136
+ row[column_name] = new_value
137
+ writer.writerow(row)
138
+
139
+ csv_str = output_io.getvalue()
140
+ return csv_str.replace("\r", "")
141
+
142
+
143
+ def delete_column_from_csv_string(csv_string: str, column_to_delete: str) -> str:
144
+ """
145
+ Removes a column from a CSV string. If the column doesn't exist, returns the original CSV.
146
+
147
+ Args:
148
+ csv_string (str): The input CSV content as a string.
149
+ column_to_delete (str): The name of the column to remove.
150
+
151
+ Returns:
152
+ str: The CSV string with the column removed, or original if not found.
153
+ """
154
+ input_io = io_StringIO(csv_string)
155
+ output_io = io_StringIO()
156
+
157
+ reader = csv_DictReader(input_io)
158
+
159
+ # If column not found, return original
160
+ if column_to_delete not in reader.fieldnames:
161
+ return csv_string
162
+
163
+ # Filtered columns
164
+ fieldnames = [field for field in reader.fieldnames if field != column_to_delete]
165
+ writer = csv_DictWriter(output_io, fieldnames=fieldnames)
166
+ writer.writeheader()
167
+
168
+ for row in reader:
169
+ row.pop(column_to_delete, None)
170
+ writer.writerow(row)
171
+
172
+ return output_io.getvalue()