osbot-utils 1.11.0__tar.gz → 1.15.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 (266) hide show
  1. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/PKG-INFO +8 -5
  2. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/README.md +2 -2
  3. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/base_classes/Kwargs_To_Self.py +92 -45
  4. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/graphs/mermaid/Mermaid__Graph.py +5 -3
  5. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/graphs/mermaid/Mermaid__Renderer.py +3 -1
  6. osbot_utils-1.15.0/osbot_utils/graphs/mermaid/models/Mermaid__Diagram__Type.py +16 -0
  7. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/graphs/mgraph/MGraph.py +4 -2
  8. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/Ast.py +6 -3
  9. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/html/Tag__Head.py +4 -2
  10. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/pubsub/PubSub__Client.py +2 -1
  11. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/pubsub/PubSub__Room.py +3 -1
  12. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/pubsub/PubSub__Server.py +4 -3
  13. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/sqlite/Sqlite__Cursor.py +4 -1
  14. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/sqlite/Sqlite__Database.py +4 -1
  15. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/sqlite/Sqlite__Table.py +10 -0
  16. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/sqlite/Sqlite__Table__Create.py +4 -2
  17. osbot_utils-1.15.0/osbot_utils/helpers/sqlite/domains/Sqlite__DB__Files.py +45 -0
  18. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/sqlite/domains/Sqlite__DB__Local.py +2 -1
  19. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/sqlite/models/Sqlite__Field__Type.py +7 -2
  20. osbot_utils-1.15.0/osbot_utils/helpers/sqlite/tables/Sqlite__Table__Files.py +86 -0
  21. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/testing/Profiler.py +2 -2
  22. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/testing/Temp_File.py +4 -4
  23. osbot_utils-1.15.0/osbot_utils/utils/Env.py +89 -0
  24. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/utils/Files.py +48 -3
  25. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/utils/Int.py +0 -1
  26. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/utils/Misc.py +8 -1
  27. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/utils/Objects.py +22 -21
  28. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/utils/Str.py +8 -2
  29. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/utils/Zip.py +44 -1
  30. osbot_utils-1.15.0/osbot_utils/utils/__init__.py +0 -0
  31. osbot_utils-1.15.0/osbot_utils/version +1 -0
  32. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/pyproject.toml +2 -8
  33. osbot_utils-1.11.0/osbot_utils/graphs/mermaid/models/Mermaid__Diagram__Type.py +0 -17
  34. osbot_utils-1.11.0/osbot_utils/helpers/sqlite/domains/Sqlite__DB__Files.py +0 -23
  35. osbot_utils-1.11.0/osbot_utils/helpers/sqlite/tables/Sqlite__Table__Files.py +0 -45
  36. osbot_utils-1.11.0/osbot_utils/utils/__init__.py +0 -16
  37. osbot_utils-1.11.0/osbot_utils/version +0 -1
  38. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/LICENSE +0 -0
  39. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/__init__.py +0 -0
  40. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/base_classes/Cache_Pickle.py +0 -0
  41. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/base_classes/Kwargs_To_Disk.py +0 -0
  42. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/base_classes/Type_Safe__List.py +0 -0
  43. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/base_classes/__init__.py +0 -0
  44. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/context_managers/__init__.py +0 -0
  45. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/context_managers/capture_duration.py +0 -0
  46. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/decorators/__init__.py +0 -0
  47. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/decorators/classes/__init__.py +0 -0
  48. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/decorators/classes/singleton.py +0 -0
  49. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/decorators/lists/__init__.py +0 -0
  50. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/decorators/lists/filter_list.py +0 -0
  51. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/decorators/lists/group_by.py +0 -0
  52. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/decorators/lists/index_by.py +0 -0
  53. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/decorators/methods/__init__.py +0 -0
  54. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/decorators/methods/cache.py +0 -0
  55. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/decorators/methods/cache_on_function.py +0 -0
  56. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/decorators/methods/cache_on_self.py +0 -0
  57. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/decorators/methods/cache_on_tmp.py +0 -0
  58. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/decorators/methods/capture_exception.py +0 -0
  59. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/decorators/methods/capture_status.py +0 -0
  60. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/decorators/methods/catch.py +0 -0
  61. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/decorators/methods/context.py +0 -0
  62. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/decorators/methods/depreciated.py +0 -0
  63. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/decorators/methods/function_type_check.py +0 -0
  64. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/decorators/methods/obj_as_context.py +0 -0
  65. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/decorators/methods/remove_return_value.py +0 -0
  66. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/decorators/methods/required_fields.py +0 -0
  67. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/fluent/Fluent_Dict.py +0 -0
  68. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/fluent/Fluent_List.py +0 -0
  69. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/fluent/__init__.py +0 -0
  70. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/graphs/__init__.py +0 -0
  71. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/graphs/mermaid/Mermaid.py +0 -0
  72. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/graphs/mermaid/Mermaid__Edge.py +0 -0
  73. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/graphs/mermaid/Mermaid__Node.py +0 -0
  74. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/graphs/mermaid/configs/Mermaid__Edge__Config.py +0 -0
  75. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/graphs/mermaid/configs/Mermaid__Node__Config.py +0 -0
  76. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/graphs/mermaid/configs/Mermaid__Render__Config.py +0 -0
  77. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/graphs/mermaid/examples/Mermaid_Examples__FlowChart.py +0 -0
  78. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/graphs/mermaid/models/Mermaid__Diagram_Direction.py +0 -0
  79. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/graphs/mermaid/models/Mermaid__Node__Shape.py +0 -0
  80. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/graphs/mgraph/MGraph__Config.py +0 -0
  81. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/graphs/mgraph/MGraph__Data.py +0 -0
  82. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/graphs/mgraph/MGraph__Edge.py +0 -0
  83. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/graphs/mgraph/MGraph__Node.py +0 -0
  84. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/graphs/mgraph/MGraph__Random_Graphs.py +0 -0
  85. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/graphs/mgraph/MGraph__Serializer.py +0 -0
  86. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/graphs/mgraph/MGraphs.py +0 -0
  87. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/graphs/mgraph/__init__.py +0 -0
  88. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/CPrint.py +0 -0
  89. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/Dict_To_Attr.py +0 -0
  90. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/Local_Cache.py +0 -0
  91. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/Local_Caches.py +0 -0
  92. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/Print_Table.py +0 -0
  93. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/Python_Audit.py +0 -0
  94. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/Random_Seed.py +0 -0
  95. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/SCP.py +0 -0
  96. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/SSH.py +0 -0
  97. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/Type_Registry.py +0 -0
  98. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/__init__.py +0 -0
  99. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/Ast_Base.py +0 -0
  100. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/Ast_Data.py +0 -0
  101. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/Ast_Load.py +0 -0
  102. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/Ast_Merge.py +0 -0
  103. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/Ast_Node.py +0 -0
  104. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/Ast_Visit.py +0 -0
  105. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/Call_Tree.py +0 -0
  106. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/__init__.py +0 -0
  107. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Add.py +0 -0
  108. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Alias.py +0 -0
  109. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_And.py +0 -0
  110. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Argument.py +0 -0
  111. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Arguments.py +0 -0
  112. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Assert.py +0 -0
  113. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Assign.py +0 -0
  114. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Attribute.py +0 -0
  115. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Aug_Assign.py +0 -0
  116. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Bin_Op.py +0 -0
  117. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Bool_Op.py +0 -0
  118. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Break.py +0 -0
  119. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Call.py +0 -0
  120. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Class_Def.py +0 -0
  121. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Compare.py +0 -0
  122. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Comprehension.py +0 -0
  123. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Constant.py +0 -0
  124. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Continue.py +0 -0
  125. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Dict.py +0 -0
  126. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Eq.py +0 -0
  127. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Except_Handler.py +0 -0
  128. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Expr.py +0 -0
  129. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_For.py +0 -0
  130. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Function_Def.py +0 -0
  131. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Generator_Exp.py +0 -0
  132. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Gt.py +0 -0
  133. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_GtE.py +0 -0
  134. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_If.py +0 -0
  135. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_If_Exp.py +0 -0
  136. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Import.py +0 -0
  137. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Import_From.py +0 -0
  138. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_In.py +0 -0
  139. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Is.py +0 -0
  140. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Is_Not.py +0 -0
  141. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Keyword.py +0 -0
  142. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Lambda.py +0 -0
  143. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_List.py +0 -0
  144. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_List_Comp.py +0 -0
  145. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Load.py +0 -0
  146. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Lt.py +0 -0
  147. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_LtE.py +0 -0
  148. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Mod.py +0 -0
  149. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Module.py +0 -0
  150. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Mult.py +0 -0
  151. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Name.py +0 -0
  152. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Not.py +0 -0
  153. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Not_Eq.py +0 -0
  154. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Not_In.py +0 -0
  155. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Or.py +0 -0
  156. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Pass.py +0 -0
  157. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Pow.py +0 -0
  158. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Raise.py +0 -0
  159. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Return.py +0 -0
  160. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Set.py +0 -0
  161. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Slice.py +0 -0
  162. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Starred.py +0 -0
  163. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Store.py +0 -0
  164. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Sub.py +0 -0
  165. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Subscript.py +0 -0
  166. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Try.py +0 -0
  167. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Tuple.py +0 -0
  168. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Unary_Op.py +0 -0
  169. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_While.py +0 -0
  170. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_With.py +0 -0
  171. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_With_Item.py +0 -0
  172. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/Ast_Yield.py +0 -0
  173. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/ast/nodes/__init__.py +0 -0
  174. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/html/Dict_To_Css.py +0 -0
  175. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/html/Dict_To_Html.py +0 -0
  176. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/html/Dict_To_Tags.py +0 -0
  177. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/html/Html_To_Dict.py +0 -0
  178. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/html/Html_To_Tag.py +0 -0
  179. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/html/Tag__Base.py +0 -0
  180. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/html/Tag__Body.py +0 -0
  181. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/html/Tag__Div.py +0 -0
  182. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/html/Tag__H.py +0 -0
  183. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/html/Tag__HR.py +0 -0
  184. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/html/Tag__Html.py +0 -0
  185. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/html/Tag__Link.py +0 -0
  186. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/html/Tag__Style.py +0 -0
  187. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/html/__init__.py +0 -0
  188. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/pubsub/Event__Queue.py +0 -0
  189. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/pubsub/PubSub__Sqlite.py +0 -0
  190. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/pubsub/__init__.py +0 -0
  191. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/pubsub/schemas/Schema__Event.py +0 -0
  192. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/pubsub/schemas/Schema__Event__Connect.py +0 -0
  193. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/pubsub/schemas/Schema__Event__Disconnect.py +0 -0
  194. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/pubsub/schemas/Schema__Event__Join_Room.py +0 -0
  195. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/pubsub/schemas/Schema__Event__Leave_Room.py +0 -0
  196. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/pubsub/schemas/Schema__Event__Message.py +0 -0
  197. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/pubsub/schemas/Schema__PubSub__Client.py +0 -0
  198. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/pubsub/schemas/__init__.py +0 -0
  199. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/sqlite/Capture_Sqlite_Error.py +0 -0
  200. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/sqlite/Sqlite__Field.py +0 -0
  201. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/sqlite/Sqlite__Globals.py +0 -0
  202. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/sqlite/Temp_Sqlite__Database__Disk.py +0 -0
  203. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/sqlite/Temp_Sqlite__Table.py +0 -0
  204. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/sqlite/__init__.py +0 -0
  205. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/sqlite/domains/Sqlite__Cache__Requests.py +0 -0
  206. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/sqlite/domains/Sqlite__Cache__Requests__Patch.py +0 -0
  207. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/sqlite/domains/Sqlite__DB__Graph.py +0 -0
  208. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/sqlite/domains/Sqlite__DB__Json.py +0 -0
  209. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/sqlite/domains/Sqlite__DB__Requests.py +0 -0
  210. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/sqlite/domains/__init__.py +0 -0
  211. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/sqlite/domains/schemas/Schema__Table__Requests.py +0 -0
  212. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/sqlite/domains/schemas/__init__.py +0 -0
  213. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/sqlite/models/__init__.py +0 -0
  214. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/sqlite/sample_data/Sqlite__Sample_Data__Chinook.py +0 -0
  215. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/sqlite/sample_data/__init__.py +0 -0
  216. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/sqlite/sql_builder/SQL_Builder.py +0 -0
  217. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/sqlite/sql_builder/SQL_Builder__Select.py +0 -0
  218. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/sqlite/sql_builder/__init__.py +0 -0
  219. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/sqlite/tables/Sqlite__Table__Config.py +0 -0
  220. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/sqlite/tables/Sqlite__Table__Edges.py +0 -0
  221. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/sqlite/tables/Sqlite__Table__Nodes.py +0 -0
  222. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/sqlite/tables/__init__.py +0 -0
  223. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/trace/Trace_Call.py +0 -0
  224. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/trace/Trace_Call__Config.py +0 -0
  225. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/trace/Trace_Call__Graph.py +0 -0
  226. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/trace/Trace_Call__Handler.py +0 -0
  227. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/trace/Trace_Call__Print_Lines.py +0 -0
  228. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/trace/Trace_Call__Print_Traces.py +0 -0
  229. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/trace/Trace_Call__Stack.py +0 -0
  230. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/trace/Trace_Call__Stack_Node.py +0 -0
  231. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/trace/Trace_Call__Stats.py +0 -0
  232. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/trace/Trace_Call__View_Model.py +0 -0
  233. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/trace/Trace_Files.py +0 -0
  234. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/helpers/trace/__init__.py +0 -0
  235. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/testing/Catch.py +0 -0
  236. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/testing/Duration.py +0 -0
  237. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/testing/Hook_Method.py +0 -0
  238. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/testing/Log_To_Queue.py +0 -0
  239. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/testing/Log_To_String.py +0 -0
  240. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/testing/Logging.py +0 -0
  241. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/testing/Patch_Print.py +0 -0
  242. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/testing/Stderr.py +0 -0
  243. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/testing/Stdout.py +0 -0
  244. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/testing/Temp_Folder.py +0 -0
  245. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/testing/Temp_Sys_Path.py +0 -0
  246. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/testing/Temp_Web_Server.py +0 -0
  247. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/testing/Temp_Zip.py +0 -0
  248. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/testing/Temp_Zip_In_Memory.py +0 -0
  249. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/testing/Unit_Test.py +0 -0
  250. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/testing/Unzip_File.py +0 -0
  251. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/testing/__init__.py +0 -0
  252. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/utils/Assert.py +0 -0
  253. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/utils/Call_Stack.py +0 -0
  254. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/utils/Csv.py +0 -0
  255. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/utils/Dev.py +0 -0
  256. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/utils/Exceptions.py +0 -0
  257. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/utils/Functions.py +0 -0
  258. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/utils/Http.py +0 -0
  259. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/utils/Json.py +0 -0
  260. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/utils/Json_Cache.py +0 -0
  261. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/utils/Lists.py +0 -0
  262. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/utils/Png.py +0 -0
  263. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/utils/Process.py +0 -0
  264. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/utils/Python_Logger.py +0 -0
  265. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/utils/Status.py +0 -0
  266. {osbot_utils-1.11.0 → osbot_utils-1.15.0}/osbot_utils/utils/Version.py +0 -0
