osbot-utils 1.13.0__tar.gz → 1.16.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.
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/PKG-INFO +7 -3
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/README.md +1 -1
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/base_classes/Kwargs_To_Self.py +92 -45
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/graphs/mermaid/Mermaid__Graph.py +5 -3
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/graphs/mermaid/Mermaid__Renderer.py +3 -1
- osbot_utils-1.16.0/osbot_utils/graphs/mermaid/models/Mermaid__Diagram__Type.py +16 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/graphs/mgraph/MGraph.py +4 -2
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/Ast.py +6 -3
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/html/Tag__Head.py +4 -2
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/pubsub/PubSub__Client.py +2 -1
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/pubsub/PubSub__Room.py +3 -1
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/pubsub/PubSub__Server.py +4 -3
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/sqlite/Sqlite__Table__Create.py +4 -2
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/sqlite/models/Sqlite__Field__Type.py +7 -2
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/testing/Profiler.py +2 -2
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/utils/Env.py +13 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/utils/Int.py +0 -1
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/utils/Misc.py +8 -1
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/utils/Objects.py +22 -1
- osbot_utils-1.16.0/osbot_utils/version +1 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/pyproject.toml +2 -2
- osbot_utils-1.13.0/osbot_utils/graphs/mermaid/models/Mermaid__Diagram__Type.py +0 -17
- osbot_utils-1.13.0/osbot_utils/version +0 -1
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/LICENSE +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/__init__.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/base_classes/Cache_Pickle.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/base_classes/Kwargs_To_Disk.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/base_classes/Type_Safe__List.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/base_classes/__init__.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/context_managers/__init__.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/context_managers/capture_duration.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/decorators/__init__.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/decorators/classes/__init__.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/decorators/classes/singleton.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/decorators/lists/__init__.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/decorators/lists/filter_list.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/decorators/lists/group_by.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/decorators/lists/index_by.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/decorators/methods/__init__.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/decorators/methods/cache.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/decorators/methods/cache_on_function.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/decorators/methods/cache_on_self.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/decorators/methods/cache_on_tmp.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/decorators/methods/capture_exception.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/decorators/methods/capture_status.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/decorators/methods/catch.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/decorators/methods/context.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/decorators/methods/depreciated.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/decorators/methods/function_type_check.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/decorators/methods/obj_as_context.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/decorators/methods/remove_return_value.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/decorators/methods/required_fields.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/fluent/Fluent_Dict.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/fluent/Fluent_List.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/fluent/__init__.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/graphs/__init__.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/graphs/mermaid/Mermaid.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/graphs/mermaid/Mermaid__Edge.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/graphs/mermaid/Mermaid__Node.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/graphs/mermaid/configs/Mermaid__Edge__Config.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/graphs/mermaid/configs/Mermaid__Node__Config.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/graphs/mermaid/configs/Mermaid__Render__Config.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/graphs/mermaid/examples/Mermaid_Examples__FlowChart.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/graphs/mermaid/models/Mermaid__Diagram_Direction.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/graphs/mermaid/models/Mermaid__Node__Shape.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/graphs/mgraph/MGraph__Config.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/graphs/mgraph/MGraph__Data.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/graphs/mgraph/MGraph__Edge.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/graphs/mgraph/MGraph__Node.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/graphs/mgraph/MGraph__Random_Graphs.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/graphs/mgraph/MGraph__Serializer.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/graphs/mgraph/MGraphs.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/graphs/mgraph/__init__.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/CPrint.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/Dict_To_Attr.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/Local_Cache.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/Local_Caches.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/Print_Table.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/Python_Audit.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/Random_Seed.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/SCP.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/SSH.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/Type_Registry.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/__init__.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/Ast_Base.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/Ast_Data.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/Ast_Load.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/Ast_Merge.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/Ast_Node.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/Ast_Visit.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/Call_Tree.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/__init__.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Add.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Alias.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_And.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Argument.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Arguments.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Assert.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Assign.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Attribute.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Aug_Assign.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Bin_Op.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Bool_Op.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Break.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Call.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Class_Def.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Compare.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Comprehension.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Constant.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Continue.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Dict.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Eq.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Except_Handler.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Expr.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_For.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Function_Def.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Generator_Exp.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Gt.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_GtE.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_If.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_If_Exp.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Import.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Import_From.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_In.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Is.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Is_Not.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Keyword.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Lambda.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_List.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_List_Comp.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Load.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Lt.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_LtE.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Mod.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Module.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Mult.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Name.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Not.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Not_Eq.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Not_In.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Or.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Pass.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Pow.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Raise.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Return.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Set.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Slice.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Starred.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Store.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Sub.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Subscript.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Try.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Tuple.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Unary_Op.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_While.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_With.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_With_Item.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/Ast_Yield.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/ast/nodes/__init__.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/html/Dict_To_Css.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/html/Dict_To_Html.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/html/Dict_To_Tags.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/html/Html_To_Dict.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/html/Html_To_Tag.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/html/Tag__Base.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/html/Tag__Body.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/html/Tag__Div.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/html/Tag__H.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/html/Tag__HR.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/html/Tag__Html.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/html/Tag__Link.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/html/Tag__Style.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/html/__init__.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/pubsub/Event__Queue.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/pubsub/PubSub__Sqlite.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/pubsub/__init__.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/pubsub/schemas/Schema__Event.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/pubsub/schemas/Schema__Event__Connect.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/pubsub/schemas/Schema__Event__Disconnect.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/pubsub/schemas/Schema__Event__Join_Room.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/pubsub/schemas/Schema__Event__Leave_Room.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/pubsub/schemas/Schema__Event__Message.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/pubsub/schemas/Schema__PubSub__Client.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/pubsub/schemas/__init__.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/sqlite/Capture_Sqlite_Error.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/sqlite/Sqlite__Cursor.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/sqlite/Sqlite__Database.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/sqlite/Sqlite__Field.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/sqlite/Sqlite__Globals.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/sqlite/Sqlite__Table.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/sqlite/Temp_Sqlite__Database__Disk.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/sqlite/Temp_Sqlite__Table.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/sqlite/__init__.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/sqlite/domains/Sqlite__Cache__Requests.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/sqlite/domains/Sqlite__Cache__Requests__Patch.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/sqlite/domains/Sqlite__DB__Files.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/sqlite/domains/Sqlite__DB__Graph.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/sqlite/domains/Sqlite__DB__Json.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/sqlite/domains/Sqlite__DB__Local.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/sqlite/domains/Sqlite__DB__Requests.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/sqlite/domains/__init__.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/sqlite/domains/schemas/Schema__Table__Requests.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/sqlite/domains/schemas/__init__.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/sqlite/models/__init__.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/sqlite/sample_data/Sqlite__Sample_Data__Chinook.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/sqlite/sample_data/__init__.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/sqlite/sql_builder/SQL_Builder.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/sqlite/sql_builder/SQL_Builder__Select.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/sqlite/sql_builder/__init__.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/sqlite/tables/Sqlite__Table__Config.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/sqlite/tables/Sqlite__Table__Edges.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/sqlite/tables/Sqlite__Table__Files.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/sqlite/tables/Sqlite__Table__Nodes.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/sqlite/tables/__init__.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/trace/Trace_Call.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/trace/Trace_Call__Config.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/trace/Trace_Call__Graph.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/trace/Trace_Call__Handler.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/trace/Trace_Call__Print_Lines.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/trace/Trace_Call__Print_Traces.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/trace/Trace_Call__Stack.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/trace/Trace_Call__Stack_Node.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/trace/Trace_Call__Stats.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/trace/Trace_Call__View_Model.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/trace/Trace_Files.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/trace/__init__.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/testing/Catch.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/testing/Duration.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/testing/Hook_Method.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/testing/Log_To_Queue.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/testing/Log_To_String.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/testing/Logging.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/testing/Patch_Print.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/testing/Stderr.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/testing/Stdout.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/testing/Temp_File.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/testing/Temp_Folder.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/testing/Temp_Sys_Path.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/testing/Temp_Web_Server.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/testing/Temp_Zip.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/testing/Temp_Zip_In_Memory.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/testing/Unit_Test.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/testing/Unzip_File.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/testing/__init__.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/utils/Assert.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/utils/Call_Stack.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/utils/Csv.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/utils/Dev.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/utils/Exceptions.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/utils/Files.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/utils/Functions.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/utils/Http.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/utils/Json.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/utils/Json_Cache.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/utils/Lists.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/utils/Png.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/utils/Process.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/utils/Python_Logger.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/utils/Status.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/utils/Str.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/utils/Version.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/utils/Zip.py +0 -0
- {osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/utils/__init__.py +0 -0
@@ -1,14 +1,18 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: osbot_utils
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.16.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.
|
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
18
|
Project-URL: Repository, https://github.com/owasp-sbot/OSBot-Utils
|
@@ -18,7 +22,7 @@ Description-Content-Type: text/markdown
|
|
18
22
|
|
19
23
|
Powerful Python util methods and classes that simplify common apis and tasks.
|
20
24
|
|
21
|
-

|
22
26
|
[](https://codecov.io/gh/owasp-sbot/OSBot-Utils)
|
23
27
|
|
24
28
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Powerful Python util methods and classes that simplify common apis and tasks.
|
4
4
|
|
5
|
-

|
6
6
|
[](https://codecov.io/gh/owasp-sbot/OSBot-Utils)
|
7
7
|
|
8
8
|
|
@@ -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
|
9
|
-
from typing import
|
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
|
-
|
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
|
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
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
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
|
-
|
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
|
-
|
160
|
-
|
161
|
-
if var_name
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
if
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
#
|
173
|
-
|
174
|
-
if
|
175
|
-
|
176
|
-
|
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
|
-
|
202
|
-
|
203
|
-
|
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
|
-
|
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
|
260
|
-
|
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
|
271
|
-
|
272
|
-
|
273
|
-
|
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 :
|
10
|
-
mermaid_code :
|
11
|
-
nodes :
|
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 :
|
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 :
|
13
|
+
edges : List[MGraph__Edge]
|
12
14
|
key : str
|
13
|
-
nodes :
|
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
|
-
|
15
|
-
|
16
|
-
|
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 :
|
10
|
-
meta :
|
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 :
|
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 :
|
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 :
|
21
|
-
clients_connected:
|
22
|
-
rooms :
|
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):
|
{osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/sqlite/Sqlite__Table__Create.py
RENAMED
@@ -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 :
|
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:
|
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:
|
{osbot_utils-1.13.0 → osbot_utils-1.16.0}/osbot_utils/helpers/sqlite/models/Sqlite__Field__Type.py
RENAMED
@@ -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
|
@@ -26,8 +26,8 @@ class Profiler:
|
|
26
26
|
item[arg_name] = self.add_values(option, value)
|
27
27
|
else:
|
28
28
|
if profile_options.get(arg_name):
|
29
|
-
if arg_name == 'f_locals':
|
30
|
-
item[arg_name] = value.copy()
|
29
|
+
if arg_name == 'f_locals' and sys.version_info < (3, 13): # todo: figure out why in 3.13 the value.copy doesn't work
|
30
|
+
item[arg_name] = value.copy() # create a copy of the var
|
31
31
|
else:
|
32
32
|
item[arg_name] = value
|
33
33
|
return item
|
@@ -1,10 +1,23 @@
|
|
1
1
|
# In Misc.py
|
2
2
|
import os
|
3
|
+
from sys import platform
|
3
4
|
|
5
|
+
from osbot_utils.utils.Dev import pprint
|
4
6
|
from osbot_utils.utils.Files import all_parent_folders
|
5
7
|
from osbot_utils.utils.Misc import list_set
|
6
8
|
from osbot_utils.utils.Str import strip_quotes
|
7
9
|
|
10
|
+
def env__home_root():
|
11
|
+
return os.getenv('HOME') == '/root'
|
12
|
+
|
13
|
+
def env__terminal_xterm():
|
14
|
+
return os.getenv('TERM') == 'xterm'
|
15
|
+
|
16
|
+
def env__not_terminal_xterm():
|
17
|
+
return not env__terminal_xterm()
|
18
|
+
|
19
|
+
def platform_darwin():
|
20
|
+
return platform == 'darwin'
|
8
21
|
|
9
22
|
def env_value(var_name):
|
10
23
|
return env_vars().get(var_name, None)
|
@@ -10,12 +10,19 @@ import textwrap
|
|
10
10
|
import re
|
11
11
|
import uuid
|
12
12
|
import warnings
|
13
|
-
from datetime import datetime, timedelta
|
13
|
+
from datetime import datetime, timedelta
|
14
14
|
from secrets import token_bytes
|
15
15
|
from time import sleep
|
16
16
|
from typing import Iterable
|
17
17
|
from urllib.parse import quote_plus, unquote_plus
|
18
18
|
|
19
|
+
|
20
|
+
if sys.version_info >= (3, 11):
|
21
|
+
from datetime import UTC
|
22
|
+
else:
|
23
|
+
from datetime import timezone # For versions before 3.11, we need to use a different method or library to handle UTC
|
24
|
+
UTC = timezone.utc
|
25
|
+
|
19
26
|
def ansi_text_visible_length(text):
|
20
27
|
ansi_escape = re.compile(r'\x1b\[[0-9;]*m') # This regex matches the escape sequences used for text formatting
|
21
28
|
visible_text = ansi_escape.sub('', text) # Remove the escape sequences
|
@@ -4,12 +4,33 @@ import io
|
|
4
4
|
import json
|
5
5
|
import os
|
6
6
|
import pickle
|
7
|
+
import sys
|
7
8
|
import types
|
8
|
-
|
9
|
+
import typing
|
10
|
+
from typing import Union
|
9
11
|
|
10
12
|
from osbot_utils.utils.Misc import list_set
|
11
13
|
from osbot_utils.utils.Str import str_unicode_escape, str_max_width
|
12
14
|
|
15
|
+
# Backport implementations of get_origin and get_args for Python 3.7
|
16
|
+
if sys.version_info < (3, 8):
|
17
|
+
def get_origin(tp):
|
18
|
+
if isinstance(tp, typing._GenericAlias):
|
19
|
+
return tp.__origin__
|
20
|
+
elif tp is typing.Generic:
|
21
|
+
return typing.Generic
|
22
|
+
else:
|
23
|
+
return None
|
24
|
+
|
25
|
+
def get_args(tp):
|
26
|
+
if isinstance(tp, typing._GenericAlias):
|
27
|
+
return tp.__args__
|
28
|
+
else:
|
29
|
+
return ()
|
30
|
+
else:
|
31
|
+
from typing import get_origin, get_args
|
32
|
+
|
33
|
+
|
13
34
|
def are_types_compatible_for_assigment(source_type, target_type):
|
14
35
|
if source_type is target_type:
|
15
36
|
return True
|
@@ -0,0 +1 @@
|
|
1
|
+
v1.16.0
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "osbot_utils"
|
3
|
-
version = "v1.
|
3
|
+
version = "v1.16.0"
|
4
4
|
description = "OWASP Security Bot - Utils"
|
5
5
|
authors = ["Dinis Cruz <dinis.cruz@owasp.org>"]
|
6
6
|
license = "MIT"
|
@@ -9,7 +9,7 @@ homepage = "https://github.com/owasp-sbot/OSBot-Utils"
|
|
9
9
|
repository = "https://github.com/owasp-sbot/OSBot-Utils"
|
10
10
|
|
11
11
|
[tool.poetry.dependencies]
|
12
|
-
python = "^3.
|
12
|
+
python = "^3.7"
|
13
13
|
|
14
14
|
|
15
15
|
[build-system]
|
@@ -1,17 +0,0 @@
|
|
1
|
-
from enum import auto, Enum
|
2
|
-
|
3
|
-
|
4
|
-
class Diagram__Type(Enum):
|
5
|
-
class_diagram = auto()
|
6
|
-
entity_relationship_diagram = auto()
|
7
|
-
flowchart = auto()
|
8
|
-
gantt = auto()
|
9
|
-
git_graph = auto()
|
10
|
-
graph = auto()
|
11
|
-
mermaid_map = auto()
|
12
|
-
mindmap = auto()
|
13
|
-
pie_chart = auto()
|
14
|
-
requirement_diagram = auto()
|
15
|
-
sequence_diagram = "sequenceDiagram"
|
16
|
-
state_diagram = 'stateDiagram-v2'
|
17
|
-
user_journey = auto()
|
@@ -1 +0,0 @@
|
|
1
|
-
v1.13.0
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|