code2schema 0.1.6__tar.gz → 0.1.8__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 (23) hide show
  1. {code2schema-0.1.6 → code2schema-0.1.8}/PKG-INFO +4 -6
  2. {code2schema-0.1.6 → code2schema-0.1.8}/README.md +3 -5
  3. {code2schema-0.1.6 → code2schema-0.1.8}/code2schema/__init__.py +1 -1
  4. {code2schema-0.1.6 → code2schema-0.1.8}/code2schema/analyzer/cqrs.py +1 -3
  5. {code2schema-0.1.6 → code2schema-0.1.8}/code2schema/analyzer/events.py +2 -8
  6. {code2schema-0.1.6 → code2schema-0.1.8}/code2schema/cli.py +3 -6
  7. {code2schema-0.1.6 → code2schema-0.1.8}/code2schema/core/extractor.py +3 -9
  8. {code2schema-0.1.6 → code2schema-0.1.8}/code2schema/core/models.py +1 -3
  9. {code2schema-0.1.6 → code2schema-0.1.8}/code2schema.egg-info/PKG-INFO +4 -6
  10. {code2schema-0.1.6 → code2schema-0.1.8}/pyproject.toml +1 -1
  11. {code2schema-0.1.6 → code2schema-0.1.8}/LICENSE +0 -0
  12. {code2schema-0.1.6 → code2schema-0.1.8}/code2schema/analyzer/__init__.py +0 -0
  13. {code2schema-0.1.6 → code2schema-0.1.8}/code2schema/analyzer/graph.py +0 -0
  14. {code2schema-0.1.6 → code2schema-0.1.8}/code2schema/codegen/__init__.py +0 -0
  15. {code2schema-0.1.6 → code2schema-0.1.8}/code2schema/codegen/visualizer.py +0 -0
  16. {code2schema-0.1.6 → code2schema-0.1.8}/code2schema/core/__init__.py +0 -0
  17. {code2schema-0.1.6 → code2schema-0.1.8}/code2schema.egg-info/SOURCES.txt +0 -0
  18. {code2schema-0.1.6 → code2schema-0.1.8}/code2schema.egg-info/dependency_links.txt +0 -0
  19. {code2schema-0.1.6 → code2schema-0.1.8}/code2schema.egg-info/entry_points.txt +0 -0
  20. {code2schema-0.1.6 → code2schema-0.1.8}/code2schema.egg-info/requires.txt +0 -0
  21. {code2schema-0.1.6 → code2schema-0.1.8}/code2schema.egg-info/top_level.txt +0 -0
  22. {code2schema-0.1.6 → code2schema-0.1.8}/setup.cfg +0 -0
  23. {code2schema-0.1.6 → code2schema-0.1.8}/tests/test_code2schema.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: code2schema
3
- Version: 0.1.6
3
+ Version: 0.1.8
4
4
  Summary: Semantic compiler: Code → AST → CQRS Model → Workflow DAG → Proto/Schema
5
5
  License: Apache-2.0
6
6
  Keywords: ast,cqrs,static-analysis,code-quality,schema
@@ -34,13 +34,11 @@ Dynamic: license-file
34
34
 
35
35
  ## AI Cost Tracking
36
36
 
