pycraftcore 5.2.0__tar.gz → 6.0.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 (247) hide show
  1. {pycraftcore-5.2.0/src/pycraftcore.egg-info → pycraftcore-6.0.0}/PKG-INFO +133 -14
  2. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/Readme.md +132 -13
  3. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/pyproject.toml +1 -1
  4. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/application_configuration/adapter/__init__.py +2 -0
  5. pycraftcore-6.0.0/src/pycraftcore/application_configuration/adapter/omega_configuration_reader.py +35 -0
  6. pycraftcore-6.0.0/src/pycraftcore/application_configuration/adapter/omega_tree_reader.py +38 -0
  7. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/application_configuration/adapter/schema.py +8 -2
  8. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/application_configuration/enum/connector_type.py +1 -0
  9. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/application_configuration/enum/operation_type.py +2 -0
  10. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/application_configuration/model/connector.py +47 -4
  11. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/application_configuration/model/operation.py +43 -2
  12. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/repository/adapter/__init__.py +3 -0
  13. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/repository/adapter/no_sql/mongodb/factory.py +1 -1
  14. pycraftcore-6.0.0/src/pycraftcore/repository/adapter/no_sql/mongodb/mapper.py +22 -0
  15. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/repository/adapter/no_sql/mongodb/schema.py +1 -1
  16. pycraftcore-6.0.0/src/pycraftcore/repository/adapter/no_sql/mongodb/ttl_index.py +57 -0
  17. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/repository/adapter/sql/postgresql/factory.py +2 -1
  18. pycraftcore-6.0.0/src/pycraftcore/repository/adapter/sql/postgresql/mapper.py +20 -0
  19. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/repository/adapter/sql/postgresql/schema.py +4 -3
  20. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/repository/adapter/sql/sqlalchemy/postgresql_engine_builder.py +2 -1
  21. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/repository/adapter/sql/sqlalchemy/sqlite_engine_builder.py +1 -1
  22. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/repository/adapter/sql/sqlite/factory.py +1 -1
  23. pycraftcore-6.0.0/src/pycraftcore/repository/adapter/sql/sqlite/mapper.py +15 -0
  24. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/repository/adapter/sql/sqlite/schema.py +1 -1
  25. {pycraftcore-5.2.0 → pycraftcore-6.0.0/src/pycraftcore.egg-info}/PKG-INFO +133 -14
  26. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore.egg-info/SOURCES.txt +2 -0
  27. pycraftcore-5.2.0/src/pycraftcore/application_configuration/adapter/omega_configuration_reader.py +0 -54
  28. pycraftcore-5.2.0/src/pycraftcore/repository/adapter/no_sql/mongodb/mapper.py +0 -19
  29. pycraftcore-5.2.0/src/pycraftcore/repository/adapter/sql/postgresql/mapper.py +0 -19
  30. pycraftcore-5.2.0/src/pycraftcore/repository/adapter/sql/sqlite/mapper.py +0 -14
  31. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/LICENSE +0 -0
  32. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/setup.cfg +0 -0
  33. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/__init__.py +0 -0
  34. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/application_configuration/__init__.py +0 -0
  35. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/application_configuration/adapter/load_application_configuration.py +0 -0
  36. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/application_configuration/enum/__init__.py +0 -0
  37. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/application_configuration/enum/file_operation_action.py +0 -0
  38. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/application_configuration/enum/run_type_application.py +0 -0
  39. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/application_configuration/enum/run_type_environment.py +0 -0
  40. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/application_configuration/enum/server_type.py +0 -0
  41. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/application_configuration/model/__init__.py +0 -0
  42. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/application_configuration/model/configuration.py +0 -0
  43. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/application_configuration/model/server.py +0 -0
  44. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/application_configuration/port/__init__.py +0 -0
  45. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/application_configuration/port/configuration.py +0 -0
  46. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/application_configuration/port/configuration_reader.py +0 -0
  47. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/authentication/__init__.py +0 -0
  48. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/authentication/model/__init__.py +0 -0
  49. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/authentication/model/auth_type.py +0 -0
  50. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/authentication/model/basic_auth.py +0 -0
  51. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/authentication/model/no_auth.py +0 -0
  52. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/authentication/model/token_auth.py +0 -0
  53. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/circuit_breaker/__init__.py +0 -0
  54. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/circuit_breaker/adapter/__init__.py +0 -0
  55. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/circuit_breaker/adapter/aiobreaker_circuit_breaker_policy.py +0 -0
  56. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/circuit_breaker/configuration/__init__.py +0 -0
  57. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/circuit_breaker/configuration/circuit_breaker_configuration.py +0 -0
  58. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/circuit_breaker/enum/__init__.py +0 -0
  59. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/circuit_breaker/enum/circuit_breaker_status.py +0 -0
  60. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/circuit_breaker/exception/__init__.py +0 -0
  61. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/circuit_breaker/exception/circuit_breaker_open_exception.py +0 -0
  62. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/circuit_breaker/port/__init__.py +0 -0
  63. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/circuit_breaker/port/async_circuit_breaker.py +0 -0
  64. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/computation_engine/__init__.py +0 -0
  65. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/computation_engine/adapter/__init__.py +0 -0
  66. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/computation_engine/adapter/compute_engine.py +0 -0
  67. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/computation_engine/adapter/numpy_arithmetic_operation.py +0 -0
  68. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/computation_engine/adapter/scipy_calculus_operation.py +0 -0
  69. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/computation_engine/const_typing.py +0 -0
  70. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/computation_engine/port/__init__.py +0 -0
  71. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/computation_engine/port/arithmetic_operation.py +0 -0
  72. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/computation_engine/port/calculus_operation.py +0 -0
  73. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/computation_engine/port/engine.py +0 -0
  74. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/context/__init__.py +0 -0
  75. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/context/request_id_context.py +0 -0
  76. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/file_handler/__init__.py +0 -0
  77. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/file_handler/adapter/__init__.py +0 -0
  78. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/file_handler/adapter/extension/__init__.py +0 -0
  79. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/file_handler/adapter/extension/csv/__init__.py +0 -0
  80. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/file_handler/adapter/extension/csv/csv_reader.py +0 -0
  81. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/file_handler/adapter/extension/csv/csv_writer.py +0 -0
  82. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/file_handler/adapter/extension/json/__init__.py +0 -0
  83. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/file_handler/adapter/extension/json/json_reader.py +0 -0
  84. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/file_handler/adapter/extension/json/json_writer.py +0 -0
  85. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/file_handler/adapter/extension/markdown/__init__.py +0 -0
  86. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/file_handler/adapter/extension/markdown/markdown_reader.py +0 -0
  87. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/file_handler/adapter/extension/markdown/markdown_writer.py +0 -0
  88. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/file_handler/adapter/extension/svg/__init__.py +0 -0
  89. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/file_handler/adapter/extension/svg/svg_reader.py +0 -0
  90. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/file_handler/adapter/extension/svg/svg_writer.py +0 -0
  91. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/file_handler/adapter/extension/txt/__init__.py +0 -0
  92. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/file_handler/adapter/extension/txt/txt_reader.py +0 -0
  93. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/file_handler/adapter/extension/txt/txt_writer.py +0 -0
  94. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/file_handler/adapter/extension/yml/__init__.py +0 -0
  95. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/file_handler/adapter/extension/yml/yml_reader.py +0 -0
  96. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/file_handler/adapter/extension/yml/yml_writer.py +0 -0
  97. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/file_handler/adapter/factory.py +0 -0
  98. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/file_handler/adapter/handler.py +0 -0
  99. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/file_handler/adapter/provider.py +0 -0
  100. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/file_handler/adapter/strategy.py +0 -0
  101. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/file_handler/enum/__init__.py +0 -0
  102. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/file_handler/enum/read_chunk_mode.py +0 -0
  103. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/file_handler/port/__init__.py +0 -0
  104. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/file_handler/port/file_handler_factory.py +0 -0
  105. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/file_handler/port/file_handler_provider.py +0 -0
  106. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/file_handler/port/reader.py +0 -0
  107. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/file_handler/port/writer.py +0 -0
  108. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/file_handler/schema/__init__.py +0 -0
  109. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/file_handler/schema/file_manifest.py +0 -0
  110. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/http/__init__.py +0 -0
  111. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/http/adapter/__init__.py +0 -0
  112. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/http/adapter/aiohttp_client.py +0 -0
  113. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/http/adapter/httpx_client.py +0 -0
  114. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/http/configuration/__init__.py +0 -0
  115. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/http/configuration/client_configuration.py +0 -0
  116. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/http/configuration/http_client_configuration.py +0 -0
  117. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/http/configuration/limits_configuration.py +0 -0
  118. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/http/configuration/security_configuration.py +0 -0
  119. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/http/enum/__init__.py +0 -0
  120. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/http/enum/http_method.py +0 -0
  121. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/http/policy/__init__.py +0 -0
  122. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/http/policy/http_error_policy.py +0 -0
  123. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/http/port/__init__.py +0 -0
  124. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/http/port/async_http_client.py +0 -0
  125. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/logger/__init__.py +0 -0
  126. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/logger/adapter/__init__.py +0 -0
  127. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/logger/adapter/standard_logger.py +0 -0
  128. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/logger/configuration.py +0 -0
  129. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/logger/enum/__init__.py +0 -0
  130. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/logger/enum/log_level.py +0 -0
  131. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/logger/port/__init__.py +0 -0
  132. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/logger/port/logger.py +0 -0
  133. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/profiler/__init__.py +0 -0
  134. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/profiler/profiled.py +0 -0
  135. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/py.typed +0 -0
  136. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/query_language/__init__.py +0 -0
  137. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/query_language/adapter/__init__.py +0 -0
  138. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/query_language/adapter/sql/__init__.py +0 -0
  139. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/query_language/adapter/sql/adapter.py +0 -0
  140. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/query_language/adapter/sql/factory.py +0 -0
  141. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/query_language/constants/__init__.py +0 -0
  142. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/query_language/constants/sql/__init__.py +0 -0
  143. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/query_language/constants/sql/allowed_sql_root_statements.py +0 -0
  144. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/query_language/constants/sql/forbidden_sql_statements.py +0 -0
  145. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/query_language/port/__init__.py +0 -0
  146. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/query_language/port/query_handler.py +0 -0
  147. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/repository/__init__.py +0 -0
  148. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/repository/adapter/no_sql/__init__.py +0 -0
  149. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/repository/adapter/no_sql/mongodb/__init__.py +0 -0
  150. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/repository/adapter/no_sql/mongodb/adapter.py +0 -0
  151. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/repository/adapter/sql/__init__.py +0 -0
  152. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/repository/adapter/sql/postgresql/__init__.py +0 -0
  153. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/repository/adapter/sql/postgresql/adapter.py +0 -0
  154. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/repository/adapter/sql/sqlalchemy/__init__.py +0 -0
  155. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/repository/adapter/sql/sqlalchemy/adapter.py +0 -0
  156. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/repository/adapter/sql/sqlalchemy/engine_builder.py +0 -0
  157. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/repository/adapter/sql/sqlalchemy/factory.py +0 -0
  158. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/repository/adapter/sql/sqlite/__init__.py +0 -0
  159. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/repository/adapter/sql/sqlite/adapter.py +0 -0
  160. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/repository/adapter/sql/sqlite/database_file.py +0 -0
  161. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/repository/adapter/sql/sqlite/pragmas.py +0 -0
  162. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/repository/port/__init__.py +0 -0
  163. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/repository/port/repository.py +0 -0
  164. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/resilient_http/__init__.py +0 -0
  165. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/resilient_http/adapter/__init__.py +0 -0
  166. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/resilient_http/adapter/resilient_client.py +0 -0
  167. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/resilient_http/adapter/resilient_http_client_factory.py +0 -0
  168. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/resilient_http/adapter/resilient_transport.py +0 -0
  169. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/resilient_http/adapter/resilient_transport_factory.py +0 -0
  170. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/resilient_http/configuration/__init__.py +0 -0
  171. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/resilient_http/configuration/resilient_http_configuration.py +0 -0
  172. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/resilient_http/port/__init__.py +0 -0
  173. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/resilient_http/port/async_resilient_http_client.py +0 -0
  174. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/retry/__init__.py +0 -0
  175. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/retry/adapter/__init__.py +0 -0
  176. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/retry/adapter/tenacity_retry_policy.py +0 -0
  177. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/retry/configuration/__init__.py +0 -0
  178. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/retry/configuration/retry_configuration.py +0 -0
  179. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/retry/port/__init__.py +0 -0
  180. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/retry/port/retry.py +0 -0
  181. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/runtime/__init__.py +0 -0
  182. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/runtime/adapter/__init__.py +0 -0
  183. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/runtime/adapter/python/__init__.py +0 -0
  184. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/runtime/adapter/python/adapter.py +0 -0
  185. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/runtime/adapter/python/factory.py +0 -0
  186. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/runtime/adapter/python/host_bridge_server.py +0 -0
  187. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/runtime/adapter/python/python_runner_template.py +0 -0
  188. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/runtime/port/__init__.py +0 -0
  189. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/runtime/port/code.py +0 -0
  190. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/runtime/schema/__init__.py +0 -0
  191. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/runtime/schema/code_result.py +0 -0
  192. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/runtime/schema/code_stdout.py +0 -0
  193. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/runtime/schema/host_bridge.py +0 -0
  194. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/runtime/schema/safe_code_settings.py +0 -0
  195. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/serializer/__init__.py +0 -0
  196. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/serializer/adapter/__init__.py +0 -0
  197. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/serializer/adapter/binary_serializer.py +0 -0
  198. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/serializer/adapter/dictionary_serializer.py +0 -0
  199. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/serializer/adapter/json_serializer.py +0 -0
  200. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/serializer/port/__init__.py +0 -0
  201. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/serializer/port/serializer.py +0 -0
  202. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/telemetry/__init__.py +0 -0
  203. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/telemetry/adapter/__init__.py +0 -0
  204. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/telemetry/adapter/null_telemetry.py +0 -0
  205. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/telemetry/adapter/open_telemetry.py +0 -0
  206. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/telemetry/adapter/open_telemetry_logger_provider.py +0 -0
  207. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/telemetry/adapter/open_telemetry_meter_provider.py +0 -0
  208. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/telemetry/adapter/open_telemetry_provider.py +0 -0
  209. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/telemetry/adapter/open_telemetry_tracer.py +0 -0
  210. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/telemetry/port/__init__.py +0 -0
  211. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/telemetry/port/logger_provider.py +0 -0
  212. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/telemetry/port/meter_provider.py +0 -0
  213. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/telemetry/port/telemetry.py +0 -0
  214. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/telemetry/port/trace_provider.py +0 -0
  215. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/telemetry/port/tracer.py +0 -0
  216. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/web/__init__.py +0 -0
  217. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/web/actuator/__init__.py +0 -0
  218. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/web/actuator/actuator.py +0 -0
  219. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/web/actuator/enum/__init__.py +0 -0
  220. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/web/actuator/enum/health_status.py +0 -0
  221. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/web/actuator/schema/__init__.py +0 -0
  222. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/web/actuator/schema/actuator_response.py +0 -0
  223. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/web/asgi.py +0 -0
  224. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/web/middleware/__init__.py +0 -0
  225. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/web/middleware/request_id_middleware.py +0 -0
  226. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/web/schema/__init__.py +0 -0
  227. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/web/schema/api_settings.py +0 -0
  228. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/web/sse.py +0 -0
  229. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/web/streaming.py +0 -0
  230. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/web_blacksheep/__init__.py +0 -0
  231. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/web_blacksheep/actuator_router.py +0 -0
  232. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/web_blacksheep/app_factory.py +0 -0
  233. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/web_blacksheep/detail_handler.py +0 -0
  234. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/web_blacksheep/event_stream.py +0 -0
  235. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/web_fastapi/__init__.py +0 -0
  236. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/web_fastapi/actuator_router.py +0 -0
  237. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/web_fastapi/app_factory.py +0 -0
  238. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/web_fastapi/detail_handler.py +0 -0
  239. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/web_fastapi/event_stream.py +0 -0
  240. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/web_litestar/__init__.py +0 -0
  241. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/web_litestar/actuator_router.py +0 -0
  242. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/web_litestar/app_factory.py +0 -0
  243. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/web_litestar/detail_handler.py +0 -0
  244. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore/web_litestar/event_stream.py +0 -0
  245. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore.egg-info/dependency_links.txt +0 -0
  246. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore.egg-info/requires.txt +0 -0
  247. {pycraftcore-5.2.0 → pycraftcore-6.0.0}/src/pycraftcore.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pycraftcore
