Skip to content

Commit 3bd937b

Browse files
refactoring
1 parent 7544c24 commit 3bd937b

18 files changed

Lines changed: 1212 additions & 63 deletions

README.md

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
**Convert source code to logical representation for LLM analysis.**
88

9-
Code2Logic analyzes codebases and generates compact, LLM-friendly representations with semantic understanding.
9+
Code2Logic analyzes codebases and generates compact, LLM-friendly representations with semantic understanding.
1010
Perfect for feeding project context to AI assistants, building code documentation, or analyzing code structure.
1111

1212
## ✨ Features
@@ -21,16 +21,19 @@ Perfect for feeding project context to AI assistants, building code documentatio
2121
## 🚀 Installation
2222

2323
### Basic (no dependencies)
24+
2425
```bash
2526
pip install code2logic
2627
```
2728

2829
### Full (all features)
30+
2931
```bash
3032
pip install code2logic[full]
3133
```
3234

3335
### Selective features
36+
3437
```bash
3538
pip install code2logic[treesitter] # High-accuracy AST parsing
3639
pip install code2logic[graph] # Dependency analysis
@@ -109,7 +112,8 @@ Human-readable documentation with:
109112

110113
### Compact
111114
Ultra-compact format optimized for LLM context:
112-
```
115+
116+
```text
113117
# myproject | 102f 31875L | typescript:79/python:23
114118
ENTRY: index.ts main.py
115119
HUBS: evolution-manager llm-orchestrator
@@ -129,16 +133,19 @@ Machine-readable format for:
129133

130134
### Library Status
131135
Check which features are available:
136+
132137
```bash
133138
code2logic --status
134139
```
135-
```
140+
141+
```text
136142
Library Status:
137143
tree_sitter: ✓
138144
networkx: ✓
139145
rapidfuzz: ✓
140146
nltk: ✗
141147
spacy: ✗
148+
```
142149

143150
### LLM Configuration
144151

@@ -181,9 +188,9 @@ code2logic llm priority set-mode mixed
181188
```
182189

183190
Model priority rules are stored in `~/.code2logic/llm_config.json`.
184-
```
185191

186192
### Python API
193+
187194
```python
188195
from code2logic import get_library_status
189196

@@ -201,6 +208,7 @@ status = get_library_status()
201208

202209
### Intent Generation
203210
Functions get human-readable descriptions:
211+
204212
```yaml
205213
methods:
206214
async findById(id:string) -> Promise<User> # retrieves user by id
@@ -210,6 +218,7 @@ methods:
210218
211219
### Similarity Detection
212220
Find duplicate and similar functions:
221+
213222
```yaml
214223
Similar Functions:
215224
core/auth.ts::validateToken:
@@ -219,7 +228,7 @@ Similar Functions:
219228
220229
## 🏗️ Architecture
221230
222-
```
231+
```text
223232
code2logic/
224233
├── analyzer.py # Main orchestrator
225234
├── parsers.py # Tree-sitter + fallback parser
@@ -234,6 +243,7 @@ code2logic/
234243
## 🔌 Integration Examples
235244

236245
### With Claude/ChatGPT
246+
237247
```python
238248
from code2logic import analyze_project, CompactGenerator
239249

@@ -249,6 +259,7 @@ Analyze this codebase and suggest improvements:
249259
```
250260

251261
### With RAG Systems
262+
252263
```python
253264
import json
254265
from code2logic import analyze_project, JSONGenerator
@@ -268,25 +279,29 @@ for module in data['modules']:
268279
## 🧪 Development
269280

270281
### Setup
282+
271283
```bash
272-
git clone https://github.com/softreck/code2logic
284+
git clone https://github.com/wronai/code2logic
273285
cd code2logic
274286
pip install -e ".[dev]"
275287
pre-commit install
276288
```
277289

278290
### Tests
291+
279292
```bash
280293
pytest
281294
pytest --cov=code2logic --cov-report=html
282295
```
283296

284297
### Type Checking
298+
285299
```bash
286300
mypy code2logic
287301
```
288302

289303
### Linting
304+
290305
```bash
291306
ruff check code2logic
292307
black code2logic
@@ -343,7 +358,7 @@ Contributions welcome! Please read our [Contributing Guide](CONTRIBUTING.md).
343358

344359
## 📄 License
345360

346-
MIT License - see [LICENSE](LICENSE) for details.
361+
Apache 2 License - see [LICENSE](LICENSE) for details.
347362

348363
## 📚 Documentation
349364

@@ -367,5 +382,5 @@ MIT License - see [LICENSE](LICENSE) for details.
367382

368383
- [Documentation](https://code2logic.readthedocs.io)
369384
- [PyPI](https://pypi.org/project/code2logic/)
370-
- [GitHub](https://github.com/softreck/code2logic)
371-
- [Issues](https://github.com/softreck/code2logic/issues)
385+
- [GitHub](https://github.com/wronai/code2logic)
386+
- [Issues](https://github.com/wronai/code2logic/issues)

code2logic/__init__.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
>>> print(output)
1919
"""
2020

21-
__version__ = "1.0.2"
21+
__version__ = "1.0.5"
2222
__author__ = "Softreck"
2323
__email__ = "info@softreck.dev"
2424
__license__ = "MIT"
@@ -206,6 +206,12 @@
206206
load_profiles,
207207
save_profile,
208208
)
209+
from .terminal import (
210+
ShellRenderer,
211+
render,
212+
get_renderer,
213+
set_renderer,
214+
)
209215

210216
__all__ = [
211217
# Version
@@ -323,4 +329,9 @@
323329
"get_adaptive_chunker",
324330
"load_profiles",
325331
"save_profile",
332+
# Terminal Rendering
333+
"ShellRenderer",
334+
"render",
335+
"get_renderer",
336+
"set_renderer",
326337
]

code2logic/benchmarks/results.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,9 @@ class BenchmarkConfig:
219219

220220
# Verbosity
221221
verbose: bool = False
222+
223+
# Execution mode
224+
use_llm: bool = True
222225

223226
# LLM settings
224227
max_tokens: int = 4000

0 commit comments

Comments
 (0)