37
- ![PyPI](https://img.shields.io/badge/pypi-costs-blue) ![Version](https://img.shields.io/badge/version-0.1.6-blue) ![Python](https://img.shields.io/badge/python-3.9+-blue) ![License](https://img.shields.io/badge/license-Apache--2.0-green)
38
- ![AI Cost](https://img.shields.io/badge/AI%20Cost-$0.60-orange) ![Human Time](https://img.shields.io/badge/Human%20Time-3.6h-blue) ![Model](https://img.shields.io/badge/Model-openrouter%2Fqwen%2Fqwen3--coder--next-lightgrey)
37
+ ![AI Cost](https://img.shields.io/badge/AI%20Cost-$1.05-green) ![AI Model](https://img.shields.io/badge/AI%20Model-openrouter%2Fqwen%2Fqwen3-coder-next-lightgrey)
39
38
 
40
- - 🤖 **LLM usage:** $0.6000 (4 commits)
41
- - 👤 **Human dev:** ~$361 (3.6h @ $100/h, 30min dedup)
39
+ This project uses AI-generated code. Total cost: **$1.0500** with **7** AI commits.
42
40
 
43
- Generated on 2026-05-07 using [openrouter/qwen/qwen3-coder-next](https://openrouter.ai/qwen/qwen3-coder-next)
41
+ Generated on 2026-06-29 using [openrouter/qwen/qwen3-coder-next](https://openrouter.ai/models/openrouter/qwen/qwen3-coder-next)
44
42
 
45
43
  ---
46
44
 
@@ -3,13 +3,11 @@
3
3
 
4
4
  ## AI Cost Tracking
5
5
 
6
- ![PyPI](https://img.shields.io/badge/pypi-costs-blue) ![Version](https://img.shields.io/badge/version-0.1.6-blue) ![Python](https://img.shields.io/badge/python-3.9+-blue) ![License](https://img.shields.io/badge/license-Apache--2.0-green)
7
- ![AI Cost](https://img.shields.io/badge/AI%20Cost-$0.60-orange) ![Human Time](https://img.shields.io/badge/Human%20Time-3.6h-blue) ![Model](https://img.shields.io/badge/Model-openrouter%2Fqwen%2Fqwen3--coder--next-lightgrey)
6
+ ![AI Cost](https://img.shields.io/badge/AI%20Cost-$1.05-green) ![AI Model](https://img.shields.io/badge/AI%20Model-openrouter%2Fqwen%2Fqwen3-coder-next-lightgrey)
8
7
 
9
- - 🤖 **LLM usage:** $0.6000 (4 commits)
10
- - 👤 **Human dev:** ~$361 (3.6h @ $100/h, 30min dedup)
8
+ This project uses AI-generated code. Total cost: **$1.0500** with **7** AI commits.
11
9
 
12
- Generated on 2026-05-07 using [openrouter/qwen/qwen3-coder-next](https://openrouter.ai/qwen/qwen3-coder-next)
10
+ Generated on 2026-06-29 using [openrouter/qwen/qwen3-coder-next](https://openrouter.ai/models/openrouter/qwen/qwen3-coder-next)
13
11
 
14
12
  ---
15
13
 
@@ -13,4 +13,4 @@ __all__ = [
13
13
  "extract_module",
14
14
  "analyze",
15
15
  ]
16
- __version__ = "0.1.6"
16
+ __version__ = "0.1.8"
@@ -92,9 +92,7 @@ def build_workflows(modules: List[ModuleIR]) -> List[WorkflowIR]:
92
92
  workflow = WorkflowIR(
93
93
  name=f"workflow_{f.name}",
94
94
  entry=f.qualified_name,
95
- steps=[
96
- WorkflowStep(callee=c, is_async=f.is_async) for c in f.calls
97
- ],
95
+ steps=[WorkflowStep(callee=c, is_async=f.is_async) for c in f.calls],
98
96
  )
99
97
  workflows.append(workflow)
100
98
  return workflows
@@ -62,9 +62,7 @@ class EventModel:
62
62
  lines.append("\nDomain Events:")
63
63
  for ev in self.events[:15]:
64
64
  handlers = ", ".join(ev.handled_by[:3]) or "—"
65
- lines.append(
66
- f" {ev.name:30s} ← {ev.emitted_by.split('.')[-1]:25s} → [{handlers}]"
67
- )
65
+ lines.append(f" {ev.name:30s} ← {ev.emitted_by.split('.')[-1]:25s} → [{handlers}]")
68
66
  if self.commands:
69
67
  lines.append("\nCommand Handlers (top 10):")
70
68
  for cmd in self.commands[:10]:
@@ -106,11 +104,7 @@ def _find_command_handlers(modules: List[ModuleIR]) -> List[CommandHandler]:
106
104
  for mod in modules:
107
105
  for f in mod.functions:
108
106
  if f.role == CQRSRole.COMMAND or _AGGREGATE_PATTERNS.search(f.name):
109
- emits = [
110
- _derive_event_name(c)
111
- for c in f.calls
112
- if _EVENT_EMIT_PATTERNS.search(c)
113
- ]
107
+ emits = [_derive_event_name(c) for c in f.calls if _EVENT_EMIT_PATTERNS.search(c)]
114
108
  if emits or f.role == CQRSRole.COMMAND:
115
109
  commands.append(
116
110
  CommandHandler(
@@ -91,9 +91,7 @@ def _build_parser() -> argparse.ArgumentParser:
91
91
  parser.add_argument("--no-rules", action="store_true")
92
92
  parser.add_argument("--exclude", nargs="*", default=[])
93
93
  parser.add_argument("-q", "--quiet", action="store_true")
94
- parser.add_argument(
95
- "-V", "--version", action="version", version=f"%(prog)s {__version__}"
96
- )
94
+ parser.add_argument("-V", "--version", action="version", version=f"%(prog)s {__version__}")
97
95
  return parser
98
96
 
99
97
 
@@ -209,7 +207,7 @@ def _print_summary(modules, schema, G, t0, out_path, proto_path, md_path, html_p
209
207
  if html_path:
210
208
  outputs.append(f" → {html_path.name}")
211
209
  print(
212
- f"\n✅ Gotowe ({time.perf_counter()-t0:.2f}s)\n"
210
+ f"\n✅ Gotowe ({time.perf_counter() - t0:.2f}s)\n"
213
211
  f" Modules : {len(modules)}\n"
214
212
  f" Functions: {len(funcs)}\n"
215
213
  f" Queries : {len(schema.queries())}\n"
@@ -217,8 +215,7 @@ def _print_summary(modules, schema, G, t0, out_path, proto_path, md_path, html_p
217
215
  f" Orchest. : {len(schema.orchestrators())}\n"
218
216
  f" Workflows: {len(schema.workflows)}\n"
219
217
  f" Rules : {len(schema.rules)}\n"
220
- f" Graph : {G.number_of_nodes()}N / {G.number_of_edges()}E\n"
221
- + "\n".join(outputs)
218
+ f" Graph : {G.number_of_nodes()}N / {G.number_of_edges()}E\n" + "\n".join(outputs)
222
219
  )
223
220
 
224
221
 
@@ -87,9 +87,7 @@ class _FunctionVisitor(ast.NodeVisitor):
87
87
  self._process_func(node, is_async=True)
88
88
  self.generic_visit(node)
89
89
 
90
- def _process_func(
91
- self, node: ast.FunctionDef | ast.AsyncFunctionDef, is_async: bool
92
- ) -> None:
90
+ def _process_func(self, node: ast.FunctionDef | ast.AsyncFunctionDef, is_async: bool) -> None:
93
91
  calls = self._collect_calls(node)
94
92
  side_effects = self._detect_side_effects(node, calls)
95
93
  docstring = ast.get_docstring(node)
@@ -100,9 +98,7 @@ class _FunctionVisitor(ast.NodeVisitor):
100
98
  calls=list(dict.fromkeys(calls)), # deduplicate, preserve order
101
99
  fan_out=len(set(calls)),
102
100
  side_effects=side_effects,
103
- lines=(
104
- node.end_lineno - node.lineno + 1 if hasattr(node, "end_lineno") else 0
105
- ),
101
+ lines=(node.end_lineno - node.lineno + 1 if hasattr(node, "end_lineno") else 0),
106
102
  is_async=is_async,
107
103
  docstring=docstring,
108
104
  )
@@ -162,9 +158,7 @@ def extract_module(path: Path) -> ModuleIR | None:
162
158
  imports = [
163
159
  alias.name
164
160
  for node in ast.walk(tree)
165
- for alias in (
166
- node.names if isinstance(node, (ast.Import, ast.ImportFrom)) else []
167
- )
161
+ for alias in (node.names if isinstance(node, (ast.Import, ast.ImportFrom)) else [])
168
162
  ]
169
163
 
170
164
  return ModuleIR(
@@ -81,9 +81,7 @@ class RuleIR(BaseModel):
81
81
  class SchemaIR(BaseModel):
82
82
  """Korzeń modelu semantycznego całego projektu."""
83
83
 
84
- system: dict = Field(
85
- default_factory=lambda: {"type": "code2schema", "version": "0.1"}
86
- )
84
+ system: dict = Field(default_factory=lambda: {"type": "code2schema", "version": "0.1"})
87
85
  modules: List[ModuleIR] = Field(default_factory=list)
88
86
  workflows: List[WorkflowIR] = Field(default_factory=list)
89
87
  rules: List[RuleIR] = Field(default_factory=list)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: code2schema
3
- Version: 0.1.6
3
+ Version: 0.1.8
4
4
  Summary: Semantic compiler: Code → AST → CQRS Model → Workflow DAG → Proto/Schema
5
5
  License: Apache-2.0
6
6
  Keywords: ast,cqrs,static-analysis,code-quality,schema
@@ -34,13 +34,11 @@ Dynamic: license-file
34
34
 
35
35
  ## AI Cost Tracking
36
36
 
37
- ![PyPI](https://img.shields.io/badge/pypi-costs-blue) ![Version](https://img.shields.io/badge/version-0.1.6-blue) ![Python](https://img.shields.io/badge/python-3.9+-blue) ![License](https://img.shields.io/badge/license-Apache--2.0-green)
38
- ![AI Cost](https://img.shields.io/badge/AI%20Cost-$0.60-orange) ![Human Time](https://img.shields.io/badge/Human%20Time-3.6h-blue) ![Model](https://img.shields.io/badge/Model-openrouter%2Fqwen%2Fqwen3--coder--next-lightgrey)
37
+ ![AI Cost](https://img.shields.io/badge/AI%20Cost-$1.05-green) ![AI Model](https://img.shields.io/badge/AI%20Model-openrouter%2Fqwen%2Fqwen3-coder-next-lightgrey)
39
38
 
40
- - 🤖 **LLM usage:** $0.6000 (4 commits)
41
- - 👤 **Human dev:** ~$361 (3.6h @ $100/h, 30min dedup)
39
+ This project uses AI-generated code. Total cost: **$1.0500** with **7** AI commits.
42
40
 
43
- Generated on 2026-05-07 using [openrouter/qwen/qwen3-coder-next](https://openrouter.ai/qwen/qwen3-coder-next)
41
+ Generated on 2026-06-29 using [openrouter/qwen/qwen3-coder-next](https://openrouter.ai/models/openrouter/qwen/qwen3-coder-next)
44
42
 
45
43
  ---
46
44
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "code2schema"
7
- version = "0.1.6"
7
+ version = "0.1.8"
8
8
  description = "Semantic compiler: Code → AST → CQRS Model → Workflow DAG → Proto/Schema"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
File without changes
File without changes