pietto 0.1.1__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 (303) hide show
  1. pietto-0.1.1/LICENSE +21 -0
  2. pietto-0.1.1/LICENSES/ANTLR-4.13.2-Python3-template-header.txt +30 -0
  3. pietto-0.1.1/LICENSES/ANTLR-4.13.2.txt +28 -0
  4. pietto-0.1.1/LICENSES/PostgreSQL-18.6.txt +23 -0
  5. pietto-0.1.1/LICENSES/SOURCES.md +33 -0
  6. pietto-0.1.1/LICENSES/pgvector-0.8.6.txt +20 -0
  7. pietto-0.1.1/PKG-INFO +411 -0
  8. pietto-0.1.1/README.md +366 -0
  9. pietto-0.1.1/THIRD_PARTY_NOTICES.md +58 -0
  10. pietto-0.1.1/pyproject.toml +97 -0
  11. pietto-0.1.1/pyproject.toml.orig +86 -0
  12. pietto-0.1.1/src/pietto/__init__.py +1 -0
  13. pietto-0.1.1/src/pietto/_flat_relational_admission.py +76 -0
  14. pietto-0.1.1/src/pietto/_metadata/__init__.py +6 -0
  15. pietto-0.1.1/src/pietto/_metadata/builder.py +516 -0
  16. pietto-0.1.1/src/pietto/_metadata/model.py +212 -0
  17. pietto-0.1.1/src/pietto/_metadata/serializer.py +290 -0
  18. pietto-0.1.1/src/pietto/_metadata/text.py +210 -0
  19. pietto-0.1.1/src/pietto/_project/__init__.py +3 -0
  20. pietto-0.1.1/src/pietto/_project/aggregate_grouped_clause_facts.py +1374 -0
  21. pietto-0.1.1/src/pietto/_project/aggregate_grouped_dependency_lineage.py +1184 -0
  22. pietto-0.1.1/src/pietto/_project/aggregate_grouped_persistence.py +211 -0
  23. pietto-0.1.1/src/pietto/_project/aggregate_grouped_schema.py +2024 -0
  24. pietto-0.1.1/src/pietto/_project/capability_availability.py +370 -0
  25. pietto-0.1.1/src/pietto/_project/capability_checking.py +514 -0
  26. pietto-0.1.1/src/pietto/_project/capability_inspection.py +1166 -0
  27. pietto-0.1.1/src/pietto/_project/capability_matrix.py +250 -0
  28. pietto-0.1.1/src/pietto/_project/capability_pure_boundary.py +1925 -0
  29. pietto-0.1.1/src/pietto/_project/check.py +332 -0
  30. pietto-0.1.1/src/pietto/_project/config.py +1388 -0
  31. pietto-0.1.1/src/pietto/_project/discovery.py +181 -0
  32. pietto-0.1.1/src/pietto/_project/extension_catalog_availability.py +288 -0
  33. pietto-0.1.1/src/pietto/_project/extension_catalog_inspection.py +1502 -0
  34. pietto-0.1.1/src/pietto/_project/extension_catalog_inspection_pure_boundary.py +1012 -0
  35. pietto-0.1.1/src/pietto/_project/extension_signature_provider.py +529 -0
  36. pietto-0.1.1/src/pietto/_project/json_v2.py +140 -0
  37. pietto-0.1.1/src/pietto/_project/let_scope_facts.py +354 -0
  38. pietto-0.1.1/src/pietto/_project/model.py +3335 -0
  39. pietto-0.1.1/src/pietto/_project/module_attribution.py +3574 -0
  40. pietto-0.1.1/src/pietto/_project/module_bindings.py +1123 -0
  41. pietto-0.1.1/src/pietto/_project/module_carrier.py +146 -0
  42. pietto-0.1.1/src/pietto/_project/module_catalog.py +261 -0
  43. pietto-0.1.1/src/pietto/_project/module_exports.py +756 -0
  44. pietto-0.1.1/src/pietto/_project/module_graph.py +1878 -0
  45. pietto-0.1.1/src/pietto/_project/module_inspection.py +2795 -0
  46. pietto-0.1.1/src/pietto/_project/module_package_neutral_identity.py +1064 -0
  47. pietto-0.1.1/src/pietto/_project/module_pure_boundary.py +4936 -0
  48. pietto-0.1.1/src/pietto/_project/module_relation_resolution.py +2221 -0
  49. pietto-0.1.1/src/pietto/_project/module_resolution.py +1744 -0
  50. pietto-0.1.1/src/pietto/_project/module_semantic_fact_preservation.py +4335 -0
  51. pietto-0.1.1/src/pietto/_project/package_capability_requirements.py +36 -0
  52. pietto-0.1.1/src/pietto/_project/package_extension_signature_selectors.py +65 -0
  53. pietto-0.1.1/src/pietto/_project/package_graph.py +3770 -0
  54. pietto-0.1.1/src/pietto/_project/package_graph_inspection.py +1955 -0
  55. pietto-0.1.1/src/pietto/_project/package_inspection.py +957 -0
  56. pietto-0.1.1/src/pietto/_project/package_load_plan.py +727 -0
  57. pietto-0.1.1/src/pietto/_project/package_loader.py +767 -0
  58. pietto-0.1.1/src/pietto/_project/package_locator.py +192 -0
  59. pietto-0.1.1/src/pietto/_project/package_manifest.py +2025 -0
  60. pietto-0.1.1/src/pietto/_project/package_pure_boundary.py +873 -0
  61. pietto-0.1.1/src/pietto/_project/package_rejection.py +184 -0
  62. pietto-0.1.1/src/pietto/_project/path_trust.py +443 -0
  63. pietto-0.1.1/src/pietto/_project/project_arrow_interop.py +594 -0
  64. pietto-0.1.1/src/pietto/_project/project_arrow_result.py +598 -0
  65. pietto-0.1.1/src/pietto/_project/project_bag_null_oracle.py +267 -0
  66. pietto-0.1.1/src/pietto/_project/project_capability_environment.py +531 -0
  67. pietto-0.1.1/src/pietto/_project/project_compiled_build.py +2304 -0
  68. pietto-0.1.1/src/pietto/_project/project_compiled_loading.py +83 -0
  69. pietto-0.1.1/src/pietto/_project/project_compiled_lowering.py +616 -0
  70. pietto-0.1.1/src/pietto/_project/project_compiled_schema.py +528 -0
  71. pietto-0.1.1/src/pietto/_project/project_compiled_verification.py +4606 -0
  72. pietto-0.1.1/src/pietto/_project/project_completed_semantics.py +1933 -0
  73. pietto-0.1.1/src/pietto/_project/project_completion.py +1172 -0
  74. pietto-0.1.1/src/pietto/_project/project_current_join_inputs.py +567 -0
  75. pietto-0.1.1/src/pietto/_project/project_current_joins.py +1188 -0
  76. pietto-0.1.1/src/pietto/_project/project_execution.py +907 -0
  77. pietto-0.1.1/src/pietto/_project/project_execution_binding_verification.py +431 -0
  78. pietto-0.1.1/src/pietto/_project/project_execution_mysql.py +737 -0
  79. pietto-0.1.1/src/pietto/_project/project_execution_mysql_context.py +472 -0
  80. pietto-0.1.1/src/pietto/_project/project_execution_mysql_control.py +99 -0
  81. pietto-0.1.1/src/pietto/_project/project_execution_mysql_native.py +369 -0
  82. pietto-0.1.1/src/pietto/_project/project_execution_postgres.py +1002 -0
  83. pietto-0.1.1/src/pietto/_project/project_execution_postgres_adbc.py +748 -0
  84. pietto-0.1.1/src/pietto/_project/project_execution_postgres_adbc_context.py +259 -0
  85. pietto-0.1.1/src/pietto/_project/project_execution_postgres_adbc_native.py +333 -0
  86. pietto-0.1.1/src/pietto/_project/project_execution_projection.py +124 -0
  87. pietto-0.1.1/src/pietto/_project/project_execution_reader.py +399 -0
  88. pietto-0.1.1/src/pietto/_project/project_execution_source.py +513 -0
  89. pietto-0.1.1/src/pietto/_project/project_execution_template.py +460 -0
  90. pietto-0.1.1/src/pietto/_project/project_final_outputs.py +6355 -0
  91. pietto-0.1.1/src/pietto/_project/project_grain.py +1244 -0
  92. pietto-0.1.1/src/pietto/_project/project_guard_context.py +452 -0
  93. pietto-0.1.1/src/pietto/_project/project_guard_lowering.py +134 -0
  94. pietto-0.1.1/src/pietto/_project/project_guard_preparation.py +342 -0
  95. pietto-0.1.1/src/pietto/_project/project_guard_program.py +163 -0
  96. pietto-0.1.1/src/pietto/_project/project_guard_rendering.py +404 -0
  97. pietto-0.1.1/src/pietto/_project/project_guard_runtime.py +478 -0
  98. pietto-0.1.1/src/pietto/_project/project_guard_verification.py +676 -0
  99. pietto-0.1.1/src/pietto/_project/project_ir.py +723 -0
  100. pietto-0.1.1/src/pietto/_project/project_ir_composition.py +523 -0
  101. pietto-0.1.1/src/pietto/_project/project_ir_construction.py +743 -0
  102. pietto-0.1.1/src/pietto/_project/project_ir_evaluation_context.py +654 -0
  103. pietto-0.1.1/src/pietto/_project/project_ir_inspection.py +1200 -0
  104. pietto-0.1.1/src/pietto/_project/project_ir_joins.py +1860 -0
  105. pietto-0.1.1/src/pietto/_project/project_ir_operators.py +700 -0
  106. pietto-0.1.1/src/pietto/_project/project_ir_pipeline.py +140 -0
  107. pietto-0.1.1/src/pietto/_project/project_ir_properties.py +992 -0
  108. pietto-0.1.1/src/pietto/_project/project_ir_pure_boundary.py +1686 -0
  109. pietto-0.1.1/src/pietto/_project/project_ir_relational_properties.py +1435 -0
  110. pietto-0.1.1/src/pietto/_project/project_ir_verification.py +2584 -0
  111. pietto-0.1.1/src/pietto/_project/project_job_capture.py +1549 -0
  112. pietto-0.1.1/src/pietto/_project/project_job_chunks.py +453 -0
  113. pietto-0.1.1/src/pietto/_project/project_job_collection.py +704 -0
  114. pietto-0.1.1/src/pietto/_project/project_job_delivery.py +1734 -0
  115. pietto-0.1.1/src/pietto/_project/project_job_extraction.py +933 -0
  116. pietto-0.1.1/src/pietto/_project/project_job_publication.py +798 -0
  117. pietto-0.1.1/src/pietto/_project/project_job_replay.py +889 -0
  118. pietto-0.1.1/src/pietto/_project/project_job_runtime.py +1655 -0
  119. pietto-0.1.1/src/pietto/_project/project_job_sink.py +838 -0
  120. pietto-0.1.1/src/pietto/_project/project_job_store.py +1031 -0
  121. pietto-0.1.1/src/pietto/_project/project_job_store_verification.py +1826 -0
  122. pietto-0.1.1/src/pietto/_project/project_job_workspace.py +1250 -0
  123. pietto-0.1.1/src/pietto/_project/project_join_conditions.py +756 -0
  124. pietto-0.1.1/src/pietto/_project/project_joined_aggregation.py +3415 -0
  125. pietto-0.1.1/src/pietto/_project/project_joined_qualify.py +1003 -0
  126. pietto-0.1.1/src/pietto/_project/project_joined_row_filter.py +547 -0
  127. pietto-0.1.1/src/pietto/_project/project_joined_row_semantics.py +698 -0
  128. pietto-0.1.1/src/pietto/_project/project_joined_windows.py +1553 -0
  129. pietto-0.1.1/src/pietto/_project/project_multifact.py +2630 -0
  130. pietto-0.1.1/src/pietto/_project/project_mysql_view_source.py +418 -0
  131. pietto-0.1.1/src/pietto/_project/project_mysql_view_source_verification.py +544 -0
  132. pietto-0.1.1/src/pietto/_project/project_phase62_inspection.py +3014 -0
  133. pietto-0.1.1/src/pietto/_project/project_phase62_pure_boundary.py +1782 -0
  134. pietto-0.1.1/src/pietto/_project/project_phase62_verification.py +2901 -0
  135. pietto-0.1.1/src/pietto/_project/project_postgres_source_assurance.py +429 -0
  136. pietto-0.1.1/src/pietto/_project/project_postgres_source_assurance_verification.py +616 -0
  137. pietto-0.1.1/src/pietto/_project/project_query_block.py +497 -0
  138. pietto-0.1.1/src/pietto/_project/project_query_block_ir.py +4975 -0
  139. pietto-0.1.1/src/pietto/_project/project_query_block_ir_algebra.py +429 -0
  140. pietto-0.1.1/src/pietto/_project/project_query_block_ir_inspection.py +3866 -0
  141. pietto-0.1.1/src/pietto/_project/project_query_block_ir_pure_boundary.py +3128 -0
  142. pietto-0.1.1/src/pietto/_project/project_query_block_ir_verification.py +4357 -0
  143. pietto-0.1.1/src/pietto/_project/project_refinement.py +169 -0
  144. pietto-0.1.1/src/pietto/_project/project_refinement_enumeration.py +552 -0
  145. pietto-0.1.1/src/pietto/_project/project_refinement_lowering.py +702 -0
  146. pietto-0.1.1/src/pietto/_project/project_refinement_order.py +174 -0
  147. pietto-0.1.1/src/pietto/_project/project_refinement_rendering.py +451 -0
  148. pietto-0.1.1/src/pietto/_project/project_refinement_verification.py +1500 -0
  149. pietto-0.1.1/src/pietto/_project/project_refinement_windows.py +201 -0
  150. pietto-0.1.1/src/pietto/_project/project_relationship_conditions.py +1094 -0
  151. pietto-0.1.1/src/pietto/_project/project_relationship_match_guarantees.py +603 -0
  152. pietto-0.1.1/src/pietto/_project/project_relationship_paths.py +438 -0
  153. pietto-0.1.1/src/pietto/_project/project_relationship_uses.py +1423 -0
  154. pietto-0.1.1/src/pietto/_project/project_relationships.py +725 -0
  155. pietto-0.1.1/src/pietto/_project/project_result_binding.py +410 -0
  156. pietto-0.1.1/src/pietto/_project/project_result_contract.py +200 -0
  157. pietto-0.1.1/src/pietto/_project/project_result_contract_correspondence.py +562 -0
  158. pietto-0.1.1/src/pietto/_project/project_result_contract_portable.py +547 -0
  159. pietto-0.1.1/src/pietto/_project/project_result_contract_pure_boundary.py +910 -0
  160. pietto-0.1.1/src/pietto/_project/project_result_ingress.py +47 -0
  161. pietto-0.1.1/src/pietto/_project/project_result_ipc.py +375 -0
  162. pietto-0.1.1/src/pietto/_project/project_result_output.py +330 -0
  163. pietto-0.1.1/src/pietto/_project/project_result_reader.py +561 -0
  164. pietto-0.1.1/src/pietto/_project/project_row_equivalence.py +257 -0
  165. pietto-0.1.1/src/pietto/_project/project_row_keys.py +1435 -0
  166. pietto-0.1.1/src/pietto/_project/project_scalar_bindings.py +332 -0
  167. pietto-0.1.1/src/pietto/_project/project_scalar_meaning.py +281 -0
  168. pietto-0.1.1/src/pietto/_project/project_scalar_namespaces.py +952 -0
  169. pietto-0.1.1/src/pietto/_project/project_scalar_references.py +535 -0
  170. pietto-0.1.1/src/pietto/_project/project_set_operations.py +337 -0
  171. pietto-0.1.1/src/pietto/_project/project_single_match.py +683 -0
  172. pietto-0.1.1/src/pietto/_project/project_sql_emission.py +1013 -0
  173. pietto-0.1.1/src/pietto/_project/project_sql_emission_aggregation.py +877 -0
  174. pietto-0.1.1/src/pietto/_project/project_sql_emission_ast.py +2560 -0
  175. pietto-0.1.1/src/pietto/_project/project_sql_emission_cli.py +557 -0
  176. pietto-0.1.1/src/pietto/_project/project_sql_emission_contract.py +843 -0
  177. pietto-0.1.1/src/pietto/_project/project_sql_emission_inspection.py +208 -0
  178. pietto-0.1.1/src/pietto/_project/project_sql_emission_joins.py +588 -0
  179. pietto-0.1.1/src/pietto/_project/project_sql_emission_parameters.py +330 -0
  180. pietto-0.1.1/src/pietto/_project/project_sql_emission_portable.py +1027 -0
  181. pietto-0.1.1/src/pietto/_project/project_sql_emission_portable_schema.py +960 -0
  182. pietto-0.1.1/src/pietto/_project/project_sql_emission_pure_boundary.py +2271 -0
  183. pietto-0.1.1/src/pietto/_project/project_sql_emission_rendering.py +828 -0
  184. pietto-0.1.1/src/pietto/_project/project_sql_emission_results.py +898 -0
  185. pietto-0.1.1/src/pietto/_project/project_sql_emission_rows.py +554 -0
  186. pietto-0.1.1/src/pietto/_project/project_sql_emission_scopes.py +195 -0
  187. pietto-0.1.1/src/pietto/_project/project_sql_emission_sets.py +615 -0
  188. pietto-0.1.1/src/pietto/_project/project_sql_emission_verification.py +4983 -0
  189. pietto-0.1.1/src/pietto/_project/project_sql_emission_windows.py +1379 -0
  190. pietto-0.1.1/src/pietto/_project/project_sql_plan.py +4329 -0
  191. pietto-0.1.1/src/pietto/_project/project_sql_plan_aggregation.py +597 -0
  192. pietto-0.1.1/src/pietto/_project/project_sql_plan_expressions.py +692 -0
  193. pietto-0.1.1/src/pietto/_project/project_sql_plan_inspection.py +840 -0
  194. pietto-0.1.1/src/pietto/_project/project_sql_plan_joins.py +426 -0
  195. pietto-0.1.1/src/pietto/_project/project_sql_plan_literals.py +535 -0
  196. pietto-0.1.1/src/pietto/_project/project_sql_plan_portable.py +1185 -0
  197. pietto-0.1.1/src/pietto/_project/project_sql_plan_portable_schema.py +9483 -0
  198. pietto-0.1.1/src/pietto/_project/project_sql_plan_pure_boundary.py +2276 -0
  199. pietto-0.1.1/src/pietto/_project/project_sql_plan_requirements.py +1788 -0
  200. pietto-0.1.1/src/pietto/_project/project_sql_plan_results.py +982 -0
  201. pietto-0.1.1/src/pietto/_project/project_sql_plan_sets.py +279 -0
  202. pietto-0.1.1/src/pietto/_project/project_sql_plan_source_maps.py +1337 -0
  203. pietto-0.1.1/src/pietto/_project/project_sql_plan_target_assessment.py +1144 -0
  204. pietto-0.1.1/src/pietto/_project/project_sql_plan_target_mapping.py +840 -0
  205. pietto-0.1.1/src/pietto/_project/project_sql_plan_verification.py +5999 -0
  206. pietto-0.1.1/src/pietto/_project/project_sql_plan_windows.py +1097 -0
  207. pietto-0.1.1/src/pietto/_project/project_value_fds.py +763 -0
  208. pietto-0.1.1/src/pietto/_project/project_verification_scope.py +85 -0
  209. pietto-0.1.1/src/pietto/_project/row_dependency_graph.py +631 -0
  210. pietto-0.1.1/src/pietto/_project/row_expression_schema.py +514 -0
  211. pietto-0.1.1/src/pietto/_project/row_expression_type_facts.py +162 -0
  212. pietto-0.1.1/src/pietto/_project/row_lineage.py +760 -0
  213. pietto-0.1.1/src/pietto/_project/selected_input_index.py +125 -0
  214. pietto-0.1.1/src/pietto/_project/source_selection.py +495 -0
  215. pietto-0.1.1/src/pietto/_project/trusted_source.py +311 -0
  216. pietto-0.1.1/src/pietto/_project/window_persistence.py +683 -0
  217. pietto-0.1.1/src/pietto/_project/window_semantics.py +991 -0
  218. pietto-0.1.1/src/pietto/_project_explain/__init__.py +3 -0
  219. pietto-0.1.1/src/pietto/_project_explain/compatibility_matrix_projection.py +1341 -0
  220. pietto-0.1.1/src/pietto/_project_explain/composition.py +652 -0
  221. pietto-0.1.1/src/pietto/_project_explain/extension_catalog_evidence_projection.py +1346 -0
  222. pietto-0.1.1/src/pietto/_project_explain/json_v1.py +940 -0
  223. pietto-0.1.1/src/pietto/_project_explain/model.py +212 -0
  224. pietto-0.1.1/src/pietto/_project_explain/package_requirement_projection.py +793 -0
  225. pietto-0.1.1/src/pietto/_project_explain/portability_projection.py +285 -0
  226. pietto-0.1.1/src/pietto/_project_explain/runtime_builder.py +596 -0
  227. pietto-0.1.1/src/pietto/_project_explain/text.py +402 -0
  228. pietto-0.1.1/src/pietto/_window_identity.py +39 -0
  229. pietto-0.1.1/src/pietto/ast_builder.py +1426 -0
  230. pietto-0.1.1/src/pietto/ast_nodes.py +922 -0
  231. pietto-0.1.1/src/pietto/cli.py +1203 -0
  232. pietto-0.1.1/src/pietto/cli_json.py +202 -0
  233. pietto-0.1.1/src/pietto/errors.py +87 -0
  234. pietto-0.1.1/src/pietto/generated/Pietto.interp +348 -0
  235. pietto-0.1.1/src/pietto/generated/Pietto.tokens +213 -0
  236. pietto-0.1.1/src/pietto/generated/PiettoLexer.interp +346 -0
  237. pietto-0.1.1/src/pietto/generated/PiettoLexer.py +506 -0
  238. pietto-0.1.1/src/pietto/generated/PiettoLexer.tokens +211 -0
  239. pietto-0.1.1/src/pietto/generated/PiettoParser.py +10415 -0
  240. pietto-0.1.1/src/pietto/generated/PiettoVisitor.py +588 -0
  241. pietto-0.1.1/src/pietto/generated/__init__.py +0 -0
  242. pietto-0.1.1/src/pietto/indentation.py +145 -0
  243. pietto-0.1.1/src/pietto/ir/__init__.py +95 -0
  244. pietto-0.1.1/src/pietto/ir/builder.py +1265 -0
  245. pietto-0.1.1/src/pietto/ir/diagnostics.py +24 -0
  246. pietto-0.1.1/src/pietto/ir/lowering.py +1057 -0
  247. pietto-0.1.1/src/pietto/ir/model.py +940 -0
  248. pietto-0.1.1/src/pietto/parser_api.py +284 -0
  249. pietto-0.1.1/src/pietto/semantic/__init__.py +29 -0
  250. pietto-0.1.1/src/pietto/semantic/aggregates.py +874 -0
  251. pietto-0.1.1/src/pietto/semantic/analyzer.py +934 -0
  252. pietto-0.1.1/src/pietto/semantic/callables.py +147 -0
  253. pietto-0.1.1/src/pietto/semantic/capability_aggregates.py +1234 -0
  254. pietto-0.1.1/src/pietto/semantic/capability_composition.py +438 -0
  255. pietto-0.1.1/src/pietto/semantic/capability_contexts.py +1539 -0
  256. pietto-0.1.1/src/pietto/semantic/capability_facts.py +230 -0
  257. pietto-0.1.1/src/pietto/semantic/capability_inventory.py +934 -0
  258. pietto-0.1.1/src/pietto/semantic/capability_lookup.py +144 -0
  259. pietto-0.1.1/src/pietto/semantic/capability_profiles.py +256 -0
  260. pietto-0.1.1/src/pietto/semantic/capability_providers.py +89 -0
  261. pietto-0.1.1/src/pietto/semantic/capability_signatures.py +864 -0
  262. pietto-0.1.1/src/pietto/semantic/capability_windows.py +420 -0
  263. pietto-0.1.1/src/pietto/semantic/catalog.py +43 -0
  264. pietto-0.1.1/src/pietto/semantic/expressions.py +1294 -0
  265. pietto-0.1.1/src/pietto/semantic/extension_catalog.py +1307 -0
  266. pietto-0.1.1/src/pietto/semantic/extension_catalog_pg_trgm.py +472 -0
  267. pietto-0.1.1/src/pietto/semantic/extension_catalog_pgvector.py +760 -0
  268. pietto-0.1.1/src/pietto/semantic/extension_catalog_pure_boundary.py +1036 -0
  269. pietto-0.1.1/src/pietto/semantic/extension_signature_requirements.py +166 -0
  270. pietto-0.1.1/src/pietto/semantic/field_derive_cycles.py +169 -0
  271. pietto-0.1.1/src/pietto/semantic/generic_compatibility.py +724 -0
  272. pietto-0.1.1/src/pietto/semantic/group_by.py +691 -0
  273. pietto-0.1.1/src/pietto/semantic/let_bindings.py +397 -0
  274. pietto-0.1.1/src/pietto/semantic/model.py +415 -0
  275. pietto-0.1.1/src/pietto/semantic/nullability_formulas.py +606 -0
  276. pietto-0.1.1/src/pietto/semantic/predicate_checks.py +86 -0
  277. pietto-0.1.1/src/pietto/semantic/relation_cycles.py +75 -0
  278. pietto-0.1.1/src/pietto/semantic/relation_limits.py +48 -0
  279. pietto-0.1.1/src/pietto/semantic/relation_schemas.py +525 -0
  280. pietto-0.1.1/src/pietto/semantic/relations.py +68 -0
  281. pietto-0.1.1/src/pietto/semantic/relationship_metadata.py +115 -0
  282. pietto-0.1.1/src/pietto/semantic/satisfying.py +617 -0
  283. pietto-0.1.1/src/pietto/semantic/shapes.py +151 -0
  284. pietto-0.1.1/src/pietto/semantic/source_connectors.py +129 -0
  285. pietto-0.1.1/src/pietto/semantic/sources.py +130 -0
  286. pietto-0.1.1/src/pietto/semantic/type_aliases.py +98 -0
  287. pietto-0.1.1/src/pietto/semantic/window_analysis.py +1268 -0
  288. pietto-0.1.1/src/pietto/semantic/window_input_analysis.py +501 -0
  289. pietto-0.1.1/src/pietto/semantic/window_navigation_analysis.py +899 -0
  290. pietto-0.1.1/src/pietto/semantic/window_order_analysis.py +86 -0
  291. pietto-0.1.1/src/pietto/semantic/window_partition_analysis.py +68 -0
  292. pietto-0.1.1/src/pietto/semantic/window_semantics.py +4887 -0
  293. pietto-0.1.1/src/pietto/sql/__init__.py +11 -0
  294. pietto-0.1.1/src/pietto/sql/expressions.py +781 -0
  295. pietto-0.1.1/src/pietto/sql/model.py +31 -0
  296. pietto-0.1.1/src/pietto/sql/mysql.py +120 -0
  297. pietto-0.1.1/src/pietto/sql/mysql_expressions.py +721 -0
  298. pietto-0.1.1/src/pietto/sql/mysql_relations.py +370 -0
  299. pietto-0.1.1/src/pietto/sql/mysql_render.py +90 -0
  300. pietto-0.1.1/src/pietto/sql/postgres.py +112 -0
  301. pietto-0.1.1/src/pietto/sql/relations.py +359 -0
  302. pietto-0.1.1/src/pietto/sql/render.py +47 -0
  303. pietto-0.1.1/src/pietto/sql/window_strategy.py +614 -0
