archapi 0.3.1__tar.gz → 0.3.2__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 (41) hide show
  1. archapi-0.3.2/PKG-INFO +251 -0
  2. archapi-0.3.2/README.md +227 -0
  3. archapi-0.3.2/archapi.egg-info/PKG-INFO +251 -0
  4. {archapi-0.3.1 → archapi-0.3.2}/pyproject.toml +3 -3
  5. archapi-0.3.1/PKG-INFO +0 -79
  6. archapi-0.3.1/README.md +0 -56
  7. archapi-0.3.1/archapi.egg-info/PKG-INFO +0 -79
  8. {archapi-0.3.1 → archapi-0.3.2}/LICENSE +0 -0
  9. {archapi-0.3.1 → archapi-0.3.2}/archapi/__init__.py +0 -0
  10. {archapi-0.3.1 → archapi-0.3.2}/archapi/core.py +0 -0
  11. {archapi-0.3.1 → archapi-0.3.2}/archapi/frameworks/__init__.py +0 -0
  12. {archapi-0.3.1 → archapi-0.3.2}/archapi/frameworks/base.py +0 -0
  13. {archapi-0.3.1 → archapi-0.3.2}/archapi/frameworks/detector.py +0 -0
  14. {archapi-0.3.1 → archapi-0.3.2}/archapi/frameworks/express_ts/__init__.py +0 -0
  15. {archapi-0.3.1 → archapi-0.3.2}/archapi/frameworks/express_ts/adapter.py +0 -0
  16. {archapi-0.3.1 → archapi-0.3.2}/archapi/frameworks/fastapi_adapter.py +0 -0
  17. {archapi-0.3.1 → archapi-0.3.2}/archapi/frameworks/generic.py +0 -0
  18. {archapi-0.3.1 → archapi-0.3.2}/archapi/frameworks/registry.py +0 -0
  19. {archapi-0.3.1 → archapi-0.3.2}/archapi/generation/__init__.py +0 -0
  20. {archapi-0.3.1 → archapi-0.3.2}/archapi/genome/__init__.py +0 -0
  21. {archapi-0.3.1 → archapi-0.3.2}/archapi/indexing/__init__.py +0 -0
  22. {archapi-0.3.1 → archapi-0.3.2}/archapi/indexing/cache.py +0 -0
  23. {archapi-0.3.1 → archapi-0.3.2}/archapi/mapping/__init__.py +0 -0
  24. {archapi-0.3.1 → archapi-0.3.2}/archapi/planning/__init__.py +0 -0
  25. {archapi-0.3.1 → archapi-0.3.2}/archapi/planning/intent_planner.py +0 -0
  26. {archapi-0.3.1 → archapi-0.3.2}/archapi/planning/task_dag.py +0 -0
  27. {archapi-0.3.1 → archapi-0.3.2}/archapi/scanner/__init__.py +0 -0
  28. {archapi-0.3.1 → archapi-0.3.2}/archapi/security/__init__.py +0 -0
  29. {archapi-0.3.1 → archapi-0.3.2}/archapi/security/context_redactor.py +0 -0
  30. {archapi-0.3.1 → archapi-0.3.2}/archapi/security/policy_gate.py +0 -0
  31. {archapi-0.3.1 → archapi-0.3.2}/archapi/security/secret_scanner.py +0 -0
  32. {archapi-0.3.1 → archapi-0.3.2}/archapi/types.py +0 -0
  33. {archapi-0.3.1 → archapi-0.3.2}/archapi/validation/__init__.py +0 -0
  34. {archapi-0.3.1 → archapi-0.3.2}/archapi/validation/architecture_score.py +0 -0
  35. {archapi-0.3.1 → archapi-0.3.2}/archapi/validation/basic_validators.py +0 -0
  36. {archapi-0.3.1 → archapi-0.3.2}/archapi/validation/command_validator.py +0 -0
  37. {archapi-0.3.1 → archapi-0.3.2}/archapi.egg-info/SOURCES.txt +0 -0
  38. {archapi-0.3.1 → archapi-0.3.2}/archapi.egg-info/dependency_links.txt +0 -0
  39. {archapi-0.3.1 → archapi-0.3.2}/archapi.egg-info/top_level.txt +0 -0
  40. {archapi-0.3.1 → archapi-0.3.2}/setup.cfg +0 -0
  41. {archapi-0.3.1 → archapi-0.3.2}/tests/test_archapi_suite.py +0 -0