@@ -1,17 +1,20 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: osbot_utils
3
- Version: 1.11.0
3
+ Version: 1.15.0
4
4
  Summary: OWASP Security Bot - Utils
5
5
  Home-page: https://github.com/owasp-sbot/OSBot-Utils
6
6
  License: MIT
7
7
  Author: Dinis Cruz
8
8
  Author-email: dinis.cruz@owasp.org
9
- Requires-Python: >=3.11,<4.0
9
+ Requires-Python: >=3.7,<4.0
10
10
  Classifier: License :: OSI Approved :: MIT License
11
11
  Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.7
13
+ Classifier: Programming Language :: Python :: 3.8
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
12
16
  Classifier: Programming Language :: Python :: 3.11
13
17
  Classifier: Programming Language :: Python :: 3.12
14
- Requires-Dist: python-dotenv
15
18
  Project-URL: Repository, https://github.com/owasp-sbot/OSBot-Utils
16
19
  Description-Content-Type: text/markdown
17
20
 
@@ -19,14 +22,14 @@ Description-Content-Type: text/markdown
19
22
 
20
23
  Powerful Python util methods and classes that simplify common apis and tasks.
21
24
 
22
- ![Current Release](https://img.shields.io/badge/release-v1.11.0-blue)
25
+ ![Current Release](https://img.shields.io/badge/release-v1.15.0-blue)
23
26
  [![codecov](https://codecov.io/gh/owasp-sbot/OSBot-Utils/graph/badge.svg?token=GNVW0COX1N)](https://codecov.io/gh/owasp-sbot/OSBot-Utils)
24
27
 
25
28
 
26
29
 
27
30
  ## Install - Release 1.x
28
31
 
29
- **for main branch**: add to requirements.txt
32
+ **for main branch**: just get it from pypi
30
33
 
31
34
  ```
32
35
  pip install osbot-utils
@@ -2,14 +2,14 @@
2
2
 
3
3
  Powerful Python util methods and classes that simplify common apis and tasks.
4
4
 
5
- ![Current Release](https://img.shields.io/badge/release-v1.11.0-blue)
5
+ ![Current Release](https://img.shields.io/badge/release-v1.15.0-blue)
6
6
  [![codecov](https://codecov.io/gh/owasp-sbot/OSBot-Utils/graph/badge.svg?token=GNVW0COX1N)](https://codecov.io/gh/owasp-sbot/OSBot-Utils)
7
7
 
8
8
 
9
9
 
10
10
  ## Install - Release 1.x
11
11
 
12
- **for main branch**: add to requirements.txt
12
+ **for main branch**: just get it from pypi
13
13
 
14
14
  ```
15
15
  pip install osbot-utils
@@ -3,10 +3,12 @@
3
3
  # the data is available in IDE's code complete
4
4
  import functools
5
5
  import inspect
6
+ import sys
6
7
  import types
8
+ import typing
7
9
  from decimal import Decimal
8
- from enum import Enum, EnumMeta, EnumType
9
- from typing import get_origin, get_args
10
+ from enum import Enum, EnumMeta
11
+ from typing import List
10
12
 
11
13
  from osbot_utils.base_classes.Type_Safe__List import Type_Safe__List
12
14
  from osbot_utils.utils.Dev import pprint
@@ -16,7 +18,30 @@ from osbot_utils.utils.Objects import default_value, value_type
16
18
  raise_exception_on_obj_type_annotation_mismatch, obj_is_attribute_annotation_of_type, enum_from_value, \
17
19
  obj_is_type_union_compatible, value_type_matches_obj_annotation_for_union_attr
18
20
 
19
- immutable_types = (bool, int, float, complex, str, tuple, frozenset, bytes, types.NoneType, EnumMeta)
21
+ # Backport implementations of get_origin and get_args for Python 3.7
22
+ if sys.version_info < (3, 8):
23
+ def get_origin(tp):
24
+ if isinstance(tp, typing._GenericAlias):
25
+ return tp.__origin__
26
+ elif tp is typing.Generic:
27
+ return typing.Generic
28
+ else:
29
+ return None
30
+
31
+ def get_args(tp):
32
+ if isinstance(tp, typing._GenericAlias):
33
+ return tp.__args__
34
+ else:
35
+ return ()
36
+ else:
37
+ from typing import get_origin, get_args
38
+
39
+ if sys.version_info >= (3, 10):
40
+ NoneType = types.NoneType
41
+ else:
42
+ NoneType = type(None)
43
+
44
+ immutable_types = (bool, int, float, complex, str, tuple, frozenset, bytes, NoneType, EnumMeta)
20
45
 
21
46
 
22
47
  #todo: see if we can also add type safety to method execution
@@ -115,25 +140,28 @@ class Kwargs_To_Self: # todo: check if the description below is st
115
140
  def __exit__(self, exc_type, exc_val, exc_tb): pass
116
141
 
117
142
  def __setattr__(self, name, value):
118
- # if self.__type_safety__:
143
+ if not hasattr(self, '__annotations__'): # can't do type safety checks if the class does not have annotations
144
+ return super().__setattr__(name, value)
145
+
146
+ # if self.__type_safety__:
119
147
  # if self.__lock_attributes__:
120
148
  # todo: this can't work on all, current hypothesis is that this will work for the values that are explicitly set
121
149
  # if not hasattr(self, name):
122
150
  # raise AttributeError(f"'[Object Locked] Current object is locked (with __lock_attributes__=True) which prevents new attributes allocations (i.e. setattr calls). In this case {type(self).__name__}' object has no attribute '{name}'") from None
123
151
 
124
- if value is not None:
125
- check_1 = value_type_matches_obj_annotation_for_attr(self, name, value)
126
- check_2 = value_type_matches_obj_annotation_for_union_attr(self, name, value)
127
- if (check_1 is False and check_2 is None or
128
- check_1 is None and check_2 is False or
129
- check_1 is False and check_2 is False ): # fix for type safety assigment on Union vars
130
- raise Exception(f"Invalid type for attribute '{name}'. Expected '{self.__annotations__.get(name)}' but got '{type(value)}'")
131
- else:
132
- if hasattr(self, name) and self.__annotations__.get(name) : # don't allow previously set variables to be set to None
133
- if getattr(self, name) is not None: # unless it is already set to None
134
- raise Exception(f"Can't set None, to a variable that is already set. Invalid type for attribute '{name}'. Expected '{self.__annotations__.get(name)}' but got '{type(value)}'")
152
+ if value is not None:
153
+ check_1 = value_type_matches_obj_annotation_for_attr(self, name, value)
154
+ check_2 = value_type_matches_obj_annotation_for_union_attr(self, name, value)
155
+ if (check_1 is False and check_2 is None or
156
+ check_1 is None and check_2 is False or
157
+ check_1 is False and check_2 is False ): # fix for type safety assigment on Union vars
158
+ raise Exception(f"Invalid type for attribute '{name}'. Expected '{self.__annotations__.get(name)}' but got '{type(value)}'")
159
+ else:
160
+ if hasattr(self, name) and self.__annotations__.get(name) : # don't allow previously set variables to be set to None
161
+ if getattr(self, name) is not None: # unless it is already set to None
162
+ raise Exception(f"Can't set None, to a variable that is already set. Invalid type for attribute '{name}'. Expected '{self.__annotations__.get(name)}' but got '{type(value)}'")
135
163
 
136
- super().__setattr__(name, value)
164
+ super().__setattr__(name, value)
137
165
 
138
166
  def __attr_names__(self):
139
167
  return list_set(self.__locals__())
@@ -156,30 +184,43 @@ class Kwargs_To_Self: # todo: check if the description below is st
156
184
  if (k in kwargs) is False: # do not set the value is it has already been set
157
185
  kwargs[k] = v
158
186
 
159
- for var_name, var_type in base_cls.__annotations__.items():
160
- if hasattr(base_cls, var_name) is False: # only add if it has not already been defined
161
- if var_name in kwargs:
162
- continue
163
- var_value = cls.__default__value__(var_type)
164
- kwargs[var_name] = var_value
165
- else:
166
- var_value = getattr(base_cls, var_name)
167
- if var_value is not None: # allow None assignments on ctor since that is a valid use case
168
- if var_type and not isinstance(var_value, var_type): # check type
169
- exception_message = f"variable '{var_name}' is defined as type '{var_type}' but has value '{var_value}' of type '{type(var_value)}'"
170
- raise Exception(exception_message)
171
- if var_type not in immutable_types and var_name.startswith('__') is False: # if var_type is not one of the immutable_types or is an __ internal
172
- #todo: fix type safety bug that I believe is caused here
173
- if obj_is_type_union_compatible(var_type, immutable_types) is False: # if var_type is not something like Optional[Union[int, str]]
174
- if type(var_type) not in immutable_types:
175
- exception_message = f"variable '{var_name}' is defined as type '{var_type}' which is not supported by Kwargs_To_Self, with only the following immutable types being supported: '{immutable_types}'"
176
- raise Exception(exception_message)
187
+ if hasattr(base_cls,'__annotations__'): # can only do type safety checks if the class does not have annotations
188
+ for var_name, var_type in base_cls.__annotations__.items():
189
+ if hasattr(base_cls, var_name) is False: # only add if it has not already been defined
190
+ if var_name in kwargs:
191
+ continue
192
+ var_value = cls.__default__value__(var_type)
193
+ kwargs[var_name] = var_value
194
+ else:
195
+ var_value = getattr(base_cls, var_name)
196
+ if var_value is not None: # allow None assignments on ctor since that is a valid use case
197
+ if var_type and not isinstance(var_value, var_type): # check type
198
+ exception_message = f"variable '{var_name}' is defined as type '{var_type}' but has value '{var_value}' of type '{type(var_value)}'"
199
+ raise Exception(exception_message)
200
+ if var_type not in immutable_types and var_name.startswith('__') is False: # if var_type is not one of the immutable_types or is an __ internal
201
+ #todo: fix type safety bug that I believe is caused here
202
+ if obj_is_type_union_compatible(var_type, immutable_types) is False: # if var_type is not something like Optional[Union[int, str]]
203
+ if type(var_type) not in immutable_types:
204
+ exception_message = f"variable '{var_name}' is defined as type '{var_type}' which is not supported by Kwargs_To_Self, with only the following immutable types being supported: '{immutable_types}'"
205
+ raise Exception(exception_message)
177
206
  if include_base_classes is False:
178
207
  break
179
208
  return kwargs
180
209
 
181
210
  @classmethod
182
211
  def __default__value__(cls, var_type):
212
+ if var_type is typing.Set: # todo: refactor the dict, set and list logic, since they are 90% the same
213
+ return set()
214
+ if get_origin(var_type) is set:
215
+ return set() # todo: add Type_Safe__Set
216
+
217
+ if var_type is typing.Dict:
218
+ return {}
219
+ if get_origin(var_type) is dict:
220
+ return {} # todo: add Type_Safe__Dict
221
+
222
+ if var_type is typing.List:
223
+ return [] # handle case when List was used with no type information provided
183
224
  if get_origin(var_type) is list: # if we have list defined as list[type]
184
225
  item_type = get_args(var_type)[0] # get the type that was defined
185
226
  return Type_Safe__List(expected_type=item_type) # and used it as expected_type in Type_Safe__List
@@ -198,9 +239,10 @@ class Kwargs_To_Self: # todo: check if the description below is st
198
239
  if not isinstance(v, classmethod):
199
240
  kwargs[k] = v
200
241
  # add the vars defined with the annotations
201
- for var_name, var_type in base_cls.__annotations__.items():
202
- var_value = getattr(self, var_name)
203
- kwargs[var_name] = var_value
242
+ if hasattr(base_cls,'__annotations__'): # can only do type safety checks if the class does not have annotations
243
+ for var_name, var_type in base_cls.__annotations__.items():
244
+ var_value = getattr(self, var_name)
245
+ kwargs[var_name] = var_value
204
246
 
205
247
  return kwargs
206
248
 
@@ -230,7 +272,9 @@ class Kwargs_To_Self: # todo: check if the description below is st
230
272
 
231
273
  @classmethod
232
274
  def __schema__(cls):
233
- return cls.__annotations__
275
+ if hasattr(cls,'__annotations__'): # can only do type safety checks if the class does not have annotations
276
+ return cls.__annotations__
277
+ return {}
234
278
 
235
279
  # global methods added to any class that base classes this
236
280
  # todo: see if there should be a prefix on these methods, to make it easier to spot them
@@ -256,8 +300,9 @@ class Kwargs_To_Self: # todo: check if the description below is st
256
300
  """Update instance attributes with values from provided keyword arguments."""
257
301
  for key, value in kwargs.items():
258
302
  if value is not None:
259
- if value_type_matches_obj_annotation_for_attr(self, key, value) is False:
260
- raise Exception(f"Invalid type for attribute '{key}'. Expected '{self.__annotations__.get(key)}' but got '{type(value)}'")
303
+ if hasattr(self,'__annotations__'): # can only do type safety checks if the class does not have annotations
304
+ if value_type_matches_obj_annotation_for_attr(self, key, value) is False:
305
+ raise Exception(f"Invalid type for attribute '{key}'. Expected '{self.__annotations__.get(key)}' but got '{type(value)}'")
261
306
  setattr(self, key, value)
262
307
  return self
263
308
 
@@ -267,12 +312,14 @@ class Kwargs_To_Self: # todo: check if the description below is st
267
312
  if hasattr(self, key) and isinstance(getattr(self, key), Kwargs_To_Self):
268
313
  getattr(self, key).deserialize_from_dict(value) # Recursive call for complex nested objects
269
314
  else:
270
- if obj_is_attribute_annotation_of_type(self, key, EnumType): # handle the case when the value is an Enum
271
- enum_type = getattr(self, '__annotations__').get(key)
272
- if type(value) is not enum_type: # if the value is not already of the target type
273
- value = enum_from_value(enum_type, value) # try to resolve the value into the enum
315
+ if hasattr(self, '__annotations__'): # can only do type safety checks if the class does not have annotations
316
+ if obj_is_attribute_annotation_of_type(self, key, EnumMeta): # Handle the case when the value is an Enum
317
+ enum_type = getattr(self, '__annotations__').get(key)
318
+ if type(value) is not enum_type: # If the value is not already of the target type
319
+ value = enum_from_value(enum_type, value) # Try to resolve the value into the enum
274
320
 
275
321
  setattr(self, key, value) # Direct assignment for primitive types and other structures
322
+
276
323
  return self
277
324
 
278
325
  def serialize_to_dict(self): # todo: see if we need this method or if the .json() is enough
@@ -295,7 +342,7 @@ def serialize_to_dict(obj):
295
342
  return obj
296
343
  elif isinstance(obj, Enum):
297
344
  return obj.name
298
- elif isinstance(obj, list):
345
+ elif isinstance(obj, list) or isinstance(obj, List):
299
346
  return [serialize_to_dict(item) for item in obj]
300
347
  elif isinstance(obj, dict):
301
348
  return {key: serialize_to_dict(value) for key, value in obj.items()}
@@ -1,3 +1,5 @@
1
+ from typing import List
2
+
1
3
  from osbot_utils.graphs.mgraph.MGraph__Edge import MGraph__Edge
2
4
  from osbot_utils.graphs.mgraph.MGraph__Node import MGraph__Node
3
5
  from osbot_utils.graphs.mermaid.Mermaid__Edge import Mermaid__Edge
@@ -6,9 +8,9 @@ from osbot_utils.graphs.mgraph.MGraph import MGraph
6
8
 
7
9
 
8
10
  class Mermaid__Graph(MGraph):
9
- edges : list[Mermaid__Edge]
10
- mermaid_code : list
11
- nodes : list[Mermaid__Node]
11
+ edges : List[Mermaid__Edge]
12
+ mermaid_code : List
13
+ nodes : List[Mermaid__Node]
12
14
 
13
15
  # def __init__(self, mgraph=None):
14
16
  # super().__init__()
@@ -1,3 +1,5 @@
1
+ from typing import List
2
+
1
3
  from osbot_utils.base_classes.Kwargs_To_Self import Kwargs_To_Self
2
4
  from osbot_utils.graphs.mermaid.configs.Mermaid__Render__Config import Mermaid__Render__Config
3
5
  from osbot_utils.graphs.mermaid.models.Mermaid__Diagram_Direction import Diagram__Direction
@@ -6,7 +8,7 @@ from osbot_utils.graphs.mermaid.models.Mermaid__Diagram__Type import Diagr
6
8
 
7
9
  class Mermaid__Renderer(Kwargs_To_Self):
8
10
  config : Mermaid__Render__Config
9
- mermaid_code : list
11
+ mermaid_code : List
10
12
  diagram_direction : Diagram__Direction = Diagram__Direction.LR
11
13
  diagram_type : Diagram__Type = Diagram__Type.graph
12
14
 
@@ -0,0 +1,16 @@
1
+ from enum import Enum
2
+
3
+ class Diagram__Type(Enum):
4
+ class_diagram = "class_diagram"
5
+ entity_relationship_diagram = "entity_relationship_diagram"
6
+ flowchart = "flowchart"
7
+ gantt = "gantt"
8
+ git_graph = "git_graph"
9
+ graph = "graph"
10
+ mermaid_map = "mermaid_map"
11
+ mindmap = "mindmap"
12
+ pie_chart = "pie_chart"
13
+ requirement_diagram = "requirement_diagram"
14
+ sequence_diagram = "sequenceDiagram" # these are different from the others
15
+ state_diagram = "stateDiagram-v2" # these are different from the others
16
+ user_journey = "user_journey"
@@ -1,3 +1,5 @@
1
+ from typing import List
2
+
1
3
  from osbot_utils.utils.Misc import random_text, lower
2
4
  from osbot_utils.base_classes.Kwargs_To_Self import Kwargs_To_Self
3
5
  from osbot_utils.graphs.mgraph.MGraph__Config import MGraph__Config
@@ -8,9 +10,9 @@ from osbot_utils.graphs.mgraph.MGraph__Node import MGraph__Node
8
10
  # todo add support for storing the data in sqlite so that we get the ability to search nodes and edges
9
11
  class MGraph(Kwargs_To_Self):
10
12
  config : MGraph__Config
11
- edges : list[MGraph__Edge]
13
+ edges : List[MGraph__Edge]
12
14
  key : str
13
- nodes : list[MGraph__Node]
15
+ nodes : List[MGraph__Node]
14
16
 
15
17
 
16
18
  def __init__(self, **kwargs):
@@ -11,9 +11,12 @@ class Ast:
11
11
  pass
12
12
 
13
13
  def source_code__from(self, target):
14
- source_raw = inspect.getsource(target)
15
- source = str_dedent(source_raw) # remove any training spaces or it won't compile
16
- return source
14
+ try:
15
+ source_raw = inspect.getsource(target)
16
+ source = str_dedent(source_raw) # remove any training spaces or it won't compile
17
+ return source
18
+ except:
19
+ return None
17
20
 
18
21
  def ast_module__from(self, target):
19
22
  source_code = self.source_code__from(target)
@@ -1,3 +1,5 @@
1
+ from typing import List
2
+
1
3
  from osbot_utils.helpers.html.Tag__Base import Tag__Base
2
4
  from osbot_utils.helpers.html.Tag__Link import Tag__Link
3
5
  from osbot_utils.helpers.html.Tag__Style import Tag__Style
@@ -6,8 +8,8 @@ from osbot_utils.utils.Dev import pprint
6
8
 
7
9
  class Tag__Head(Tag__Base):
8
10
  title : str
9
- links : list[Tag__Link]
10
- meta : list[Tag__Base]
11
+ links : List[Tag__Link]
12
+ meta : List[Tag__Base]
11
13
  style : Tag__Style
12
14
 
13
15
  def __init__(self, **kwargs):
@@ -1,4 +1,5 @@
1
1
  from queue import Queue
2
+ from typing import List
2
3
 
3
4
  from osbot_utils.base_classes.Kwargs_To_Self import Kwargs_To_Self
4
5
  from osbot_utils.helpers.pubsub.Event__Queue import Event__Queue
@@ -13,7 +14,7 @@ from osbot_utils.utils.Misc import random_guid
13
14
  class PubSub__Client(Kwargs_To_Self):
14
15
  event_queue : Event__Queue
15
16
  client_id : str
16
- received_messages : list[str] # todo: fix this to be Events/Messages received via event_queue
17
+ received_messages : List[str] # todo: fix this to be Events/Messages received via event_queue
17
18
 
18
19
  def __init__(self, **kwargs):
19
20
  self.client_id = kwargs.get('client_id') or random_guid()
@@ -1,3 +1,5 @@
1
+ from typing import Set
2
+
1
3
  from osbot_utils.base_classes.Kwargs_To_Self import Kwargs_To_Self
2
4
  from osbot_utils.helpers.pubsub.Event__Queue import Event__Queue
3
5
  from osbot_utils.helpers.pubsub.PubSub__Client import PubSub__Client
@@ -6,7 +8,7 @@ from osbot_utils.helpers.pubsub.PubSub__Client import PubSub__Client
6
8
  class PubSub__Room(Kwargs_To_Self):
7
9
  event_queue: Event__Queue
8
10
  room_name : str
9
- clients : set[PubSub__Client]
11
+ clients : Set[PubSub__Client]
10
12
 
11
13
  def send_to_clients__message(self, message):
12
14
  for client in self.clients:
@@ -1,6 +1,7 @@
1
1
  import queue
2
2
  from threading import Thread
3
3
  from queue import Queue
4
+ from typing import Set, Dict
4
5
 
5
6
  from osbot_utils.helpers.pubsub.Event__Queue import Event__Queue
6
7
  from osbot_utils.helpers.pubsub.PubSub__Client import PubSub__Client
@@ -17,9 +18,9 @@ from osbot_utils.utils.Dev import pprin
17
18
 
18
19
  class PubSub__Server(Event__Queue):
19
20
  #pubsub_db: PubSub__Sqlite
20
- clients : dict
21
- clients_connected: set[PubSub__Client]
22
- rooms : dict[str, PubSub__Room]
21
+ clients : Dict
22
+ clients_connected: Set[PubSub__Client]
23
+ rooms : Dict[str, PubSub__Room]
23
24
  logging : Logging
24
25
 
25
26
  def __init__ (self):
@@ -84,4 +84,7 @@ class Sqlite__Cursor(Kwargs_To_Self):
84
84
  self.execute(sql_query)
85
85
  all_rows = self.cursor().fetchall()
86
86
  all_values = [cell.get(cell_name) for cell in all_rows]
87
- return all_values
87
+ return all_values
88
+
89
+ def vacuum(self):
90
+ return self.execute("VACUUM")
@@ -130,8 +130,11 @@ class Sqlite__Database(Kwargs_To_Self):
130
130
  table_names.append('sqlite_master')
131
131
  return table_names
132
132
 
133
+ def purge_database(self): # this fells like a better name than vacuum :)
134
+ return self.vacuum()
133
135
 
134
-
136
+ def vacuum(self):
137
+ return self.cursor().vacuum()
135
138
 
136
139
 
137
140
 
@@ -130,6 +130,7 @@ class Sqlite__Table(Kwargs_To_Self):
130
130
  rows = table_sqlite_master.cursor().execute__fetch_all(sql_query, params)
131
131
  return table_sqlite_master.list_of_field_name_from_rows(rows, field_name)
132
132
 
133
+
133
134
  def new_row_obj(self, row_data=None):
134
135
  if self.row_schema:
135
136
  new_obj = self.row_schema()
@@ -154,6 +155,7 @@ class Sqlite__Table(Kwargs_To_Self):
154
155
  picked_row_data[field_name] = field_value
155
156
  return picked_row_data
156
157
  return row_data
158
+
157
159
  def parse_row(self, row):
158
160
  if row and self.auto_pickle_blob:
159
161
  fields = self.fields__cached()
@@ -169,6 +171,14 @@ class Sqlite__Table(Kwargs_To_Self):
169
171
  def print(self, **kwargs):
170
172
  return Print_Table(**kwargs).print(self.rows())
171
173
 
174
+ def row(self, where, fields=None):
175
+ if fields is None:
176
+ return self.select_row_where(**where)
177
+
178
+ sql_query, params = self.sql_builder(limit=1).query_select_fields_with_conditions(fields, where)
179
+ row = self.cursor().execute__fetch_one(sql_query, params)
180
+ return self.parse_row(row)
181
+
172
182
  def row_add(self, row_obj=None):
173
183
  invalid_reason = self.sql_builder().validate_row_obj(row_obj)
174
184
  if invalid_reason:
@@ -1,4 +1,6 @@
1
1
  import inspect
2
+ from typing import List
3
+
2
4
  from osbot_utils.base_classes.Kwargs_To_Self import Kwargs_To_Self
3
5
  from osbot_utils.decorators.lists.filter_list import filter_list
4
6
  from osbot_utils.helpers.sqlite.Sqlite__Field import Sqlite__Field
@@ -6,7 +8,7 @@ from osbot_utils.helpers.sqlite.Sqlite__Table import Sqlite__Table
6
8
  from osbot_utils.helpers.sqlite.models.Sqlite__Field__Type import Sqlite__Field__Type
7
9
 
8
10
  class Sqlite__Table__Create(Kwargs_To_Self):
9
- fields : list[Sqlite__Field]
11
+ fields : List[Sqlite__Field]
10
12
  table : Sqlite__Table
11
13
 
12
14
  def __init__(self, table_name):
@@ -21,7 +23,7 @@ class Sqlite__Table__Create(Kwargs_To_Self):
21
23
  return True
22
24
  return False
23
25
 
24
- def add_fields(self, fields_data:list[dict]):
26
+ def add_fields(self, fields_data:List[dict]):
25
27
  results = []
26
28
  if fields_data:
27
29
  for field_data in fields_data:
@@ -0,0 +1,45 @@
1
+ from osbot_utils.decorators.lists.index_by import index_by
2
+ from osbot_utils.decorators.methods.cache_on_self import cache_on_self
3
+ from osbot_utils.helpers.sqlite.domains.Sqlite__DB__Local import Sqlite__DB__Local
4
+ from osbot_utils.helpers.sqlite.tables.Sqlite__Table__Files import Sqlite__Table__Files
5
+
6
+
7
+ class Sqlite__DB__Files(Sqlite__DB__Local):
8
+
9
+ def __init__(self, db_path=None, db_name=None):
10
+ super().__init__(db_path=db_path, db_name=db_name)
11
+
12
+ def add_file(self, path, contents=None, metadata=None):
13
+ return self.table_files().add_file(path, contents, metadata)
14
+
15
+ def clear_table(self):
16
+ self.table_files().clear()
17
+
18
+ def delete_file(self, path):
19
+ return self.table_files().delete_file(path)
20
+
21
+ def file(self, path, include_contents=False):
22
+ return self.table_files().file(path, include_contents=include_contents)
23
+
24
+ def file_exists(self, path):
25
+ return self.table_files().file_exists(path)
26
+
27
+ def file_names(self):
28
+ return self.table_files().select_field_values('path')
29
+ @cache_on_self
30
+ def table_files(self):
31
+ return Sqlite__Table__Files(database=self).setup()
32
+
33
+ @index_by
34
+ def files(self,include_contents=False):
35
+ return self.table_files().files(include_contents=include_contents)
36
+
37
+ def files__with_content(self):
38
+ return self.files(include_contents=True)
39
+
40
+ def files__by_path(self):
41
+ return self.files(index_by='path')
42
+
43
+ def setup(self):
44
+ self.table_files()
45
+ return self
@@ -10,7 +10,8 @@ class Sqlite__DB__Local(Sqlite__Database):
10
10
  db_name: str
11
11
 
12
12
  def __init__(self, db_path=None, db_name=None):
13
- self.db_name = db_name or random_text('db_local') + '.sqlite'
13
+ if hasattr(self, 'db_name') is False:
14
+ self.db_name = db_name or random_text('db_local') + '.sqlite'
14
15
  super().__init__(db_path=db_path or self.path_local_db())
15
16
 
16
17
  def path_db_folder(self):
@@ -1,9 +1,14 @@
1
+ import sys
2
+ import types
1
3
  from decimal import Decimal
2
4
  from enum import Enum, auto
3
- from types import NoneType
4
-
5
5
  from osbot_utils.decorators.methods.cache import cache
6
6
 
7
+ if sys.version_info >= (3, 10):
8
+ NoneType = types.NoneType
9
+ else:
10
+ NoneType = type(None)
11
+
7
12
 
8
13
  class Sqlite__Field__Type(Enum):
9
14
  BOOLEAN = bool