pietto-0.1.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Mianli Wang
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,30 @@
1
+ /*
2
+ * [The "BSD license"]
3
+ * Copyright (c) 2012-2016 Terence Parr
4
+ * Copyright (c) 2012-2016 Sam Harwell
5
+ * Copyright (c) 2014 Eric Vergnaud
6
+ * All rights reserved.
7
+ *
8
+ * Redistribution and use in source and binary forms, with or without
9
+ * modification, are permitted provided that the following conditions
10
+ * are met:
11
+ *
12
+ * 1. Redistributions of source code must retain the above copyright
13
+ * notice, this list of conditions and the following disclaimer.
14
+ * 2. Redistributions in binary form must reproduce the above copyright
15
+ * notice, this list of conditions and the following disclaimer in the
16
+ * documentation and/or other materials provided with the distribution.
17
+ * 3. The name of the author may not be used to endorse or promote products
18
+ * derived from this software without specific prior written permission.
19
+ *
20
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
22
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
+ */
@@ -0,0 +1,28 @@
1
+ Copyright (c) 2012-2022 The ANTLR Project. All rights reserved.
2
+
3
+ Redistribution and use in source and binary forms, with or without
4
+ modification, are permitted provided that the following conditions
5
+ are met:
6
+
7
+ 1. Redistributions of source code must retain the above copyright
8
+ notice, this list of conditions and the following disclaimer.
9
+
10
+ 2. Redistributions in binary form must reproduce the above copyright
11
+ notice, this list of conditions and the following disclaimer in the
12
+ documentation and/or other materials provided with the distribution.
13
+
14
+ 3. Neither name of copyright holders nor the names of its contributors
15
+ may be used to endorse or promote products derived from this software
16
+ without specific prior written permission.
17
+
18
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
+ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
22
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
25
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
26
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,23 @@
1
+ PostgreSQL Database Management System
2
+ (also known as Postgres, formerly known as Postgres95)
3
+
4
+ Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
5
+
6
+ Portions Copyright (c) 1994, The Regents of the University of California
7
+
8
+ Permission to use, copy, modify, and distribute this software and its
9
+ documentation for any purpose, without fee, and without a written agreement
10
+ is hereby granted, provided that the above copyright notice and this
11
+ paragraph and the following two paragraphs appear in all copies.
12
+
13
+ IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
14
+ DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
15
+ LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
16
+ DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE
17
+ POSSIBILITY OF SUCH DAMAGE.
18
+
19
+ THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
20
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
21
+ AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
22
+ ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO
23
+ PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
@@ -0,0 +1,33 @@
1
+ # Sources of the license texts
2
+
3
+ Each license text in this directory is a byte-for-byte copy of the upstream
4
+ file, or of the line range stated for it, at the commit, archive snapshot or
5
+ tracked artifact listed below, retrieved on 2026-10-10 (UTC).
6
+
7
+ Three upstream details:
8
+
9
+ - The ANTLR 3.5.3 tag has no license file at the repository root or for the
10
+ Java runtime (`runtime/Java`, `org.antlr:antlr-runtime`) that the ANTLR jar
11
+ bundles. The closest text at that tag is `tool/LICENSE.txt`, copied here. The
12
+ runtime's own source headers read "Copyright (c) 2005-2009 Terence Parr"
13
+ (one file: 2012 Terence Parr, 2012 Sam Harwell).
14
+ - The TreeLayout 1.0.3 tag ships a BSD license text, while its POM names
15
+ BSD-3-Clause with a URL to the abego Public Licence 1.0 page. Both texts are
16
+ kept.
17
+ - Pietto's generated parser follows ANTLR's Python3 code-generation template.
18
+ That template's own BSD header differs from the ANTLR 4.13.2 `LICENSE.txt`, so
19
+ it is copied separately from the tracked ANTLR jar.
20
+
21
+ | File | Upstream file | Pin | SHA-256 |
22
+ | --- | --- | --- | --- |
23
+ | `ANTLR-4.13.2.txt` | `https://github.com/antlr/antlr4/blob/cc82115a4e7f53d71d9d905caa2c2dfa4da58899/LICENSE.txt` (tag `4.13.2`) | commit `cc82115a4e7f53d71d9d905caa2c2dfa4da58899` | `3db1fb3ee79a4b4f9918fc4d0f6133bf18a3cf787f126cd22f8aa9b862281c0c` |
24
+ | `ANTLR-4.13.2-Python3-template-header.txt` | Lines 1-30 of `org/antlr/v4/tool/templates/codegen/Python3/Python3.stg` inside `tools/antlr-4.13.2-complete.jar` (entry SHA-256 `87df5899ff72d31e9371cbda58c37e7f17a27469b85753d228243b44034dd576`) | jar SHA-256 `eae2dfa119a64327444672aff63e9ec35a20180dc5b8090b7a6ab85125df4d76` | `3bad51e28a4ecebcb8b9afdddf3bf38ef8279bc9349fa0102850ee0453a30b65` |
25
+ | `ANTLR-3.5.3.txt` | `https://github.com/antlr/antlr3/blob/0519032bb167b37f206968d9037753ad655a2623/tool/LICENSE.txt` (tag `3.5.3`) | commit `0519032bb167b37f206968d9037753ad655a2623` | `95fc87cbe29814a32fc97f6f8eb7ae55e4816d4b75143635c4db736e7e374fa2` |
26
+ | `StringTemplate-4.3.4.txt` | `https://github.com/antlr/stringtemplate4/blob/a2c4ef074e7c5018c7eb46372ed07f756c140404/LICENSE.txt` (tag `ST4-4.3.4`) | commit `a2c4ef074e7c5018c7eb46372ed07f756c140404` | `022bdae9c4f408d375f8c3c16b7695c22a2152c56535af180059e3ab92adffb0` |
27
+ | `TreeLayout-1.0.3.txt` | `https://github.com/abego/treelayout/blob/fb5b5326d9fe642b9ca0631c3da739bf775f6374/org.abego.treelayout/src/LICENSE.TXT` (tag `v1.0.3`) | commit `fb5b5326d9fe642b9ca0631c3da739bf775f6374` | `b6fcaaa79c777ccd16e7493a0451eeaca22d7166782d1b962b49af410ed09e4f` |
28
+ | `TreeLayout-1.0.3-abego-apl-v10.html` | `https://web.archive.org/web/20120110233643id_/http://www.abego-software.de:80/legal/apl-v10.html` (the licence URL named by the TreeLayout 1.0.3 POM) | Wayback snapshot `20120110233643` | `739ce194643e13015a29fb61567edad3dd80dd4df94a73ebefbd7d4606133164` |
29
+ | `ICU-72.1.txt` | `https://github.com/unicode-org/icu/blob/ff3514f257ea10afe7e710e9f946f68d256704b1/icu4j/main/shared/licenses/LICENSE` (tag `release-72-1`) | commit `ff3514f257ea10afe7e710e9f946f68d256704b1` | `af3e84c401f1a35e8d32d6eb1a33fe587c3981aa5cd206033d9527c1855b57a2` |
30
+ | `pgvector-0.8.6.txt` | `https://github.com/pgvector/pgvector/blob/8ee86c96f0fd72390f890aa8a336fda6d3ab4c6c/LICENSE` (tag `v0.8.6`) | commit `8ee86c96f0fd72390f890aa8a336fda6d3ab4c6c` | `6bba9ebeb73e27477463b05e5ef1bf303bccbddb3db9bbc95905d351604d6a87` |
31
+ | `PostgreSQL-18.6.txt` | `https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/COPYRIGHT` (tag `REL_18_6`) | commit `724edf9bde9d356724ad384a2e196edc3c9f80f7` | `3d6af92ff8a4c2cdf69afb1cf44edea727922f5cd0cf8b5f72b11cdecac8fdfd` |
32
+ | `PostGIS-3.6.4-LICENSE.txt` | `https://github.com/postgis/postgis/blob/94d984bd083635c1d253db0f87cf80b32548e406/LICENSE.TXT` (tag `3.6.4`) | commit `94d984bd083635c1d253db0f87cf80b32548e406` | `81749eea887e78402c9b85896cd629b155bc29256927f818f01001f038146391` |
33
+ | `PostGIS-3.6.4-COPYING.txt` | `https://github.com/postgis/postgis/blob/94d984bd083635c1d253db0f87cf80b32548e406/COPYING` (tag `3.6.4`) | commit `94d984bd083635c1d253db0f87cf80b32548e406` | `8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643` |
@@ -0,0 +1,20 @@
1
+ Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
2
+
3
+ Portions Copyright (c) 1994, The Regents of the University of California
4
+
5
+ Permission to use, copy, modify, and distribute this software and its
6
+ documentation for any purpose, without fee, and without a written agreement
7
+ is hereby granted, provided that the above copyright notice and this
8
+ paragraph and the following two paragraphs appear in all copies.
9
+
10
+ IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
11
+ DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
12
+ LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
13
+ DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE
14
+ POSSIBILITY OF SUCH DAMAGE.
15
+
16
+ THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
17
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
18
+ AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
19
+ ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO
20
+ PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
pietto-0.1.1/PKG-INFO ADDED
@@ -0,0 +1,411 @@
1
+ Metadata-Version: 2.4
2
+ Name: pietto
3
+ Version: 0.1.1
4
+ Summary: A gradual, semantic SQL authoring DSL
5
+ Keywords: sql,dsl,compiler,postgresql,mysql
6
+ Author: Mianli Wang
7
+ Author-email: Mianli Wang <mianli.wang@mail.utoronto.ca>
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ License-File: LICENSES/ANTLR-4.13.2-Python3-template-header.txt
11
+ License-File: LICENSES/ANTLR-4.13.2.txt
12
+ License-File: LICENSES/PostgreSQL-18.6.txt
13
+ License-File: LICENSES/SOURCES.md
14
+ License-File: LICENSES/pgvector-0.8.6.txt
15
+ License-File: THIRD_PARTY_NOTICES.md
16
+ Classifier: Development Status :: 2 - Pre-Alpha
17
+ Classifier: Intended Audience :: Developers
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3 :: Only
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Topic :: Database
24
+ Classifier: Topic :: Software Development :: Compilers
25
+ Requires-Dist: antlr4-python3-runtime==4.13.2
26
+ Requires-Dist: pyarrow==25.0.1 ; extra == 'arrow'
27
+ Requires-Dist: pyarrow==25.0.1 ; extra == 'execute-mysql'
28
+ Requires-Dist: mysql-connector-python==26.7.0 ; extra == 'execute-mysql'
29
+ Requires-Dist: pyarrow==25.0.1 ; extra == 'execute-postgres'
30
+ Requires-Dist: psycopg[binary]==3.3.5 ; extra == 'execute-postgres'
31
+ Requires-Dist: pyarrow==25.0.1 ; extra == 'execute-postgres-adbc'
32
+ Requires-Dist: adbc-driver-postgresql==1.12.0 ; extra == 'execute-postgres-adbc'
33
+ Requires-Dist: adbc-driver-manager==1.12.0 ; extra == 'execute-postgres-adbc'
34
+ Requires-Python: >=3.12
35
+ Project-URL: Homepage, https://github.com/MianliWang/pietto
36
+ Project-URL: Repository, https://github.com/MianliWang/pietto
37
+ Project-URL: Documentation, https://github.com/MianliWang/pietto/tree/v0.1.1/docs
38
+ Project-URL: Issues, https://github.com/MianliWang/pietto/issues
39
+ Project-URL: Releases, https://github.com/MianliWang/pietto/releases
40
+ Provides-Extra: arrow
41
+ Provides-Extra: execute-mysql
42
+ Provides-Extra: execute-postgres
43
+ Provides-Extra: execute-postgres-adbc
44
+ Description-Content-Type: text/markdown
45
+
46
+ # Pietto
47
+
48
+ [![CI](https://github.com/MianliWang/pietto/actions/workflows/ci.yml/badge.svg)](https://github.com/MianliWang/pietto/actions/workflows/ci.yml)
49
+ ![Python 3.12 and 3.13](https://img.shields.io/badge/Python-3.12%20%7C%203.13-3776AB?logo=python&logoColor=white)
50
+ ![Package version 0.1.1](https://img.shields.io/badge/package-0.1.1-6f42c1)
51
+
52
+ Readable, typed SQL authoring with deterministic compilation.
53
+
54
+ Pietto is a gradual semantic SQL authoring DSL. It parses and checks readable,
55
+ indentation-based source, builds immutable compiler facts, and emits explicitly
56
+ selected PostgreSQL or MySQL SQL. It does not connect to a database or execute
57
+ SQL. PostgreSQL is the public Python SQL emitter; MySQL is available through
58
+ explicit CLI lowering with a private emitter surface.
59
+
60
+ **Status: 0.1.1 public preview.** Pietto 0.1.1 can be installed from PyPI with
61
+ `pip install pietto` and is also attached to a
62
+ [GitHub pre-release](https://github.com/MianliWang/pietto/releases/tag/v0.1.1).
63
+ It has the same compiler and CLI as 0.1.0 and adds PyPI packaging information.
64
+ The compiler and CLI described below are the public surface; database execution
65
+ and result APIs are not public yet.
66
+
67
+ ## What Pietto provides
68
+
69
+ - Typed shapes, sources, tables, queries, computed fields, aggregates,
70
+ grouping, and bounded window expressions.
71
+ - Deterministic parser, semantic, and backend diagnostics with source locations
72
+ where the relevant stage has them.
73
+ - Single-file `check`, `explain`, and `emit-sql` commands, with applicable JSON
74
+ output.
75
+ - Explicit-project `emit-sql` for one selected table or query, one selected
76
+ dialect and an explicit emission contract, producing the versioned
77
+ `pietto.sql-emission.v1` artifact.
78
+ - Deterministic project checking from an explicit `pietto.toml` root, including
79
+ legacy-flat projects and the current explicit-module foundation.
80
+ - Compile-time validation and fail-closed lowering for unsupported syntax,
81
+ semantics, and backend capability.
82
+
83
+ The compiler has no runtime evaluation, database connection, transaction
84
+ management, scheduler, or arbitrary I/O language features.
85
+
86
+ ## Install
87
+
88
+ Install Pietto from PyPI into a virtual environment with CPython 3.12 or later
89
+ (replace `python3.12` with your interpreter):
90
+
91
+ ```bash
92
+ python3.12 -m venv pietto-env
93
+ pietto-env/bin/python -m pip install pietto
94
+ pietto-env/bin/pietto --version
95
+ ```
96
+
97
+ The optional extras described below install the same way, for example
98
+ `pietto-env/bin/python -m pip install "pietto[arrow]"`.
99
+
100
+ The wheel and the sdist are also attached to the
101
+ [v0.1.1 release](https://github.com/MianliWang/pietto/releases/tag/v0.1.1). To
102
+ install the wheel from there instead:
103
+
104
+ ```bash
105
+ pietto-env/bin/python -m pip install "https://github.com/MianliWang/pietto/releases/download/v0.1.1/pietto-0.1.1-py3-none-any.whl"
106
+ ```
107
+
108
+ The release lists the SHA-256 of the wheel and the sdist in `SHA256SUMS`. To
109
+ check manually downloaded files, keep their names and run
110
+ `sha256sum --ignore-missing -c SHA256SUMS` in the download directory. GitHub
111
+ also offers automatic "Source code" archives; the tar.gz one downloads under the
112
+ same name, `pietto-0.1.1.tar.gz`, but it is a snapshot of the repository, not
113
+ the sdist, and it is not listed in `SHA256SUMS`. This
114
+ preview was verified with CPython 3.12 and 3.13 on Linux x86-64; other
115
+ platforms and Python versions are not covered by this evidence. With Pietto
116
+ installed, run the commands below with `pietto-env/bin/pietto` (or activate the
117
+ environment) instead of `uv run pietto`.
118
+
119
+ ## Install from a checkout
120
+
121
+ Pietto requires Python 3.12 or later and uses a locked `uv` environment:
122
+
123
+ ```bash
124
+ uv sync --locked
125
+ uv run pietto --version
126
+ uv run pietto --help
127
+ ```
128
+
129
+ ### Optional Arrow interoperability
130
+
131
+ The core compiler and CLI need no PyArrow. The `pietto[arrow]` selector
132
+ selects exactly `pyarrow==25.0.1`; the execution extras
133
+ below add one database route's pinned drivers.
134
+ From this checkout, install it into a separate environment:
135
+
136
+ ```bash
137
+ uv venv /tmp/pietto-arrow
138
+ uv pip install --python /tmp/pietto-arrow/bin/python ".[arrow]"
139
+ ```
140
+
141
+ Or build and select the extra on that exact local wheel:
142
+
143
+ ```bash
144
+ uv build --wheel
145
+ uv pip install --python /tmp/pietto-arrow/bin/python "./dist/pietto-0.1.1-py3-none-any.whl[arrow]"
146
+ ```
147
+
148
+ For a core-only wheel install, omit `[arrow]` and use a fresh environment.
149
+ These are checkout/local-wheel instructions; from PyPI, install
150
+ `"pietto[arrow]"` as shown above.
151
+ Package and CLI version are **0.1.1**. The verified optional-extra matrix
152
+ is **CPython 3.12 and 3.13, Linux x86-64, PyArrow 25.0.1**; other platforms,
153
+ interpreters and Arrow versions are not covered by this evidence.
154
+ Phase67 result APIs remain private under `pietto._project`; installing the
155
+ extra only makes the dependency available. Public result APIs belong to
156
+ Phase69, and the extra does not enable database execution.
157
+ The [Phase67 audit and handoff](https://github.com/MianliWang/pietto/blob/v0.1.1/docs/phases/phase-67/completion-audit.md) records
158
+ the evidence layers, supported boundaries and remaining execution obligations.
159
+
160
+ ### Execution extras
161
+
162
+ Each private execution route has its own selector; each includes the Arrow pin
163
+ because captured results are Arrow IPC:
164
+
165
+ | Selector | Adds |
166
+ | --- | --- |
167
+ | `pietto[execute-postgres]` | `psycopg[binary]==3.3.5` (PostgreSQL rows) |
168
+ | `pietto[execute-mysql]` | `mysql-connector-python==26.7.0` (MySQL rows) |
169
+ | `pietto[execute-postgres-adbc]` | `adbc-driver-postgresql==1.12.0`, `adbc-driver-manager==1.12.0` (PostgreSQL ADBC) |
170
+
171
+ Saved-result use without any database driver needs only `pietto[arrow]`.
172
+ Selectors combine, for example
173
+ `"pietto[execute-postgres,execute-mysql]"`.
174
+ Installing an extra never selects a route, grants execution, opens a source or
175
+ qualifies storage. A selected route whose pinned driver is absent refuses with
176
+ `EXECUTION_DEPENDENCY_MISSING` before any connection, another version refuses
177
+ with that route's version error, and another route's installed driver is never
178
+ used instead. These extras were verified on CPython 3.13.13, Linux x86-64,
179
+ with the lock's exact artifacts; other platforms, interpreters and driver
180
+ versions are not covered. Execution APIs remain private under `pietto._project`.
181
+
182
+ ## Quick start
183
+
184
+ Create `active_users.pietto`:
185
+
186
+ ```pietto
187
+ shape User:
188
+ id: UUID not null
189
+ email: Text nullable
190
+ email_norm: Text nullable
191
+ deleted_at: Timestamp nullable
192
+
193
+ source users: User is postgres.table("users")
194
+
195
+ table active_users:
196
+ from users
197
+ where deleted_at is null
198
+ select:
199
+ id
200
+ email
201
+ email_norm = lower(trim(email))
202
+ ```
203
+
204
+ Check it:
205
+
206
+ ```bash
207
+ uv run pietto check active_users.pietto
208
+ uv run pietto check active_users.pietto --format json
209
+ ```
210
+
211
+ Explain its semantic metadata:
212
+
213
+ ```bash
214
+ uv run pietto explain active_users.pietto
215
+ uv run pietto explain active_users.pietto --format json
216
+ ```
217
+
218
+ Generate PostgreSQL SQL:
219
+
220
+ ```bash
221
+ uv run pietto emit-sql active_users.pietto --dialect postgres
222
+ ```
223
+
224
+ `check` does not generate or execute SQL. `emit-sql` writes SQL to stdout by
225
+ default and can atomically replace an explicitly selected regular output file.
226
+
227
+ ## Projects
228
+
229
+ Project commands use an explicit root containing `pietto.toml`:
230
+
231
+ ```text
232
+ demo-project/
233
+ ├── pietto.toml
234
+ └── models/
235
+ └── active_users.pietto
236
+ ```
237
+
238
+ For the available legacy-flat project mode:
239
+
240
+ ```toml
241
+ schema_version = 1
242
+
243
+ [sources]
244
+ include = ["models/*.pietto"]
245
+ ```
246
+
247
+ Then run:
248
+
249
+ ```bash
250
+ uv run pietto check --project demo-project
251
+ ```
252
+
253
+ Project input selection and diagnostics are deterministic. Project checking is
254
+ not SQL generation; project SQL emission is a separate explicit command.
255
+
256
+ ## Project SQL emission
257
+
258
+ `emit-sql --project` compiles one explicitly selected `table` or `query` of an
259
+ explicit-module project into the versioned `pietto.sql-emission.v1` artifact
260
+ for one explicitly selected dialect. The physical relation and column names,
261
+ storage types and value premises come from an emission contract you write for
262
+ your database; the compiler never connects to it.
263
+
264
+ ```text
265
+ demo-emit/
266
+ ├── pietto.toml
267
+ ├── main.pietto
268
+ └── contract.json
269
+ ```
270
+
271
+ `pietto.toml` selects the explicit-module project mode:
272
+
273
+ ```toml
274
+ schema_version = 2
275
+
276
+ [sources]
277
+ include = ["*.pietto"]
278
+ ```
279
+
280
+ `main.pietto`:
281
+
282
+ ```pietto
283
+ shape Item:
284
+ id: Int not null
285
+ label: Text not null
286
+
287
+ source items: Item is postgres.table("fixture.items")
288
+
289
+ table active_items:
290
+ from items
291
+ select:
292
+ id
293
+ label
294
+ ```
295
+
296
+ `contract.json` maps the logical source `items` to the physical relation
297
+ `fixture.items` and each field to its column and representation:
298
+
299
+ ```json
300
+ {
301
+ "format": "pietto.emission-contract.v1",
302
+ "target": {"family": "postgres", "release": "18.6"},
303
+ "sources": [{
304
+ "selector": {"module": "main.pietto", "kind": "source", "name": "items"},
305
+ "relation": {"namespace": "fixture", "name": "items"},
306
+ "scan": "relation_rows",
307
+ "fields": [
308
+ {"ordinal": 0, "name": "id", "column": "item_id",
309
+ "representation": {"storage": {"kind": "pg_int8"}, "nullable": false,
310
+ "domain": {"kind": "int_range", "min": "0", "max": "100"}}},
311
+ {"ordinal": 1, "name": "label", "column": "item_label",
312
+ "representation": {"storage": {"kind": "pg_text"}, "nullable": false,
313
+ "domain": {"kind": "text", "max_characters": 64,
314
+ "encoding": "UTF8", "collation": "C",
315
+ "padding": "NO PAD"}}}
316
+ ],
317
+ "premises": [
318
+ {"key": "row_domain_matches", "scope": "source", "value": true},
319
+ {"key": "read_only_object", "scope": "source", "value": true}
320
+ ]
321
+ }],
322
+ "environment": [
323
+ {"key": "client_encoding", "scope": "statement", "value": "UTF8"},
324
+ {"key": "operator_environment", "scope": "statement", "value": "builtin_only"}
325
+ ]
326
+ }
327
+ ```
328
+
329
+ Emit the artifact as JSON on stdout (`--format json` and
330
+ `--literal-policy preserve` are the defaults; the contract path is relative to
331
+ the project root):
332
+
333
+ ```bash
334
+ uv run pietto emit-sql --project demo-emit --module main.pietto --kind table \
335
+ --name active_items --dialect postgres --emission-contract contract.json
336
+ ```
337
+
338
+ Show the readable presentation on stdout and atomically write the same JSON
339
+ artifact to a file:
340
+
341
+ ```bash
342
+ uv run pietto emit-sql --project demo-emit --module main.pietto --kind table \
343
+ --name active_items --dialect postgres --emission-contract contract.json \
344
+ --format text --output active_items.sql-emission.json
345
+ ```
346
+
347
+ Exit codes are `0` for a VERIFIED artifact, `1` for BLOCKED (typed blockers or
348
+ project diagnostics) and `2` for INPUT_REJECTED (usage, project, contract or
349
+ output errors); failures carry no candidate SQL. A `--literal-policy bind-safe`
350
+ artifact must be consumed together with its `fixed_values` and
351
+ `parameter_uses`; its SQL alone is not a complete statement. The complete
352
+ contract is the
353
+ [Slice13 specification](https://github.com/MianliWang/pietto/blob/v0.1.1/docs/spec/phase66-slice13-project-emit-sql-cli-explicit-contract-atomic-output-v1.md).
354
+
355
+ ## Documentation
356
+
357
+ - [Language](https://github.com/MianliWang/pietto/blob/v0.1.1/docs/language.md)
358
+ - [Project and package](https://github.com/MianliWang/pietto/blob/v0.1.1/docs/project-package.md)
359
+ - [Development](https://github.com/MianliWang/pietto/blob/v0.1.1/docs/development.md)
360
+ - [Roadmap](https://github.com/MianliWang/pietto/blob/v0.1.1/docs/roadmap.md)
361
+ - [Status](https://github.com/MianliWang/pietto/blob/v0.1.1/docs/status.md)
362
+
363
+ Public contracts:
364
+
365
+ - [CLI JSON v1](https://github.com/MianliWang/pietto/blob/v0.1.1/docs/spec/cli-json-v1.md)
366
+ - [Diagnostics](https://github.com/MianliWang/pietto/blob/v0.1.1/docs/spec/diagnostics.md)
367
+ - [Project JSON v2](https://github.com/MianliWang/pietto/blob/v0.1.1/docs/spec/project-cli-json-v2.md)
368
+ - [Semantic metadata artifact v1](https://github.com/MianliWang/pietto/blob/v0.1.1/docs/spec/semantic-metadata-artifact-v1.md)
369
+ - [Configuration](https://github.com/MianliWang/pietto/blob/v0.1.1/docs/spec/pietto-config-v1.md)
370
+ - [Golden fixture policy](https://github.com/MianliWang/pietto/blob/v0.1.1/docs/spec/golden-fixture-policy-v1.md)
371
+
372
+ ## Development
373
+
374
+ Run the authoritative local validation suite with:
375
+
376
+ ```bash
377
+ uv run python scripts/validate.py
378
+ ```
379
+
380
+ The normal implementation loop is focused tests, Ruff, and targeted type
381
+ checking. Natural CI runs the final Python 3.12 and 3.13 validation coverage.
382
+
383
+ ## Direction
384
+
385
+ Pietto is an early preview. These are the goals it is working toward; they are
386
+ not promises or dates, and the detailed plan lives in the
387
+ [roadmap](https://github.com/MianliWang/pietto/blob/main/docs/roadmap.md).
388
+
389
+ - **Everyday SQL**: CASE, CAST, COALESCE/NULLIF, IN lists, NOT, LIKE, and common
390
+ string, number and date functions.
391
+ - **Real-world column types end to end**: timestamps, UUIDs, decimals, dates and
392
+ times, then arrays and nested records.
393
+ - **Richer queries**: subqueries and `WITH`, EXISTS/IN, VALUES and table functions.
394
+ - **Richer aggregation**: SUM and AVG in project SQL emission, FILTER,
395
+ statistical aggregates, grouping extensions and aggregates as window
396
+ functions.
397
+ - **Run queries safely from Python**: compile, execute through an explicit
398
+ database driver, and get typed Arrow results.
399
+ - **Data tools**: pandas, Polars and NumPy interoperability.
400
+ - **More databases**: deeper PostgreSQL and MySQL support, then SQLite and DuckDB.
401
+ - **Tooling**: a formatter, language-server and editor support, clearer diagnostics.
402
+ - **Stability**: a 1.0 release with frozen syntax, CLI and APIs.
403
+
404
+ ## License
405
+
406
+ Pietto is released under the
407
+ [MIT License](https://github.com/MianliWang/pietto/blob/v0.1.1/LICENSE).
408
+ Third-party material in the wheel, the sdist and the source archive is listed
409
+ in [THIRD_PARTY_NOTICES.md](https://github.com/MianliWang/pietto/blob/v0.1.1/THIRD_PARTY_NOTICES.md),
410
+ with the original license texts in
411
+ [LICENSES/](https://github.com/MianliWang/pietto/tree/v0.1.1/LICENSES).