savetoken 0.1.0__py3-none-any.whl
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.
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: savetoken
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Convert Repomix/repominify output into compact AI-friendly codebase summaries using free LLMs.
|
|
5
|
+
License: MIT
|
|
6
|
+
Project-URL: Homepage, https://github.com/yourname/savetoken
|
|
7
|
+
Project-URL: Issues, https://github.com/yourname/savetoken/issues
|
|
8
|
+
Keywords: ai,llm,codebase,repomix,prompt,tokens,summarizer
|
|
9
|
+
Classifier: Development Status :: 3 - Alpha
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Topic :: Software Development :: Documentation
|
|
16
|
+
Classifier: Topic :: Utilities
|
|
17
|
+
Requires-Python: >=3.10
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
Provides-Extra: dev
|
|
20
|
+
Requires-Dist: pytest>=7; extra == "dev"
|
|
21
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
22
|
+
Requires-Dist: ruff; extra == "dev"
|
|
23
|
+
Requires-Dist: mypy; extra == "dev"
|
|
24
|
+
|
|
25
|
+
# savetoken 🪙
|
|
26
|
+
|
|
27
|
+
> Convert your Repomix codebase dump into a **compact semantic summary** — optimized for AI prompts, with zero raw code.
|
|
28
|
+
|
|
29
|
+
Instead of pasting 50,000 tokens of source code into ChatGPT or Claude, `savetoken` uses a **free LLM** to read the code once and produce a structured `codebrief.md` you reuse forever.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## How it fits in your workflow
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
Your project
|
|
37
|
+
↓
|
|
38
|
+
npx repomix # packs codebase → repomix-output.xml
|
|
39
|
+
↓
|
|
40
|
+
savetoken summarize repomix-output.xml # translates → codebrief.md ← you are here
|
|
41
|
+
↓
|
|
42
|
+
Paste codebrief.md into your AI prompt # ~500 tokens instead of 50k+
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Install
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
pip install savetoken
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Requires Python 3.10+. Zero dependencies beyond stdlib.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Quick start
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
# 1. Pack your codebase with Repomix
|
|
61
|
+
npx repomix
|
|
62
|
+
|
|
63
|
+
# 2. Summarize with Gemini Flash (free tier)
|
|
64
|
+
export GEMINI_API_KEY=your_key_here
|
|
65
|
+
savetoken summarize repomix-output.xml
|
|
66
|
+
|
|
67
|
+
# Output: codebrief.md — paste it into any AI prompt!
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Python API
|
|
71
|
+
|
|
72
|
+
```python
|
|
73
|
+
from savetoken import SaveToken
|
|
74
|
+
|
|
75
|
+
st = SaveToken(provider="gemini", api_key="...")
|
|
76
|
+
summary = st.summarize("repomix-output.xml")
|
|
77
|
+
st.save(summary, "codebrief.md")
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Providers
|
|
83
|
+
|
|
84
|
+
| Provider | Free tier | Set env var |
|
|
85
|
+
|---|---|---|
|
|
86
|
+
| **Gemini Flash 2.0** ⭐ | ✅ Generous | `GEMINI_API_KEY` |
|
|
87
|
+
| **Groq (Llama 3.3 70B)** | ✅ Fast | `GROQ_API_KEY` |
|
|
88
|
+
| **Mistral Small** | ✅ Available | `MISTRAL_API_KEY` |
|
|
89
|
+
| **OpenAI / DeepSeek** | Paid | `OPENAI_API_KEY` |
|
|
90
|
+
|
|
91
|
+
Gemini is recommended — 1M token context window handles large codebases.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## CLI
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
savetoken summarize repomix-output.xml
|
|
99
|
+
savetoken summarize repomix-output.xml --provider groq --output brief.md --lang pt
|
|
100
|
+
savetoken summarize repomix-output.xml --force # ignore cache, regenerate all
|
|
101
|
+
savetoken clear-cache
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
| Flag | Default | Description |
|
|
105
|
+
|---|---|---|
|
|
106
|
+
| `--provider` | `gemini` | LLM provider |
|
|
107
|
+
| `--output` | `codebrief.md` | Output file |
|
|
108
|
+
| `--format` | `markdown` | `markdown` or `json` |
|
|
109
|
+
| `--lang` | `en` | Description language |
|
|
110
|
+
| `--force` | off | Skip cache |
|
|
111
|
+
| `--cache-dir` | `.savetoken_cache` | Cache location |
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Caching
|
|
116
|
+
|
|
117
|
+
`savetoken` hashes each file's content. On re-runs, **only changed files are re-summarized**. The cache lives in `.savetoken_cache/` — commit it to git to share across your team.
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## VS Code Extension
|
|
122
|
+
|
|
123
|
+
Install the extension and use:
|
|
124
|
+
- **Command Palette → SaveToken: Summarize Codebase**
|
|
125
|
+
- Right-click `repomix-output.xml` → **SaveToken: Summarize**
|
|
126
|
+
- Configure provider and API key in Settings → SaveToken
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## Example output (`codebrief.md`)
|
|
131
|
+
|
|
132
|
+
```markdown
|
|
133
|
+
# MyShop — savetoken summary
|
|
134
|
+
|
|
135
|
+
E-commerce backend built with FastAPI and PostgreSQL.
|
|
136
|
+
|
|
137
|
+
**Stack:** FastAPI, PostgreSQL, SQLAlchemy, Redis
|
|
138
|
+
**Architecture:** Layered MVC
|
|
139
|
+
**Entry points:** main.py
|
|
140
|
+
|
|
141
|
+
## Directory Map
|
|
142
|
+
- `src/api` — HTTP route handlers (REST)
|
|
143
|
+
- `src/services` — Business logic layer
|
|
144
|
+
- `src/models` — SQLAlchemy ORM entities
|
|
145
|
+
|
|
146
|
+
## Files
|
|
147
|
+
|
|
148
|
+
### `src/services/order.py`
|
|
149
|
+
Manages the full lifecycle of customer orders.
|
|
150
|
+
|
|
151
|
+
**Entities:**
|
|
152
|
+
- Order(id, user_id, total, status: enum[pending, paid, cancelled])
|
|
153
|
+
|
|
154
|
+
**Functions:**
|
|
155
|
+
- create_order(user_id, items) → Order: validates stock and creates order
|
|
156
|
+
- cancel_order(order_id) → bool: cancels if status allows
|
|
157
|
+
- calculate_total(items) → Decimal: applies discounts and rounds
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## License
|
|
163
|
+
|
|
164
|
+
MIT
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
savetoken-0.1.0.dist-info/METADATA,sha256=8_Cw8L5blGr20lXN_wi6sF2BIRGkOPo7i8L02rfYpXk,4532
|
|
2
|
+
savetoken-0.1.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
3
|
+
savetoken-0.1.0.dist-info/entry_points.txt,sha256=4_pgjSBoxIdwRxCQpLVHYoT1yl6liqTOI1HgJnqYgXM,49
|
|
4
|
+
savetoken-0.1.0.dist-info/top_level.txt,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
5
|
+
savetoken-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|