archapi-0.3.2/PKG-INFO ADDED
@@ -0,0 +1,251 @@
1
+ Metadata-Version: 2.4
2
+ Name: archapi
3
+ Version: 0.3.2
4
+ Summary: Architecture-preserving REST API synthesis library
5
+ Author: Rohith Chikkala
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/rohith5005/archapi
8
+ Project-URL: Repository, https://github.com/rohith5005/archapi
9
+ Project-URL: Issues, https://github.com/rohith5005/archapi/issues
10
+ Project-URL: PyPI, https://pypi.org/project/archapi/
11
+ Keywords: rest-api,code-generation,architecture,express,fastapi
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Software Development :: Code Generators
20
+ Requires-Python: >=3.9
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Dynamic: license-file
24
+
25
+ # ArchAPI
26
+
27
+ ArchAPI is a Python library for architecture-preserving REST API generation.
28
+
29
+ It scans an existing backend project, detects the framework, understands the project structure, plans a REST API, generates framework-specific files, validates the output, and writes files only when explicitly requested.
30
+
31
+ ## Current Status
32
+
33
+ Current checkpoint: **0.3.1**
34
+
35
+ ArchAPI currently supports:
36
+
37
+ - Express TypeScript
38
+ - FastAPI
39
+ - Generic fallback detection for unsupported projects
40
+
41
+ Core features:
42
+
43
+ - Framework detection
44
+ - Project scanning
45
+ - API architecture modeling
46
+ - Confidence scoring
47
+ - Low-confidence blocking
48
+ - Strict config mode
49
+ - REST intent planning
50
+ - Dry-run code generation
51
+ - Safe apply behavior
52
+ - Overwrite protection
53
+ - Cache and changed-file detection
54
+ - Secret scanning helpers
55
+ - Context redaction
56
+ - Policy gate
57
+ - Architecture consistency scoring
58
+ - Unified regression test suite
59
+
60
+ ## Installation from PyPI
61
+
62
+ ```bash
63
+ python -m pip install archapi
64
+ ```
65
+
66
+ Verify:
67
+
68
+ ```bash
69
+ python -c "from archapi import ArchAPI; print('ArchAPI import works')"
70
+ ```
71
+
72
+ ## Run from GitHub Source
73
+
74
+ ```bash
75
+ git clone https://github.com/rohith5005/archapi.git
76
+ cd archapi
77
+
78
+ python3 -m venv .venv
79
+ source .venv/bin/activate
80
+
81
+ python -m pip install --upgrade pip setuptools wheel
82
+ python -m pip install -e .
83
+ ```
84
+
85
+ Verify:
86
+
87
+ ```bash
88
+ python -c "from archapi import ArchAPI; print('GitHub source install worked')"
89
+ ```
90
+
91
+ ## Run Tests
92
+
93
+ ```bash
94
+ python -m compileall archapi
95
+ python -m unittest tests.test_archapi_suite -v
96
+ ```
97
+
98
+ Or:
99
+
100
+ ```bash
101
+ ./scripts/run_tests.sh
102
+ ```
103
+
104
+ Expected result:
105
+
106
+ ```text
107
+ Ran 7 tests
108
+
109
+ OK
110
+ ```
111
+
112
+ ## Basic Usage
113
+
114
+ ```python
115
+ from archapi import ArchAPI
116
+
117
+ engine = ArchAPI("./sample_projects/express_basic")
118
+
119
+ result = engine.generate_api(
120
+ "Create GET API for user order history",
121
+ dry_run=True,
122
+ )
123
+
124
+ print(result.plan)
125
+ print(result.validation_report)
126
+ print(result.diff)
127
+ ```
128
+
129
+ ## Express TypeScript Example
130
+
131
+ ```python
132
+ from pathlib import Path
133
+ from archapi import ArchAPI
134
+
135
+ project = Path("express_basic")
136
+
137
+ (project / "src/routes").mkdir(parents=True, exist_ok=True)
138
+ (project / "src/controllers").mkdir(parents=True, exist_ok=True)
139
+ (project / "src/services").mkdir(parents=True, exist_ok=True)
140
+ (project / "src/schemas").mkdir(parents=True, exist_ok=True)
141
+ (project / "tests").mkdir(parents=True, exist_ok=True)
142
+
143
+ (project / "package.json").write_text(
144
+ '{"dependencies": {"express": "^4.18.0", "zod": "^3.0.0"}}'
145
+ )
146
+
147
+ (project / "src/routes/user.routes.ts").write_text(
148
+ 'import { Router } from "express";\n'
149
+ 'const router = Router();\n'
150
+ 'export default router;\n'
151
+ )
152
+
153
+ (project / "src/controllers/user.controller.ts").write_text(
154
+ 'export const userController = {};\n'
155
+ )
156
+
157
+ (project / "src/services/user.service.ts").write_text(
158
+ 'export const userService = {};\n'
159
+ )
160
+
161
+ (project / "src/schemas/user.schema.ts").write_text(
162
+ 'import { z } from "zod";\n'
163
+ )
164
+
165
+ (project / "tests/user.test.ts").write_text(
166
+ 'describe("user", () => { it("works", () => expect(true).toBe(true)); });\n'
167
+ )
168
+
169
+ engine = ArchAPI(str(project))
170
+ result = engine.generate_api("Create GET API for user order history", dry_run=True)
171
+
172
+ print("Detected framework:", engine.detect_framework().framework)
173
+ print("Generated method:", result.plan.method)
174
+ print("Generated path:", result.plan.path)
175
+ print("Generated files:", [str(file.path) for file in result.files])
176
+ ```
177
+
178
+ Expected output includes:
179
+
180
+ ```text
181
+ Detected framework: express-typescript
182
+ Generated method: GET
183
+ Generated path: /users/{user_id}/orders
184
+ ```
185
+
186
+ ## FastAPI Example
187
+
188
+ ```python
189
+ from pathlib import Path
190
+ from archapi import ArchAPI
191
+
192
+ project = Path("fastapi_basic")
193
+
194
+ (project / "app/routers").mkdir(parents=True, exist_ok=True)
195
+ (project / "app/services").mkdir(parents=True, exist_ok=True)
196
+ (project / "app/schemas").mkdir(parents=True, exist_ok=True)
197
+ (project / "tests").mkdir(parents=True, exist_ok=True)
198
+
199
+ (project / "requirements.txt").write_text("fastapi\npydantic\npytest\n")
200
+
201
+ (project / "app/routers/user_router.py").write_text(
202
+ "from fastapi import APIRouter\n"
203
+ "router = APIRouter()\n"
204
+ )
205
+
206
+ (project / "app/services/user_service.py").write_text(
207
+ "class UserService:\n"
208
+ " pass\n\n"
209
+ "user_service = UserService()\n"
210
+ )
211
+
212
+ (project / "app/schemas/user_schema.py").write_text(
213
+ "from pydantic import BaseModel\n\n"
214
+ "class UserResponse(BaseModel):\n"
215
+ " id: str\n"
216
+ )
217
+
218
+ (project / "tests/test_user.py").write_text(
219
+ "def test_user_placeholder():\n"
220
+ " assert True\n"
221
+ )
222
+
223
+ engine = ArchAPI(str(project))
224
+ result = engine.generate_api("Create POST API for product review", dry_run=True)
225
+
226
+ print("Detected framework:", engine.detect_framework().framework)
227
+ print("Generated method:", result.plan.method)
228
+ print("Generated path:", result.plan.path)
229
+ print("Generated files:", [str(file.path) for file in result.files])
230
+ ```
231
+
232
+ Expected output includes:
233
+
234
+ ```text
235
+ Detected framework: fastapi
236
+ Generated method: POST
237
+ Generated path: /products/{product_id}/reviews
238
+ ```
239
+
240
+ ## Documentation
241
+
242
+ - [How to Run](docs/HOW_TO_RUN.md)
243
+ - [Architecture](docs/ARCHITECTURE.md)
244
+ - [File Guide](docs/FILE_GUIDE.md)
245
+ - [Security Measures](docs/SECURITY_MEASURES.md)
246
+ - [Development Status](docs/DEVELOPMENT_STATUS.md)
247
+
248
+ ## Links
249
+
250
+ - GitHub: https://github.com/rohith5005/archapi
251
+ - PyPI: https://pypi.org/project/archapi/
@@ -0,0 +1,227 @@
1
+ # ArchAPI
2
+
3
+ ArchAPI is a Python library for architecture-preserving REST API generation.
4
+
5
+ It scans an existing backend project, detects the framework, understands the project structure, plans a REST API, generates framework-specific files, validates the output, and writes files only when explicitly requested.
6
+
7
+ ## Current Status
8
+
9
+ Current checkpoint: **0.3.1**
10
+
11
+ ArchAPI currently supports:
12
+
13
+ - Express TypeScript
14
+ - FastAPI
15
+ - Generic fallback detection for unsupported projects
16
+
17
+ Core features:
18
+
19
+ - Framework detection
20
+ - Project scanning
21
+ - API architecture modeling
22
+ - Confidence scoring
23
+ - Low-confidence blocking
24
+ - Strict config mode
25
+ - REST intent planning
26
+ - Dry-run code generation
27
+ - Safe apply behavior
28
+ - Overwrite protection
29
+ - Cache and changed-file detection
30
+ - Secret scanning helpers
31
+ - Context redaction
32
+ - Policy gate
33
+ - Architecture consistency scoring
34
+ - Unified regression test suite
35
+
36
+ ## Installation from PyPI
37
+
38
+ ```bash
39
+ python -m pip install archapi
40
+ ```
41
+
42
+ Verify:
43
+
44
+ ```bash
45
+ python -c "from archapi import ArchAPI; print('ArchAPI import works')"
46
+ ```
47
+
48
+ ## Run from GitHub Source
49
+
50
+ ```bash
51
+ git clone https://github.com/rohith5005/archapi.git
52
+ cd archapi
53
+
54
+ python3 -m venv .venv
55
+ source .venv/bin/activate
56
+
57
+ python -m pip install --upgrade pip setuptools wheel
58
+ python -m pip install -e .
59
+ ```
60
+
61
+ Verify:
62
+
63
+ ```bash
64
+ python -c "from archapi import ArchAPI; print('GitHub source install worked')"
65
+ ```
66
+
67
+ ## Run Tests
68
+
69
+ ```bash
70
+ python -m compileall archapi
71
+ python -m unittest tests.test_archapi_suite -v
72
+ ```
73
+
74
+ Or:
75
+
76
+ ```bash
77
+ ./scripts/run_tests.sh
78
+ ```
79
+
80
+ Expected result:
81
+
82
+ ```text
83
+ Ran 7 tests
84
+
85
+ OK
86
+ ```
87
+
88
+ ## Basic Usage
89
+
90
+ ```python
91
+ from archapi import ArchAPI
92
+
93
+ engine = ArchAPI("./sample_projects/express_basic")
94
+
95
+ result = engine.generate_api(
96
+ "Create GET API for user order history",
97
+ dry_run=True,
98
+ )
99
+
100
+ print(result.plan)
101
+ print(result.validation_report)
102
+ print(result.diff)
103
+ ```
104
+
105
+ ## Express TypeScript Example
106
+
107
+ ```python
108
+ from pathlib import Path
109
+ from archapi import ArchAPI
110
+
111
+ project = Path("express_basic")
112
+
113
+ (project / "src/routes").mkdir(parents=True, exist_ok=True)
114
+ (project / "src/controllers").mkdir(parents=True, exist_ok=True)
115
+ (project / "src/services").mkdir(parents=True, exist_ok=True)
116
+ (project / "src/schemas").mkdir(parents=True, exist_ok=True)
117
+ (project / "tests").mkdir(parents=True, exist_ok=True)
118
+
119
+ (project / "package.json").write_text(
120
+ '{"dependencies": {"express": "^4.18.0", "zod": "^3.0.0"}}'
121
+ )
122
+
123
+ (project / "src/routes/user.routes.ts").write_text(
124
+ 'import { Router } from "express";\n'
125
+ 'const router = Router();\n'
126
+ 'export default router;\n'
127
+ )
128
+
129
+ (project / "src/controllers/user.controller.ts").write_text(
130
+ 'export const userController = {};\n'
131
+ )
132
+
133
+ (project / "src/services/user.service.ts").write_text(
134
+ 'export const userService = {};\n'
135
+ )
136
+
137
+ (project / "src/schemas/user.schema.ts").write_text(
138
+ 'import { z } from "zod";\n'
139
+ )
140
+
141
+ (project / "tests/user.test.ts").write_text(
142
+ 'describe("user", () => { it("works", () => expect(true).toBe(true)); });\n'
143
+ )
144
+
145
+ engine = ArchAPI(str(project))
146
+ result = engine.generate_api("Create GET API for user order history", dry_run=True)
147
+
148
+ print("Detected framework:", engine.detect_framework().framework)
149
+ print("Generated method:", result.plan.method)
150
+ print("Generated path:", result.plan.path)
151
+ print("Generated files:", [str(file.path) for file in result.files])
152
+ ```
153
+
154
+ Expected output includes:
155
+
156
+ ```text
157
+ Detected framework: express-typescript
158
+ Generated method: GET
159
+ Generated path: /users/{user_id}/orders
160
+ ```
161
+
162
+ ## FastAPI Example
163
+
164
+ ```python
165
+ from pathlib import Path
166
+ from archapi import ArchAPI
167
+
168
+ project = Path("fastapi_basic")
169
+
170
+ (project / "app/routers").mkdir(parents=True, exist_ok=True)
171
+ (project / "app/services").mkdir(parents=True, exist_ok=True)
172
+ (project / "app/schemas").mkdir(parents=True, exist_ok=True)
173
+ (project / "tests").mkdir(parents=True, exist_ok=True)
174
+
175
+ (project / "requirements.txt").write_text("fastapi\npydantic\npytest\n")
176
+
177
+ (project / "app/routers/user_router.py").write_text(
178
+ "from fastapi import APIRouter\n"
179
+ "router = APIRouter()\n"
180
+ )
181
+
182
+ (project / "app/services/user_service.py").write_text(
183
+ "class UserService:\n"
184
+ " pass\n\n"
185
+ "user_service = UserService()\n"
186
+ )
187
+
188
+ (project / "app/schemas/user_schema.py").write_text(
189
+ "from pydantic import BaseModel\n\n"
190
+ "class UserResponse(BaseModel):\n"
191
+ " id: str\n"
192
+ )
193
+
194
+ (project / "tests/test_user.py").write_text(
195
+ "def test_user_placeholder():\n"
196
+ " assert True\n"
197
+ )
198
+
199
+ engine = ArchAPI(str(project))
200
+ result = engine.generate_api("Create POST API for product review", dry_run=True)
201
+
202
+ print("Detected framework:", engine.detect_framework().framework)
203
+ print("Generated method:", result.plan.method)
204
+ print("Generated path:", result.plan.path)
205
+ print("Generated files:", [str(file.path) for file in result.files])
206
+ ```
207
+
208
+ Expected output includes:
209
+
210
+ ```text
211
+ Detected framework: fastapi
212
+ Generated method: POST
213
+ Generated path: /products/{product_id}/reviews
214
+ ```
215
+
216
+ ## Documentation
217
+
218
+ - [How to Run](docs/HOW_TO_RUN.md)
219
+ - [Architecture](docs/ARCHITECTURE.md)
220
+ - [File Guide](docs/FILE_GUIDE.md)
221
+ - [Security Measures](docs/SECURITY_MEASURES.md)
222
+ - [Development Status](docs/DEVELOPMENT_STATUS.md)
223
+
224
+ ## Links
225
+
226
+ - GitHub: https://github.com/rohith5005/archapi
227
+ - PyPI: https://pypi.org/project/archapi/
@@ -0,0 +1,251 @@
1
+ Metadata-Version: 2.4
2
+ Name: archapi
3
+ Version: 0.3.2
4
+ Summary: Architecture-preserving REST API synthesis library
5
+ Author: Rohith Chikkala
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/rohith5005/archapi
8
+ Project-URL: Repository, https://github.com/rohith5005/archapi
9
+ Project-URL: Issues, https://github.com/rohith5005/archapi/issues
10
+ Project-URL: PyPI, https://pypi.org/project/archapi/
11
+ Keywords: rest-api,code-generation,architecture,express,fastapi
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Software Development :: Code Generators
20
+ Requires-Python: >=3.9
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Dynamic: license-file
24
+
25
+ # ArchAPI
26
+
27
+ ArchAPI is a Python library for architecture-preserving REST API generation.
28
+
29
+ It scans an existing backend project, detects the framework, understands the project structure, plans a REST API, generates framework-specific files, validates the output, and writes files only when explicitly requested.
30
+
31
+ ## Current Status
32
+
33
+ Current checkpoint: **0.3.1**
34
+
35
+ ArchAPI currently supports:
36
+
37
+ - Express TypeScript
38
+ - FastAPI
39
+ - Generic fallback detection for unsupported projects
40
+
41
+ Core features:
42
+
43
+ - Framework detection
44
+ - Project scanning
45
+ - API architecture modeling
46
+ - Confidence scoring
47
+ - Low-confidence blocking
48
+ - Strict config mode
49
+ - REST intent planning
50
+ - Dry-run code generation
51
+ - Safe apply behavior
52
+ - Overwrite protection
53
+ - Cache and changed-file detection
54
+ - Secret scanning helpers
55
+ - Context redaction
56
+ - Policy gate
57
+ - Architecture consistency scoring
58
+ - Unified regression test suite
59
+
60
+ ## Installation from PyPI
61
+
62
+ ```bash
63
+ python -m pip install archapi
64
+ ```
65
+
66
+ Verify:
67
+
68
+ ```bash
69
+ python -c "from archapi import ArchAPI; print('ArchAPI import works')"
70
+ ```
71
+
72
+ ## Run from GitHub Source
73
+
74
+ ```bash
75
+ git clone https://github.com/rohith5005/archapi.git
76
+ cd archapi
77
+
78
+ python3 -m venv .venv
79
+ source .venv/bin/activate
80
+
81
+ python -m pip install --upgrade pip setuptools wheel
82
+ python -m pip install -e .
83
+ ```
84
+
85
+ Verify:
86
+
87
+ ```bash
88
+ python -c "from archapi import ArchAPI; print('GitHub source install worked')"
89
+ ```
90
+
91
+ ## Run Tests
92
+
93
+ ```bash
94
+ python -m compileall archapi
95
+ python -m unittest tests.test_archapi_suite -v
96
+ ```
97
+
98
+ Or:
99
+
100
+ ```bash
101
+ ./scripts/run_tests.sh
102
+ ```
103
+
104
+ Expected result:
105
+
106
+ ```text
107
+ Ran 7 tests
108
+
109
+ OK
110
+ ```
111
+
112
+ ## Basic Usage
113
+
114
+ ```python
115
+ from archapi import ArchAPI
116
+
117
+ engine = ArchAPI("./sample_projects/express_basic")
118
+
119
+ result = engine.generate_api(
120
+ "Create GET API for user order history",
121
+ dry_run=True,
122
+ )
123
+
124
+ print(result.plan)
125
+ print(result.validation_report)
126
+ print(result.diff)
127
+ ```
128
+
129
+ ## Express TypeScript Example
130
+
131
+ ```python
132
+ from pathlib import Path
133
+ from archapi import ArchAPI
134
+
135
+ project = Path("express_basic")
136
+
137
+ (project / "src/routes").mkdir(parents=True, exist_ok=True)
138
+ (project / "src/controllers").mkdir(parents=True, exist_ok=True)
139
+ (project / "src/services").mkdir(parents=True, exist_ok=True)
140
+ (project / "src/schemas").mkdir(parents=True, exist_ok=True)
141
+ (project / "tests").mkdir(parents=True, exist_ok=True)
142
+
143
+ (project / "package.json").write_text(
144
+ '{"dependencies": {"express": "^4.18.0", "zod": "^3.0.0"}}'
145
+ )
146
+
147
+ (project / "src/routes/user.routes.ts").write_text(
148
+ 'import { Router } from "express";\n'
149
+ 'const router = Router();\n'
150
+ 'export default router;\n'
151
+ )
152
+
153
+ (project / "src/controllers/user.controller.ts").write_text(
154
+ 'export const userController = {};\n'
155
+ )
156
+
157
+ (project / "src/services/user.service.ts").write_text(
158
+ 'export const userService = {};\n'
159
+ )
160
+
161
+ (project / "src/schemas/user.schema.ts").write_text(
162
+ 'import { z } from "zod";\n'
163
+ )
164
+
165
+ (project / "tests/user.test.ts").write_text(
166
+ 'describe("user", () => { it("works", () => expect(true).toBe(true)); });\n'
167
+ )
168
+
169
+ engine = ArchAPI(str(project))
170
+ result = engine.generate_api("Create GET API for user order history", dry_run=True)
171
+
172
+ print("Detected framework:", engine.detect_framework().framework)
173
+ print("Generated method:", result.plan.method)
174
+ print("Generated path:", result.plan.path)
175
+ print("Generated files:", [str(file.path) for file in result.files])
176
+ ```
177
+
178
+ Expected output includes:
179
+
180
+ ```text
181
+ Detected framework: express-typescript
182
+ Generated method: GET
183
+ Generated path: /users/{user_id}/orders
184
+ ```
185
+
186
+ ## FastAPI Example
187
+
188
+ ```python
189
+ from pathlib import Path
190
+ from archapi import ArchAPI
191
+
192
+ project = Path("fastapi_basic")
193
+
194
+ (project / "app/routers").mkdir(parents=True, exist_ok=True)
195
+ (project / "app/services").mkdir(parents=True, exist_ok=True)
196
+ (project / "app/schemas").mkdir(parents=True, exist_ok=True)
197
+ (project / "tests").mkdir(parents=True, exist_ok=True)
198
+
199
+ (project / "requirements.txt").write_text("fastapi\npydantic\npytest\n")
200
+
201
+ (project / "app/routers/user_router.py").write_text(
202
+ "from fastapi import APIRouter\n"
203
+ "router = APIRouter()\n"
204
+ )
205
+
206
+ (project / "app/services/user_service.py").write_text(
207
+ "class UserService:\n"
208
+ " pass\n\n"
209
+ "user_service = UserService()\n"
210
+ )
211
+
212
+ (project / "app/schemas/user_schema.py").write_text(
213
+ "from pydantic import BaseModel\n\n"
214
+ "class UserResponse(BaseModel):\n"
215
+ " id: str\n"
216
+ )
217
+
218
+ (project / "tests/test_user.py").write_text(
219
+ "def test_user_placeholder():\n"
220
+ " assert True\n"
221
+ )
222
+
223
+ engine = ArchAPI(str(project))
224
+ result = engine.generate_api("Create POST API for product review", dry_run=True)
225
+
226
+ print("Detected framework:", engine.detect_framework().framework)
227
+ print("Generated method:", result.plan.method)
228
+ print("Generated path:", result.plan.path)
229
+ print("Generated files:", [str(file.path) for file in result.files])
230
+ ```
231
+
232
+ Expected output includes:
233
+
234
+ ```text
235
+ Detected framework: fastapi
236
+ Generated method: POST
237
+ Generated path: /products/{product_id}/reviews
238
+ ```
239
+
240
+ ## Documentation
241
+
242
+ - [How to Run](docs/HOW_TO_RUN.md)
243
+ - [Architecture](docs/ARCHITECTURE.md)
244
+ - [File Guide](docs/FILE_GUIDE.md)
245
+ - [Security Measures](docs/SECURITY_MEASURES.md)
246
+ - [Development Status](docs/DEVELOPMENT_STATUS.md)
247
+
248
+ ## Links
249
+
250
+ - GitHub: https://github.com/rohith5005/archapi
251
+ - PyPI: https://pypi.org/project/archapi/
@@ -4,16 +4,15 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "archapi"
7
- version = "0.3.1"
7
+ version = "0.3.2"
8
8
  description = "Architecture-preserving REST API synthesis library"