3
- Version: 5.2.0
3
+ Version: 6.0.0
4
4
  Summary: Provides reusable technical infrastructure and adapter implementations for Python applications
5
5
  Author-email: Toufik Saouchi <toufik.saouchi@gmail.com>
6
6
  License-Expression: MIT
@@ -199,7 +199,7 @@ Each module stands on its own: use the ones you need. The modules today (new one
199
199
  | `web_litestar`, `web_fastapi`, `web_blacksheep` | One toolkit per framework: build the app with pycraftcore's conventions and write your routes with the framework's own features |
200
200
  | `resilient_http` | An HTTP transport with retries and a circuit breaker built in |
201
201
  | `retry`, `circuit_breaker` | The two policies on their own, for any async call |
202
- | `repository` | Async repositories built from a database connector — today SQLite (pooled), PostgreSQL, MongoDB, and SQLAlchemy (PostgreSQL or SQLite, for libraries that need an engine) |
202
+ | `repository` | Async repositories built from a database connector — today SQLite (pooled), PostgreSQL, MongoDB (with TTL indexes kept to a set expiry), and SQLAlchemy (PostgreSQL or SQLite, for libraries that need an engine) |
203
203
  | `query_language` | Checks that a SQL statement is read-only, and translates between dialects, before it reaches a database |
204
204
  | `runtime` | Runs untrusted Python in a separate process with memory, time and module limits; optionally lets it call your functions |
205
205
  | `file_handler` | Read and write files by extension (today csv, json, yml, md, txt, svg); a new format is a new reader/writer pair |
@@ -214,8 +214,8 @@ A service's configuration is a folder of YAML files, with values taken from envi
214
214
  | Path | What it holds |
215
215
  |---|---|
216
216
  | `root.yml` | The environment, the log level and the list of connectors, operations and servers in use |
217
- | `<env>/connector/*.yml` | Where things are: APIs, databases, files, MCP servers, telemetry |
218
- | `<env>/operation/*.yml` | What you do with them; each operation points at a connector |
217
+ | `<env>/connector/*.yml` | Where things are and how to reach them: APIs, databases, files, MCP servers, A2A agents, telemetry |
218
+ | `<env>/operation/*.yml` | What you do with them: which database, tables and TTL, which endpoint, which parameters; each operation points at a connector |
219
219
  | `<env>/server/*.yml` | How the service itself is served: base path, API documentation, CORS origins, and your own `parameters` |
220
220
 
221
221
  ```yaml
@@ -246,6 +246,72 @@ operation:
246
246
  days: 3
247
247
  ```
248
248
 
249
+ A connector holds only what every operation needs to reach the system; an operation holds what one use does there. Databases follow the same split:
250
+
251
+ ```yaml
252
+ # <env>/connector/database.yml
253
+ connector:
254
+ postgresql:
255
+ name: postgresql
256
+ type: database
257
+ engine: postgresql
258
+ host: ${oc.env:DB_HOST}
259
+ port: 5432
260
+ timeout: 5 # seconds to reach the server
261
+ pool:
262
+ min: 1
263
+ max: 10
264
+ auth:
265
+ type: basic
266
+ username: ${oc.env:DB_USER}
267
+ password: ${oc.env:DB_PASSWORD}
268
+ ```
269
+
270
+ ```yaml
271
+ # <env>/operation/database.yml
272
+ operation:
273
+ orders:
274
+ name: orders
275
+ type: database
276
+ connector: ${connector.postgresql}
277
+ database: shop
278
+ collections: # role → name: tables in SQL, collections in MongoDB
279
+ orders: orders
280
+ events: order_events
281
+ ttl: 604800 # seconds the data is kept, for the code that enforces it
282
+ ```
283
+
284
+ | Goes in the connector | Goes in the operation |
285
+ |---|---|
286
+ | `engine`, `host`, `port`, `auth` | `database`: the database, the SQLite file name or the MongoDB database |
287
+ | `timeout`: how long to wait to reach the server (default 5 s) | `collections`: the tables or collections it uses, by role (`operation.collection("events")`) |
288
+ | `pool`: `min` and `max` connections only (default 1 and 1) | `ttl`: how long its data is kept (seconds, optional) |
289
+ | | `parameters`: anything else, passed through |
290
+
291
+ A database connector, its pool and a database operation refuse keys they don't know, so a misplaced setting fails at load with its path (`connector.database.postgresql.database.pool.ttl`) instead of being ignored.
292
+
293
+ An A2A connector describes an A2A agent's endpoint, whether the service calls it or serves it; an A2A operation holds what one use of it needs:
294
+
295
+ ```yaml
296
+ connector:
297
+ agent:
298
+ name: agent
299
+ type: a2a
300
+ base_url: http://<agent-host>:8000/a2a
301
+ timeout: 60
302
+ binding: JSONRPC # or HTTP+JSON, GRPC
303
+ auth:
304
+ type: none
305
+
306
+ operation:
307
+ ask_agent:
308
+ name: ask_agent
309
+ type: a2a
310
+ connector: ${connector.agent}
311
+ parameters:
312
+ skill: homelab-assistant
313
+ ```
314
+
249
315
  ```yaml
250
316
  # <env>/server/asgi.yml
251
317
  server:
@@ -293,7 +359,7 @@ operation = config.operation.api("forecast") # ApiOperation
293
359
  server = config.server.asgi("weather-api") # AsgiServer
294
360
  ```
295
361
 
296
- `config.connector` returns typed connectors per kind (`.api()`, `.database()`, `.file()`, `.mcp()`, `.telemetry()`), `config.operation` typed operations (`.api()`, `.file()`) and `config.server` typed servers (`.asgi()`); the `type` field of each entry decides which fields it takes.
362
+ `config.connector` returns typed connectors per kind (`.api()`, `.database()`, `.file()`, `.mcp()`, `.a2a()`, `.telemetry()`), `config.operation` typed operations (`.api()`, `.file()`, `.mcp()`, `.a2a()`, `.database()`) and `config.server` typed servers (`.asgi()`); the `type` field of each entry decides which fields it takes.
297
363
 
298
364
  - `log` is a `LogLevel` (`DEBUG`, `INFO`, `WARNING`, `ERROR`, `CRITICAL`, upper case): pass it to `configure_logging(config.log)`.
299
365
  - A server holds `base_path`, `docs` and `cors_origins`: turn them into the web toolkit's `ApiSettings` (see [Serving an HTTP API](#serving-an-http-api)). Which framework serves the API is a choice made in code, not in the configuration.
@@ -301,6 +367,35 @@ server = config.server.asgi("weather-api") # AsgiServer
301
367
  - `parameters` is yours: pycraftcore passes it through untouched. `oc.env` always gives strings, so convert the values where you read them.
302
368
  - `log` and `server` are required, like `connector` and `operation`. A service that serves no HTTP API writes `server: {}`.
303
369
 
370
+ #### Reading another YAML tree
371
+
372
+ `OmegaTreeReader` is the loading the configuration uses, for any other tree of YAML files: a root file, folders whose `*.yml` files are merged under it (in name order, the root file last so it wins), and `${oc.env:…}` and `${…}` references resolved.
373
+
374
+ ```python
375
+ from pathlib import Path
376
+
377
+ from pycraftcore.application_configuration.adapter import OmegaTreeReader
378
+
379
+ agent = Path("agents/chat")
380
+ tree = OmegaTreeReader(agent / "agent.yml", [agent / "skills"]).read("agent") # a dict
381
+ ```
382
+
383
+ - `read(key)` returns the section under `key` as plain data, to validate with your own pydantic model.
384
+ - A missing root file, a missing key, a key that isn't a mapping or an environment variable that isn't set raises at once, with the file or the key in the message.
385
+ - A folder that doesn't exist counts as no files.
386
+
387
+ #### Upgrading from 5.x
388
+
389
+ 6.0.0 moves what a database connector held for one use into a database operation:
390
+
391
+ 1. Move `default_name` from each database connector to a new `type: database` operation, as `database`.
392
+ 2. Move `pool.timeout_ms` to the connector's `timeout`, in seconds (`3000` → `3`).
393
+ 3. Move `pool.ttl` to the operation's `ttl`, and collection or table names to its `collections`.
394
+ 4. List the operations in `root.yml`, and build settings mappers from `config.operation.database(name)` instead of `config.connector.database(name)`.
395
+ 5. The settings models' `default_name` is now `database`; `PostgresConnector` also takes `connect_timeout`.
396
+
397
+ A 5.x connector fails to load and names the key to move.
398
+
304
399
  ### Logging and the request id
305
400
 
306
401
  ```python
@@ -440,7 +535,7 @@ Repositories are built from a database connector and share one interface, `Async
440
535
  ```python
441
536
  from pycraftcore.repository.adapter import SqliteRepositoryFactory, SqliteSettingsMapper
442
537
 
443
- factory = SqliteRepositoryFactory(SqliteSettingsMapper(config.connector.database("users"))())
538
+ factory = SqliteRepositoryFactory(SqliteSettingsMapper(config.operation.database("users"))())
444
539
  repository = await factory.connect()
445
540
  rows = await repository.execute("SELECT id, email FROM users LIMIT 10")
446
541
  await factory.disconnect()
@@ -448,8 +543,32 @@ await factory.disconnect()
448
543
 
449
544
  `PostgresRepositoryFactory` / `PostgresSettingsMapper` and `MongoRepositoryFactory` / `MongoSettingsMapper` work the same way, and so will any database added later: a factory, a settings mapper and a repository behind the same `AsyncRepository` port.
450
545
 
546
+ A settings mapper takes a database operation: the connection comes from its connector (host, port, credentials, `timeout`, `pool`), the database from the operation. PostgreSQL gives up connecting after `timeout` seconds; MongoDB waits that long to find the server. MongoDB's client keeps its own pool, so `pool` doesn't apply to it.
547
+
451
548
  Every factory has three methods: `connect()` gives the `AsyncRepository`, `connection()` gives the driver's own client, and `disconnect()` closes both. Use `connection()` to hand the database to a library that brings its own code, such as LangGraph's checkpointers (`MongoClient`, an aiosqlite connection).
452
549
 
550
+ #### MongoDB TTL indexes
551
+
552
+ A TTL index makes MongoDB delete each document a set time after the date in one of its fields. MongoDB refuses to create the same index again with another expiry, so a changed retention would otherwise mean dropping the index by hand. `MongoTtlIndex` takes the field and the expiry, and `ensure(collection)` makes the collection match:
553
+
554
+ ```python
555
+ from pycraftcore.repository.adapter import MongoTtlIndex, TtlIndexChange
556
+
557
+ client = await factory.connection() # a MongoRepositoryFactory
558
+ change = await MongoTtlIndex("created_at", 604800).ensure(client["app"]["events"])
559
+ ```
560
+
561
+ | The collection has | `ensure` | Returns |
562
+ |---|---|---|
563
+ | no single-field index on the field | creates it, with the expiry | `TtlIndexChange.CREATED` |
564
+ | one with the same expiry | does nothing | `TtlIndexChange.UNCHANGED` |
565
+ | one with another expiry, or none (a plain index) | changes it in place with `collMod`: no rebuild, the documents stay | `TtlIndexChange.UPDATED` |
566
+
567
+ - Run it before a library that creates its own TTL index (LangGraph's `MongoDBSaver` with `ttl`): the library then finds the index as it wants it and leaves it alone.
568
+ - Changing an index needs the `collMod` action (the `dbAdmin` role, or root); creating one needs `createIndex` (`readWrite`).
569
+ - The expiry is checked when the object is built: 0 to 2147483647 seconds, as MongoDB accepts.
570
+ - A compound index that starts with the field isn't a TTL index, so it's not taken for one.
571
+
453
572
  #### SQLAlchemy
454
573
 
455
574
  For a library that asks for a SQLAlchemy engine, `SqlAlchemyRepositoryFactory` manages one: it builds it once, checks it answers, and disposes of it. How the engine is built is injected, as an engine builder made from the existing PostgreSQL or SQLite settings, so the factory never knows which database it's on:
@@ -463,19 +582,19 @@ from pycraftcore.repository.adapter import (
463
582
  SqliteSettingsMapper,
464
583
  )
465
584
 
466
- postgres = PostgresEngineBuilder(PostgresSettingsMapper(config.connector.database("tasks"))())
467
- sqlite = SqliteEngineBuilder(SqliteSettingsMapper(config.connector.database("tasks_fallback"))())
585
+ postgres = PostgresEngineBuilder(PostgresSettingsMapper(config.operation.database("tasks"))())
586
+ sqlite = SqliteEngineBuilder(SqliteSettingsMapper(config.operation.database("tasks_fallback"))())
468
587
 
469
- factory = SqlAlchemyRepositoryFactory(postgres) # or sqlite: same factory
470
- await factory.ping() # raises when the database can't be reached
471
- engine = await factory.connection() # an AsyncEngine, for the library
472
- await factory.disconnect() # disposes the engine
588
+ factory = SqlAlchemyRepositoryFactory(postgres) # or sqlite: same factory
589
+ await factory.ping() # raises when the database can't be reached
590
+ engine = await factory.connection() # an AsyncEngine, for the library
591
+ await factory.disconnect() # disposes the engine
473
592
  ```
474
593
 
475
594
  | Builder | Settings | Engine |
476
595
  |---|---|---|
477
- | `PostgresEngineBuilder` | `PostgresConnector` | `postgresql+psycopg`, a pool of `pool.max` connections checked before use (`pool_pre_ping`), so a database restart doesn't leave dead connections |
478
- | `SqliteEngineBuilder` | `SqliteConnector` | `sqlite+aiosqlite` on the file `SqliteDatabaseFile` prepares (`<host>/<default_name>.db`, folder created); every connection it opens gets the same PRAGMAs as `SqliteRepositoryFactory` (WAL, a 5-second busy timeout, `synchronous=NORMAL`) |
596
+ | `PostgresEngineBuilder` | `PostgresConnector` | `postgresql+psycopg`, a pool of `pool.max` connections checked before use (`pool_pre_ping`), so a database restart doesn't leave dead connections, and the connector's `timeout` as connect timeout |
597
+ | `SqliteEngineBuilder` | `SqliteConnector` | `sqlite+aiosqlite` on the file `SqliteDatabaseFile` prepares (`<connector host>/<operation database>.db`, folder created); every connection it opens gets the same PRAGMAs as `SqliteRepositoryFactory` (WAL, a 5-second busy timeout, `synchronous=NORMAL`) |
479
598
 
480
599
  - Both builders use the drivers the other adapters use, so there's no other driver to install.
481
600
  - Another database is another class with a `build() -> AsyncEngine` method (the `SqlAlchemyEngineBuilder` protocol); the factory doesn't change.
@@ -81,7 +81,7 @@ Each module stands on its own: use the ones you need. The modules today (new one
81
81
  | `web_litestar`, `web_fastapi`, `web_blacksheep` | One toolkit per framework: build the app with pycraftcore's conventions and write your routes with the framework's own features |
82
82
  | `resilient_http` | An HTTP transport with retries and a circuit breaker built in |
83
83
  | `retry`, `circuit_breaker` | The two policies on their own, for any async call |
84
- | `repository` | Async repositories built from a database connector — today SQLite (pooled), PostgreSQL, MongoDB, and SQLAlchemy (PostgreSQL or SQLite, for libraries that need an engine) |
84
+ | `repository` | Async repositories built from a database connector — today SQLite (pooled), PostgreSQL, MongoDB (with TTL indexes kept to a set expiry), and SQLAlchemy (PostgreSQL or SQLite, for libraries that need an engine) |
85
85
  | `query_language` | Checks that a SQL statement is read-only, and translates between dialects, before it reaches a database |
86
86
  | `runtime` | Runs untrusted Python in a separate process with memory, time and module limits; optionally lets it call your functions |
87
87
  | `file_handler` | Read and write files by extension (today csv, json, yml, md, txt, svg); a new format is a new reader/writer pair |
@@ -96,8 +96,8 @@ A service's configuration is a folder of YAML files, with values taken from envi
96
96
  | Path | What it holds |
97
97
  |---|---|
98
98
  | `root.yml` | The environment, the log level and the list of connectors, operations and servers in use |
99
- | `<env>/connector/*.yml` | Where things are: APIs, databases, files, MCP servers, telemetry |
100
- | `<env>/operation/*.yml` | What you do with them; each operation points at a connector |
99
+ | `<env>/connector/*.yml` | Where things are and how to reach them: APIs, databases, files, MCP servers, A2A agents, telemetry |
100
+ | `<env>/operation/*.yml` | What you do with them: which database, tables and TTL, which endpoint, which parameters; each operation points at a connector |
101
101
  | `<env>/server/*.yml` | How the service itself is served: base path, API documentation, CORS origins, and your own `parameters` |
102
102
 
103
103
  ```yaml
@@ -128,6 +128,72 @@ operation:
128
128
  days: 3
129
129
  ```
130
130
 
131
+ A connector holds only what every operation needs to reach the system; an operation holds what one use does there. Databases follow the same split:
132
+
133
+ ```yaml
134
+ # <env>/connector/database.yml
135
+ connector:
136
+ postgresql:
137
+ name: postgresql
138
+ type: database
139
+ engine: postgresql
140
+ host: ${oc.env:DB_HOST}
141
+ port: 5432
142
+ timeout: 5 # seconds to reach the server
143
+ pool:
144
+ min: 1
145
+ max: 10
146
+ auth:
147
+ type: basic
148
+ username: ${oc.env:DB_USER}
149
+ password: ${oc.env:DB_PASSWORD}
150
+ ```
151
+
152
+ ```yaml
153
+ # <env>/operation/database.yml
154
+ operation:
155
+ orders:
156
+ name: orders
157
+ type: database
158
+ connector: ${connector.postgresql}
159
+ database: shop
160
+ collections: # role → name: tables in SQL, collections in MongoDB
161
+ orders: orders
162
+ events: order_events
163
+ ttl: 604800 # seconds the data is kept, for the code that enforces it
164
+ ```
165
+
166
+ | Goes in the connector | Goes in the operation |
167
+ |---|---|
168
+ | `engine`, `host`, `port`, `auth` | `database`: the database, the SQLite file name or the MongoDB database |
169
+ | `timeout`: how long to wait to reach the server (default 5 s) | `collections`: the tables or collections it uses, by role (`operation.collection("events")`) |
170
+ | `pool`: `min` and `max` connections only (default 1 and 1) | `ttl`: how long its data is kept (seconds, optional) |
171
+ | | `parameters`: anything else, passed through |
172
+
173
+ A database connector, its pool and a database operation refuse keys they don't know, so a misplaced setting fails at load with its path (`connector.database.postgresql.database.pool.ttl`) instead of being ignored.
174
+
175
+ An A2A connector describes an A2A agent's endpoint, whether the service calls it or serves it; an A2A operation holds what one use of it needs:
176
+
177
+ ```yaml
178
+ connector:
179
+ agent:
180
+ name: agent
181
+ type: a2a
182
+ base_url: http://<agent-host>:8000/a2a
183
+ timeout: 60
184
+ binding: JSONRPC # or HTTP+JSON, GRPC
185
+ auth:
186
+ type: none
187
+
188
+ operation:
189
+ ask_agent:
190
+ name: ask_agent
191
+ type: a2a
192
+ connector: ${connector.agent}
193
+ parameters:
194
+ skill: homelab-assistant
195
+ ```
196
+
131
197
  ```yaml
132
198
  # <env>/server/asgi.yml
133
199
  server:
@@ -175,7 +241,7 @@ operation = config.operation.api("forecast") # ApiOperation
175
241
  server = config.server.asgi("weather-api") # AsgiServer
176
242
  ```
177
243
 
178
- `config.connector` returns typed connectors per kind (`.api()`, `.database()`, `.file()`, `.mcp()`, `.telemetry()`), `config.operation` typed operations (`.api()`, `.file()`) and `config.server` typed servers (`.asgi()`); the `type` field of each entry decides which fields it takes.
244
+ `config.connector` returns typed connectors per kind (`.api()`, `.database()`, `.file()`, `.mcp()`, `.a2a()`, `.telemetry()`), `config.operation` typed operations (`.api()`, `.file()`, `.mcp()`, `.a2a()`, `.database()`) and `config.server` typed servers (`.asgi()`); the `type` field of each entry decides which fields it takes.
179
245
 
180
246
  - `log` is a `LogLevel` (`DEBUG`, `INFO`, `WARNING`, `ERROR`, `CRITICAL`, upper case): pass it to `configure_logging(config.log)`.
181
247
  - A server holds `base_path`, `docs` and `cors_origins`: turn them into the web toolkit's `ApiSettings` (see [Serving an HTTP API](#serving-an-http-api)). Which framework serves the API is a choice made in code, not in the configuration.
@@ -183,6 +249,35 @@ server = config.server.asgi("weather-api") # AsgiServer
183
249
  - `parameters` is yours: pycraftcore passes it through untouched. `oc.env` always gives strings, so convert the values where you read them.
184
250
  - `log` and `server` are required, like `connector` and `operation`. A service that serves no HTTP API writes `server: {}`.
185
251
 
252
+ #### Reading another YAML tree
253
+
254
+ `OmegaTreeReader` is the loading the configuration uses, for any other tree of YAML files: a root file, folders whose `*.yml` files are merged under it (in name order, the root file last so it wins), and `${oc.env:…}` and `${…}` references resolved.
255
+
256
+ ```python
257
+ from pathlib import Path
258
+
259
+ from pycraftcore.application_configuration.adapter import OmegaTreeReader
260
+
261
+ agent = Path("agents/chat")
262
+ tree = OmegaTreeReader(agent / "agent.yml", [agent / "skills"]).read("agent") # a dict
263
+ ```
264
+
265
+ - `read(key)` returns the section under `key` as plain data, to validate with your own pydantic model.
266
+ - A missing root file, a missing key, a key that isn't a mapping or an environment variable that isn't set raises at once, with the file or the key in the message.
267
+ - A folder that doesn't exist counts as no files.
268
+
269
+ #### Upgrading from 5.x
270
+
271
+ 6.0.0 moves what a database connector held for one use into a database operation:
272
+
273
+ 1. Move `default_name` from each database connector to a new `type: database` operation, as `database`.
274
+ 2. Move `pool.timeout_ms` to the connector's `timeout`, in seconds (`3000` → `3`).
275
+ 3. Move `pool.ttl` to the operation's `ttl`, and collection or table names to its `collections`.
276
+ 4. List the operations in `root.yml`, and build settings mappers from `config.operation.database(name)` instead of `config.connector.database(name)`.
277
+ 5. The settings models' `default_name` is now `database`; `PostgresConnector` also takes `connect_timeout`.
278
+
279
+ A 5.x connector fails to load and names the key to move.
280
+
186
281
  ### Logging and the request id
187
282
 
188
283
  ```python
@@ -322,7 +417,7 @@ Repositories are built from a database connector and share one interface, `Async
322
417
  ```python
323
418
  from pycraftcore.repository.adapter import SqliteRepositoryFactory, SqliteSettingsMapper
324
419
 
325
- factory = SqliteRepositoryFactory(SqliteSettingsMapper(config.connector.database("users"))())
420
+ factory = SqliteRepositoryFactory(SqliteSettingsMapper(config.operation.database("users"))())
326
421
  repository = await factory.connect()
327
422
  rows = await repository.execute("SELECT id, email FROM users LIMIT 10")
328
423
  await factory.disconnect()
@@ -330,8 +425,32 @@ await factory.disconnect()
330
425
 
331
426
  `PostgresRepositoryFactory` / `PostgresSettingsMapper` and `MongoRepositoryFactory` / `MongoSettingsMapper` work the same way, and so will any database added later: a factory, a settings mapper and a repository behind the same `AsyncRepository` port.
332
427
 
428
+ A settings mapper takes a database operation: the connection comes from its connector (host, port, credentials, `timeout`, `pool`), the database from the operation. PostgreSQL gives up connecting after `timeout` seconds; MongoDB waits that long to find the server. MongoDB's client keeps its own pool, so `pool` doesn't apply to it.
429
+
333
430
  Every factory has three methods: `connect()` gives the `AsyncRepository`, `connection()` gives the driver's own client, and `disconnect()` closes both. Use `connection()` to hand the database to a library that brings its own code, such as LangGraph's checkpointers (`MongoClient`, an aiosqlite connection).
334
431
 
432
+ #### MongoDB TTL indexes
433
+
434
+ A TTL index makes MongoDB delete each document a set time after the date in one of its fields. MongoDB refuses to create the same index again with another expiry, so a changed retention would otherwise mean dropping the index by hand. `MongoTtlIndex` takes the field and the expiry, and `ensure(collection)` makes the collection match:
435
+
436
+ ```python
437
+ from pycraftcore.repository.adapter import MongoTtlIndex, TtlIndexChange
438
+
439
+ client = await factory.connection() # a MongoRepositoryFactory
440
+ change = await MongoTtlIndex("created_at", 604800).ensure(client["app"]["events"])
441
+ ```
442
+
443
+ | The collection has | `ensure` | Returns |
444
+ |---|---|---|
445
+ | no single-field index on the field | creates it, with the expiry | `TtlIndexChange.CREATED` |
446
+ | one with the same expiry | does nothing | `TtlIndexChange.UNCHANGED` |
447
+ | one with another expiry, or none (a plain index) | changes it in place with `collMod`: no rebuild, the documents stay | `TtlIndexChange.UPDATED` |
448
+
449
+ - Run it before a library that creates its own TTL index (LangGraph's `MongoDBSaver` with `ttl`): the library then finds the index as it wants it and leaves it alone.
450
+ - Changing an index needs the `collMod` action (the `dbAdmin` role, or root); creating one needs `createIndex` (`readWrite`).
451
+ - The expiry is checked when the object is built: 0 to 2147483647 seconds, as MongoDB accepts.
452
+ - A compound index that starts with the field isn't a TTL index, so it's not taken for one.
453
+
335
454
  #### SQLAlchemy
336
455
 
337
456
  For a library that asks for a SQLAlchemy engine, `SqlAlchemyRepositoryFactory` manages one: it builds it once, checks it answers, and disposes of it. How the engine is built is injected, as an engine builder made from the existing PostgreSQL or SQLite settings, so the factory never knows which database it's on:
@@ -345,19 +464,19 @@ from pycraftcore.repository.adapter import (
345
464
  SqliteSettingsMapper,
346
465
  )
347
466
 
348
- postgres = PostgresEngineBuilder(PostgresSettingsMapper(config.connector.database("tasks"))())
349
- sqlite = SqliteEngineBuilder(SqliteSettingsMapper(config.connector.database("tasks_fallback"))())
467
+ postgres = PostgresEngineBuilder(PostgresSettingsMapper(config.operation.database("tasks"))())
468
+ sqlite = SqliteEngineBuilder(SqliteSettingsMapper(config.operation.database("tasks_fallback"))())
350
469
 
351
- factory = SqlAlchemyRepositoryFactory(postgres) # or sqlite: same factory
352
- await factory.ping() # raises when the database can't be reached
353
- engine = await factory.connection() # an AsyncEngine, for the library
354
- await factory.disconnect() # disposes the engine
470
+ factory = SqlAlchemyRepositoryFactory(postgres) # or sqlite: same factory
471
+ await factory.ping() # raises when the database can't be reached
472
+ engine = await factory.connection() # an AsyncEngine, for the library
473
+ await factory.disconnect() # disposes the engine
355
474
  ```
356
475
 
357
476
  | Builder | Settings | Engine |
358
477
  |---|---|---|
359
- | `PostgresEngineBuilder` | `PostgresConnector` | `postgresql+psycopg`, a pool of `pool.max` connections checked before use (`pool_pre_ping`), so a database restart doesn't leave dead connections |
360
- | `SqliteEngineBuilder` | `SqliteConnector` | `sqlite+aiosqlite` on the file `SqliteDatabaseFile` prepares (`<host>/<default_name>.db`, folder created); every connection it opens gets the same PRAGMAs as `SqliteRepositoryFactory` (WAL, a 5-second busy timeout, `synchronous=NORMAL`) |
478
+ | `PostgresEngineBuilder` | `PostgresConnector` | `postgresql+psycopg`, a pool of `pool.max` connections checked before use (`pool_pre_ping`), so a database restart doesn't leave dead connections, and the connector's `timeout` as connect timeout |
479
+ | `SqliteEngineBuilder` | `SqliteConnector` | `sqlite+aiosqlite` on the file `SqliteDatabaseFile` prepares (`<connector host>/<operation database>.db`, folder created); every connection it opens gets the same PRAGMAs as `SqliteRepositoryFactory` (WAL, a 5-second busy timeout, `synchronous=NORMAL`) |
361
480
 
362
481
  - Both builders use the drivers the other adapters use, so there's no other driver to install.
363
482
  - Another database is another class with a `build() -> AsyncEngine` method (the `SqlAlchemyEngineBuilder` protocol); the factory doesn't change.
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "pycraftcore"
7
- version = "5.2.0"
7
+ version = "6.0.0"
8
8
  authors = [
9
9
  { name = "Toufik Saouchi", email = "toufik.saouchi@gmail.com" },
10
10
  ]
@@ -4,6 +4,7 @@ from pycraftcore.application_configuration.adapter.load_application_configuratio
4
4
  from pycraftcore.application_configuration.adapter.omega_configuration_reader import (
5
5
  OmegaConfigurationReader,
6
6
  )
7
+ from pycraftcore.application_configuration.adapter.omega_tree_reader import OmegaTreeReader
7
8
  from pycraftcore.application_configuration.adapter.schema import (
8
9
  ApplicationConfigurationSchema,
9
10
  )
@@ -12,4 +13,5 @@ __all__ = [
12
13
  "ApplicationConfigurationSchema",
13
14
  "LoadApplicationConfiguration",
14
15
  "OmegaConfigurationReader",
16
+ "OmegaTreeReader",
15
17
  ]
@@ -0,0 +1,35 @@
1
+ from pathlib import Path
2
+
3
+ from pycraftcore.application_configuration.adapter.omega_tree_reader import (
4
+ FILE_EXTENSION,
5
+ OmegaTreeReader,
6
+ )
7
+ from pycraftcore.application_configuration.adapter.schema import (
8
+ ApplicationConfigurationSchema,
9
+ MapperDomainSchema,
10
+ )
11
+ from pycraftcore.application_configuration.enum.run_type_environment import (
12
+ RunTypeEnvironment,
13
+ )
14
+ from pycraftcore.application_configuration.model.configuration import (
15
+ ApplicationConfiguration,
16
+ )
17
+
18
+
19
+ class OmegaConfigurationReader:
20
+ ROOT_CONFIG_FILE_NAME = "root"
21
+ ROOT_KEY = "application_configuration"
22
+ FOLDERS: tuple[str, ...] = ("connector", "operation", "server")
23
+
24
+ def __init__(self, env: RunTypeEnvironment, config_directory: Path) -> None:
25
+ self._env = env
26
+ self._config_directory = config_directory
27
+
28
+ def read(self) -> ApplicationConfiguration:
29
+ environment_directory: Path = self._config_directory / self._env.value
30
+ tree = OmegaTreeReader(
31
+ self._config_directory / f"{self.ROOT_CONFIG_FILE_NAME}.{FILE_EXTENSION}",
32
+ [environment_directory / folder for folder in self.FOLDERS],
33
+ )
34
+ schema = ApplicationConfigurationSchema(**tree.read(self.ROOT_KEY))
35
+ return MapperDomainSchema.map(schema)
@@ -0,0 +1,38 @@
1
+ from collections.abc import Sequence
2
+ from pathlib import Path
3
+ from typing import Any, cast
4
+
5
+ from omegaconf import DictConfig, OmegaConf
6
+
7
+ FILE_EXTENSION: str = "yml"
8
+
9
+
10
+ class OmegaTreeReader:
11
+ def __init__(self, root_file: Path, folders: Sequence[Path] = ()) -> None:
12
+ self._root_file = root_file
13
+ self._folders = tuple(folders)
14
+
15
+ def read(self, key: str) -> dict[str, Any]:
16
+ tree: DictConfig = self._merged()
17
+ if key not in tree:
18
+ raise KeyError(f"{self._root_file} has no {key!r} section")
19
+ section: Any = tree[key]
20
+ if not isinstance(section, DictConfig):
21
+ raise ValueError(f"{key!r} in {self._root_file} must be a mapping")
22
+ container: Any = OmegaConf.to_container(section, resolve=True, throw_on_missing=True)
23
+ return cast(dict[str, Any], container)
24
+
25
+ def _merged(self) -> DictConfig:
26
+ if not self._root_file.is_file():
27
+ raise FileNotFoundError(f"No root file at {self._root_file}")
28
+ return cast(
29
+ DictConfig,
30
+ OmegaConf.merge(
31
+ *(
32
+ OmegaConf.load(file)
33
+ for folder in self._folders
34
+ for file in sorted(folder.glob(f"*.{FILE_EXTENSION}"))
35
+ ),
36
+ OmegaConf.load(self._root_file),
37
+ ),
38
+ )
@@ -14,6 +14,7 @@ from pycraftcore.application_configuration.model.configuration import (
14
14
  ApplicationConfiguration,
15
15
  )
16
16
  from pycraftcore.application_configuration.model.connector import (
17
+ A2aConnector,
17
18
  ApiConnector,
18
19
  ConnectorRegistry,
19
20
  DatabaseConnector,
@@ -22,7 +23,9 @@ from pycraftcore.application_configuration.model.connector import (
22
23
  TelemetryConnector,
23
24
  )
24
25
  from pycraftcore.application_configuration.model.operation import (
26
+ A2aOperation,
25
27
  ApiOperation,
28
+ DatabaseOperation,
26
29
  FileOperation,
27
30
  McpOperation,
28
31
  OperationRegistry,
@@ -40,14 +43,17 @@ _ConnectorSchemaTyping = Annotated[
40
43
  | Annotated[DatabaseConnector, Tag("database")]
41
44
  | Annotated[FileConnector, Tag("file")]
42
45
  | Annotated[TelemetryConnector, Tag("telemetry")]
43
- | Annotated[McpConnector, Tag("mcp")],
46
+ | Annotated[McpConnector, Tag("mcp")]
47
+ | Annotated[A2aConnector, Tag("a2a")],
44
48
  Discriminator(_kind_tag),
45
49
  ]
46
50
 
47
51
  _OperationSchemaTyping = Annotated[
48
52
  Annotated[ApiOperation, Tag("api")]
49
53
  | Annotated[FileOperation, Tag("file")]
50
- | Annotated[McpOperation, Tag("mcp")],
54
+ | Annotated[McpOperation, Tag("mcp")]
55
+ | Annotated[A2aOperation, Tag("a2a")]
56
+ | Annotated[DatabaseOperation, Tag("database")],
51
57
  Discriminator(_kind_tag),
52
58
  ]
53
59
 
@@ -8,3 +8,4 @@ class ConnectorType(Enum):
8
8
  file = "file"
9
9
  telemetry = "telemetry"
10
10
  mcp = "mcp"
11
+ a2a = "a2a"
@@ -5,3 +5,5 @@ class OperationType(Enum):
5
5
  api = "api"
6
6
  file = "file"
7
7
  mcp = "mcp"
8
+ a2a = "a2a"
9
+ database = "database"