9
9
  readme = "README.md"
10
10
  license = "MIT"
11
11
  requires-python = ">=3.9"
12
12
  authors = [
13
- { name = "ArchAPI Research Team" }
13
+ { name = "Rohith Chikkala" }
14
14
  ]
15
15
  dependencies = []
16
-
17
16
  keywords = ["rest-api", "code-generation", "architecture", "express", "fastapi"]
18
17
 
19
18
  classifiers = [
@@ -31,6 +30,7 @@ classifiers = [
31
30
  Homepage = "https://github.com/rohith5005/archapi"
32
31
  Repository = "https://github.com/rohith5005/archapi"
33
32
  Issues = "https://github.com/rohith5005/archapi/issues"
33
+ PyPI = "https://pypi.org/project/archapi/"
34
34
 
35
35
  [tool.setuptools.packages.find]
36
36
  include = ["archapi*"]
archapi-0.3.1/PKG-INFO DELETED
@@ -1,79 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: archapi
3
- Version: 0.3.1
4
- Summary: Architecture-preserving REST API synthesis library
5
- Author: ArchAPI Research Team
6
- License-Expression: MIT
7
- Project-URL: Homepage, https://github.com/rohith5005/archapi
8
- Project-URL: Repository, https://github.com/rohith5005/archapi
9
- Project-URL: Issues, https://github.com/rohith5005/archapi/issues
10
- Keywords: rest-api,code-generation,architecture,express,fastapi
11
- Classifier: Development Status :: 3 - Alpha
12
- Classifier: Intended Audience :: Developers
13
- Classifier: Programming Language :: Python :: 3
14
- Classifier: Programming Language :: Python :: 3.9
15
- Classifier: Programming Language :: Python :: 3.10
16
- Classifier: Programming Language :: Python :: 3.11
17
- Classifier: Programming Language :: Python :: 3.12
18
- Classifier: Topic :: Software Development :: Code Generators
19
- Requires-Python: >=3.9
20
- Description-Content-Type: text/markdown
21
- License-File: LICENSE
22
- Dynamic: license-file
23
-
24
- # ArchAPI
25
-
26
- ArchAPI is a Python library for architecture-preserving REST API generation.
27
-
28
- It scans an existing backend project, detects the framework, understands the project structure, plans a REST API, generates framework-specific files, validates the output, and writes files only when explicitly requested.
29
-
30
- ---
31
-
32
- ## Current Status
33
-
34
- Current checkpoint: **Phase 3 complete**
35
-
36
- Completed:
37
-
38
- - Functional Python package
39
- - Express TypeScript adapter
40
- - FastAPI adapter
41
- - Generic fallback adapter
42
- - Framework detection
43
- - Project scanning
44
- - API architecture model
45
- - Confidence scoring
46
- - Low-confidence blocking
47
- - Strict config mode
48
- - REST intent planner
49
- - Code generation
50
- - Dry-run generation
51
- - Safe apply
52
- - Overwrite protection
53
- - Cache and changed-file detection
54
- - Secret scanner
55
- - Context redaction
56
- - Policy gate
57
- - Architecture consistency score
58
- - Command validation
59
- - Unified regression test suite
60
-
61
- ---
62
-
63
- ## Supported Frameworks
64
-
65
- Dedicated generation support currently exists for:
66
-
67
- - Express TypeScript
68
- - FastAPI
69
-
70
- Other frameworks may be detected, but they currently use the generic fallback adapter.
71
-
72
- ---
73
-
74
- ## Installation
75
-
76
- From the project root:
77
-
78
- ```bash
79
- pip install -e .
archapi-0.3.1/README.md DELETED
@@ -1,56 +0,0 @@
1
- # ArchAPI
2
-
3
- ArchAPI is a Python library for architecture-preserving REST API generation.
4
-
5
- It scans an existing backend project, detects the framework, understands the project structure, plans a REST API, generates framework-specific files, validates the output, and writes files only when explicitly requested.
6
-
7
- ---
8
-
9
- ## Current Status
10
-
11
- Current checkpoint: **Phase 3 complete**
12
-
13
- Completed:
14
-
15
- - Functional Python package
16
- - Express TypeScript adapter
17
- - FastAPI adapter
18
- - Generic fallback adapter
19
- - Framework detection
20
- - Project scanning
21
- - API architecture model
22
- - Confidence scoring
23
- - Low-confidence blocking
24
- - Strict config mode
25
- - REST intent planner
26
- - Code generation
27
- - Dry-run generation
28
- - Safe apply
29
- - Overwrite protection
30
- - Cache and changed-file detection
31
- - Secret scanner
32
- - Context redaction
33
- - Policy gate
34
- - Architecture consistency score
35
- - Command validation
36
- - Unified regression test suite
37
-
38
- ---
39
-
40
- ## Supported Frameworks
41
-
42
- Dedicated generation support currently exists for:
43
-
44
- - Express TypeScript
45
- - FastAPI
46
-
47
- Other frameworks may be detected, but they currently use the generic fallback adapter.
48
-
49
- ---
50
-
51
- ## Installation
52
-
53
- From the project root:
54
-
55
- ```bash
56
- pip install -e .
@@ -1,79 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: archapi
3
- Version: 0.3.1
4
- Summary: Architecture-preserving REST API synthesis library
5
- Author: ArchAPI Research Team
6
- License-Expression: MIT
7
- Project-URL: Homepage, https://github.com/rohith5005/archapi
8
- Project-URL: Repository, https://github.com/rohith5005/archapi
9
- Project-URL: Issues, https://github.com/rohith5005/archapi/issues
10
- Keywords: rest-api,code-generation,architecture,express,fastapi
11
- Classifier: Development Status :: 3 - Alpha
12
- Classifier: Intended Audience :: Developers
13
- Classifier: Programming Language :: Python :: 3
14
- Classifier: Programming Language :: Python :: 3.9
15
- Classifier: Programming Language :: Python :: 3.10
16
- Classifier: Programming Language :: Python :: 3.11
17
- Classifier: Programming Language :: Python :: 3.12
18
- Classifier: Topic :: Software Development :: Code Generators
19
- Requires-Python: >=3.9
20
- Description-Content-Type: text/markdown
21
- License-File: LICENSE
22
- Dynamic: license-file
23
-
24
- # ArchAPI
25
-
26
- ArchAPI is a Python library for architecture-preserving REST API generation.
27
-
28
- It scans an existing backend project, detects the framework, understands the project structure, plans a REST API, generates framework-specific files, validates the output, and writes files only when explicitly requested.
29
-
30
- ---
31
-
32
- ## Current Status
33
-
34
- Current checkpoint: **Phase 3 complete**
35
-
36
- Completed:
37
-
38
- - Functional Python package
39
- - Express TypeScript adapter
40
- - FastAPI adapter
41
- - Generic fallback adapter
42
- - Framework detection
43
- - Project scanning
44
- - API architecture model
45
- - Confidence scoring
46
- - Low-confidence blocking
47
- - Strict config mode
48
- - REST intent planner
49
- - Code generation
50
- - Dry-run generation
51
- - Safe apply
52
- - Overwrite protection
53
- - Cache and changed-file detection
54
- - Secret scanner
55
- - Context redaction
56
- - Policy gate
57
- - Architecture consistency score
58
- - Command validation
59
- - Unified regression test suite
60
-
61
- ---
62
-
63
- ## Supported Frameworks
64
-
65
- Dedicated generation support currently exists for:
66
-
67
- - Express TypeScript
68
- - FastAPI
69
-
70
- Other frameworks may be detected, but they currently use the generic fallback adapter.
71
-
72
- ---
73
-
74
- ## Installation
75
-
76
- From the project root:
77
-
78
- ```bash
79
- pip install -e .
File without changes
File without changes
File without changes
File without changes
File without changes