tagdiff 0.1.0__tar.gz → 0.1.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.
- tagdiff-0.1.2/PKG-INFO +313 -0
- tagdiff-0.1.2/README.md +273 -0
- {tagdiff-0.1.0 → tagdiff-0.1.2}/pyproject.toml +2 -1
- tagdiff-0.1.2/tagdiff/__init__.py +6 -0
- tagdiff-0.1.2/tagdiff/analyze.py +132 -0
- tagdiff-0.1.2/tagdiff/cache.py +60 -0
- tagdiff-0.1.2/tagdiff/changelog.py +72 -0
- tagdiff-0.1.2/tagdiff/cli.py +145 -0
- tagdiff-0.1.2/tagdiff/config.py +12 -0
- tagdiff-0.1.2/tagdiff/formatter.py +36 -0
- tagdiff-0.1.2/tagdiff/github.py +95 -0
- tagdiff-0.1.2/tagdiff/llm.py +66 -0
- tagdiff-0.1.2/tagdiff/releases.py +41 -0
- tagdiff-0.1.2/tagdiff/search.py +50 -0
- tagdiff-0.1.2/tagdiff.egg-info/PKG-INFO +313 -0
- {tagdiff-0.1.0 → tagdiff-0.1.2}/tagdiff.egg-info/SOURCES.txt +9 -1
- {tagdiff-0.1.0 → tagdiff-0.1.2}/tagdiff.egg-info/requires.txt +1 -0
- tagdiff-0.1.0/PKG-INFO +0 -90
- tagdiff-0.1.0/README.md +0 -51
- tagdiff-0.1.0/tagdiff/__init__.py +0 -3
- tagdiff-0.1.0/tagdiff/cli.py +0 -46
- tagdiff-0.1.0/tagdiff/core.py +0 -148
- tagdiff-0.1.0/tagdiff.egg-info/PKG-INFO +0 -90
- {tagdiff-0.1.0 → tagdiff-0.1.2}/LICENSE +0 -0
- {tagdiff-0.1.0 → tagdiff-0.1.2}/setup.cfg +0 -0
- {tagdiff-0.1.0 → tagdiff-0.1.2}/tagdiff.egg-info/dependency_links.txt +0 -0
- {tagdiff-0.1.0 → tagdiff-0.1.2}/tagdiff.egg-info/entry_points.txt +0 -0
- {tagdiff-0.1.0 → tagdiff-0.1.2}/tagdiff.egg-info/top_level.txt +0 -0
tagdiff-0.1.2/PKG-INFO
ADDED
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tagdiff
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: Compare GitHub release changelogs between tags
|
|
5
|
+
Author-email: ar9av <ar9avg@gmail.com>
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2026 ar9av
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: Homepage, https://github.com/ar9av/tagdiff
|
|
29
|
+
Project-URL: Bug Tracker, https://github.com/ar9av/tagdiff/issues
|
|
30
|
+
Classifier: Programming Language :: Python :: 3
|
|
31
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
32
|
+
Classifier: Operating System :: OS Independent
|
|
33
|
+
Requires-Python: >=3.9
|
|
34
|
+
Description-Content-Type: text/markdown
|
|
35
|
+
License-File: LICENSE
|
|
36
|
+
Requires-Dist: requests>=2.31.0
|
|
37
|
+
Requires-Dist: litellm>=1.0.0
|
|
38
|
+
Requires-Dist: python-dotenv>=1.0.0
|
|
39
|
+
Dynamic: license-file
|
|
40
|
+
|
|
41
|
+
# TagDiff
|
|
42
|
+
|
|
43
|
+
TagDiff compares GitHub release notes between two version tags, lets you search through changelogs by keyword, and can deep-research changes using AI.
|
|
44
|
+
|
|
45
|
+
## What It Does
|
|
46
|
+
- Fetches releases from GitHub for a repository
|
|
47
|
+
- Compares releases between `old_version` and `new_version`
|
|
48
|
+
- Search changelogs by keyword across version ranges
|
|
49
|
+
- Deep-research mode: AI-powered analysis of changelogs + code diffs
|
|
50
|
+
- Returns results as JSON or formatted CLI output
|
|
51
|
+
- Caches GitHub API responses locally to avoid repeated fetches
|
|
52
|
+
- Uses one shared core function for package, CLI, and Docker
|
|
53
|
+
|
|
54
|
+
## Project Structure
|
|
55
|
+
```
|
|
56
|
+
tagdiff/
|
|
57
|
+
├── config.py # Environment, constants (cache dir, default model, dotenv)
|
|
58
|
+
├── cache.py # File-based caching (read, write, clear)
|
|
59
|
+
├── github.py # GitHub API (fetch releases, fetch compare diff)
|
|
60
|
+
├── releases.py # Version range filtering
|
|
61
|
+
├── llm.py # LLM calls (structured extraction, streaming analysis)
|
|
62
|
+
├── changelog.py # Diff logic (get_changelog, get_changes_between_versions)
|
|
63
|
+
├── search.py # Keyword search across changelogs
|
|
64
|
+
├── analyze.py # Agentic deep-research pipeline
|
|
65
|
+
├── formatter.py # CLI output formatting
|
|
66
|
+
├── cli.py # CLI entry point (arg parsing + routing)
|
|
67
|
+
└── __init__.py # Public API exports
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Install
|
|
71
|
+
|
|
72
|
+
### From PyPI
|
|
73
|
+
```bash
|
|
74
|
+
pip install tagdiff
|
|
75
|
+
```
|
|
76
|
+
https://pypi.org/project/tagdiff/
|
|
77
|
+
|
|
78
|
+
### From source
|
|
79
|
+
```bash
|
|
80
|
+
pip install .
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Editable (development)
|
|
84
|
+
```bash
|
|
85
|
+
pip install -e .
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Usage
|
|
89
|
+
|
|
90
|
+
### Diff: Compare releases between two tags
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
tagdiff psf/requests v2.31.0 v2.32.0
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
With AI-structured changelog:
|
|
97
|
+
```bash
|
|
98
|
+
tagdiff psf/requests v2.31.0 v2.32.0 --structured --model gpt-5-nano
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Save to file:
|
|
102
|
+
```bash
|
|
103
|
+
tagdiff psf/requests v2.31.0 v2.32.0 --output result.json
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Search: Find keywords across changelogs
|
|
107
|
+
|
|
108
|
+
Search between two versions:
|
|
109
|
+
```bash
|
|
110
|
+
tagdiff search psf/requests "bug fix" --from v2.31.0 --to v2.32.3
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Search from a version onwards:
|
|
114
|
+
```bash
|
|
115
|
+
tagdiff search psf/requests "deprecat" --from v2.31.0
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Search up to a version:
|
|
119
|
+
```bash
|
|
120
|
+
tagdiff search psf/requests "SSL" --to v2.32.3
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Search all releases:
|
|
124
|
+
```bash
|
|
125
|
+
tagdiff search psf/requests "security"
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Output as JSON:
|
|
129
|
+
```bash
|
|
130
|
+
tagdiff search psf/requests "fix" --from v2.31.0 --to v2.32.3 --json
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Save search results to file:
|
|
134
|
+
```bash
|
|
135
|
+
tagdiff search psf/requests "fix" --from v2.31.0 --json --output results.json
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Case-sensitive search:
|
|
139
|
+
```bash
|
|
140
|
+
tagdiff search psf/requests "SSL" --case-sensitive
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Analyze: AI-powered deep research
|
|
144
|
+
|
|
145
|
+
Ask a natural language question about what changed across versions. TagDiff gathers the changelogs (and optionally the actual code diff), then uses an LLM to produce a structured analysis.
|
|
146
|
+
|
|
147
|
+
Basic analysis:
|
|
148
|
+
```bash
|
|
149
|
+
tagdiff analyze psf/requests "What SSL and security changes happened?" --from v2.31.0 --to v2.32.3
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
With code diff context (fetches commits + changed files from GitHub compare API):
|
|
153
|
+
```bash
|
|
154
|
+
tagdiff analyze psf/requests "What breaking changes should I worry about?" --from v2.31.0 --to v2.32.3 --with-diff
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Use a specific model:
|
|
158
|
+
```bash
|
|
159
|
+
tagdiff analyze psf/requests "Summarize all deprecations" --from v2.31.0 --to v2.32.3 --model gpt-5-nano
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Only from-version (analyzes everything after):
|
|
163
|
+
```bash
|
|
164
|
+
tagdiff analyze psf/requests "What changed in auth?" --from v2.31.0
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Save analysis to file:
|
|
168
|
+
```bash
|
|
169
|
+
tagdiff analyze psf/requests "Migration guide from v2.31 to v2.32" --from v2.31.0 --to v2.32.3 --output migration.md
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
Get full result as JSON:
|
|
173
|
+
```bash
|
|
174
|
+
tagdiff analyze psf/requests "What changed?" --from v2.31.0 --to v2.32.3 --json
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
#### How it works
|
|
178
|
+
|
|
179
|
+
The analyze command runs a multi-step pipeline:
|
|
180
|
+
|
|
181
|
+
```
|
|
182
|
+
[1] Fetching releases for psf/requests...
|
|
183
|
+
Found 5 releases: v2.31.0 -> v2.32.3
|
|
184
|
+
|
|
185
|
+
[2] Collecting changelogs...
|
|
186
|
+
Collected 5 changelogs (6833 chars)
|
|
187
|
+
|
|
188
|
+
[3] Fetching code diff from GitHub... # only with --with-diff
|
|
189
|
+
139 commits, 78 files changed
|
|
190
|
+
|
|
191
|
+
[4] Analyzing with gpt-5-nano...
|
|
192
|
+
|
|
193
|
+
**Summary**
|
|
194
|
+
Between v2.31.0 and v2.32.3, the major SSL changes include...
|
|
195
|
+
|
|
196
|
+
**Detailed Analysis**
|
|
197
|
+
...version-by-version breakdown...
|
|
198
|
+
|
|
199
|
+
**Key Findings**
|
|
200
|
+
- verify=True now reuses a global SSLContext...
|
|
201
|
+
- Custom SSLContext support was broken and fixed in v2.32.3...
|
|
202
|
+
|
|
203
|
+
**Impact Assessment**
|
|
204
|
+
- Users with custom SSLContext subclasses should upgrade to v2.32.3...
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
The LLM response is streamed to the terminal in real-time.
|
|
208
|
+
|
|
209
|
+
### Caching
|
|
210
|
+
|
|
211
|
+
Add `--cache` to any command to cache GitHub API responses locally in `~/.cache/tagdiff`. This avoids hitting the API repeatedly for the same repo. Works with `diff`, `search`, and `analyze`.
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
# First run fetches from GitHub and caches
|
|
215
|
+
tagdiff search psf/requests "fix" --from v2.31.0 --to v2.32.3 --cache
|
|
216
|
+
|
|
217
|
+
# Subsequent runs use the cache (instant)
|
|
218
|
+
tagdiff search psf/requests "SSL" --from v2.31.0 --to v2.32.3 --cache
|
|
219
|
+
|
|
220
|
+
# Great for analyze — iterate on questions without re-fetching
|
|
221
|
+
tagdiff analyze psf/requests "What broke?" --from v2.31.0 --to v2.32.3 --cache
|
|
222
|
+
tagdiff analyze psf/requests "What about SSL?" --from v2.31.0 --to v2.32.3 --cache
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Set a custom TTL (in seconds, default is 3600 = 1 hour):
|
|
226
|
+
```bash
|
|
227
|
+
tagdiff search psf/requests "fix" --cache --cache-ttl 86400 # 24 hours
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
Clear the cache:
|
|
231
|
+
```bash
|
|
232
|
+
# Clear all cached data
|
|
233
|
+
tagdiff clear-cache
|
|
234
|
+
|
|
235
|
+
# Clear cache for a specific repo
|
|
236
|
+
tagdiff clear-cache psf/requests
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
Override the cache directory with the `TAGDIFF_CACHE_DIR` environment variable.
|
|
240
|
+
|
|
241
|
+
### CLI output example (search)
|
|
242
|
+
|
|
243
|
+
```
|
|
244
|
+
Search: "fix" in psf/requests (v2.31.0 -> v2.32.3)
|
|
245
|
+
Searched 5 releases, found 10 match(es) across 3 release(s)
|
|
246
|
+
|
|
247
|
+
v2.32.0 (2024-05-20) [6 match(es)]
|
|
248
|
+
──────────────────────────────────────────────────
|
|
249
|
+
- Fixed an issue where setting `verify=False` on the first request from a
|
|
250
|
+
**Bugfixes**
|
|
251
|
+
- Fixed bug in length detection where emoji length was incorrectly
|
|
252
|
+
- Fixed deserialization bug in JSONDecodeError. (#6629)
|
|
253
|
+
- Fixed bug where an extra leading `/` (path separator) could lead
|
|
254
|
+
- Various typo fixes and doc improvements.
|
|
255
|
+
|
|
256
|
+
v2.32.1 (2024-05-21) [1 match(es)]
|
|
257
|
+
──────────────────────────────────────────────────
|
|
258
|
+
**Bugfixes**
|
|
259
|
+
|
|
260
|
+
v2.32.3 (2024-05-29) [3 match(es)]
|
|
261
|
+
──────────────────────────────────────────────────
|
|
262
|
+
**Bugfixes**
|
|
263
|
+
- Fixed bug breaking the ability to specify custom SSLContexts in sub-classes of
|
|
264
|
+
- Fixed issue where Requests started failing to run on Python versions compiled
|
|
265
|
+
|
|
266
|
+
Total: 10 match(es) in 3 release(s)
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
## Run as module
|
|
270
|
+
```bash
|
|
271
|
+
python -m tagdiff.cli psf/requests v2.31.0 v2.32.0
|
|
272
|
+
python -m tagdiff.cli search psf/requests "fix" --from v2.31.0
|
|
273
|
+
python -m tagdiff.cli analyze psf/requests "What changed?" --from v2.31.0 --to v2.32.3
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
## Run with Docker
|
|
277
|
+
```bash
|
|
278
|
+
docker build -t tagdiff-local .
|
|
279
|
+
docker run --rm tagdiff-local psf/requests v2.31.0 v2.32.0
|
|
280
|
+
docker run --rm tagdiff-local search psf/requests "fix" --from v2.31.0
|
|
281
|
+
docker run --rm -e OPENAI_API_KEY tagdiff-local analyze psf/requests "What changed?" --from v2.31.0 --to v2.32.3
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
## Use as a library
|
|
285
|
+
```python
|
|
286
|
+
from tagdiff import get_changelog, search_changelogs, analyze_changelog, clear_cache
|
|
287
|
+
|
|
288
|
+
# Diff between versions
|
|
289
|
+
result = get_changelog("psf/requests", "v2.31.0", "v2.32.0")
|
|
290
|
+
|
|
291
|
+
# Search changelogs
|
|
292
|
+
result = search_changelogs("psf/requests", "SSL", from_version="v2.31.0", to_version="v2.32.3")
|
|
293
|
+
|
|
294
|
+
# Deep research with AI
|
|
295
|
+
result = analyze_changelog("psf/requests", "What SSL changes happened?",
|
|
296
|
+
from_version="v2.31.0", to_version="v2.32.3",
|
|
297
|
+
with_diff=True, model="gpt-5-nano")
|
|
298
|
+
|
|
299
|
+
# With caching
|
|
300
|
+
result = get_changelog("psf/requests", "v2.31.0", "v2.32.0", cache=True)
|
|
301
|
+
result = search_changelogs("psf/requests", "SSL", cache=True, cache_ttl=86400)
|
|
302
|
+
result = analyze_changelog("psf/requests", "What changed?",
|
|
303
|
+
from_version="v2.31.0", cache=True)
|
|
304
|
+
|
|
305
|
+
# Clear cache
|
|
306
|
+
clear_cache() # all
|
|
307
|
+
clear_cache(repo="psf/requests") # specific repo
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
## Environment Variables
|
|
311
|
+
- `GITHUB_TOKEN` - GitHub API token (recommended, avoids rate limits)
|
|
312
|
+
- `TAGDIFF_MODEL` - Default AI model for `--structured` and `analyze` (default: `gpt-5-nano`)
|
|
313
|
+
- `TAGDIFF_CACHE_DIR` - Custom cache directory (default: `~/.cache/tagdiff`)
|
tagdiff-0.1.2/README.md
ADDED
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
# TagDiff
|
|
2
|
+
|
|
3
|
+
TagDiff compares GitHub release notes between two version tags, lets you search through changelogs by keyword, and can deep-research changes using AI.
|
|
4
|
+
|
|
5
|
+
## What It Does
|
|
6
|
+
- Fetches releases from GitHub for a repository
|
|
7
|
+
- Compares releases between `old_version` and `new_version`
|
|
8
|
+
- Search changelogs by keyword across version ranges
|
|
9
|
+
- Deep-research mode: AI-powered analysis of changelogs + code diffs
|
|
10
|
+
- Returns results as JSON or formatted CLI output
|
|
11
|
+
- Caches GitHub API responses locally to avoid repeated fetches
|
|
12
|
+
- Uses one shared core function for package, CLI, and Docker
|
|
13
|
+
|
|
14
|
+
## Project Structure
|
|
15
|
+
```
|
|
16
|
+
tagdiff/
|
|
17
|
+
├── config.py # Environment, constants (cache dir, default model, dotenv)
|
|
18
|
+
├── cache.py # File-based caching (read, write, clear)
|
|
19
|
+
├── github.py # GitHub API (fetch releases, fetch compare diff)
|
|
20
|
+
├── releases.py # Version range filtering
|
|
21
|
+
├── llm.py # LLM calls (structured extraction, streaming analysis)
|
|
22
|
+
├── changelog.py # Diff logic (get_changelog, get_changes_between_versions)
|
|
23
|
+
├── search.py # Keyword search across changelogs
|
|
24
|
+
├── analyze.py # Agentic deep-research pipeline
|
|
25
|
+
├── formatter.py # CLI output formatting
|
|
26
|
+
├── cli.py # CLI entry point (arg parsing + routing)
|
|
27
|
+
└── __init__.py # Public API exports
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Install
|
|
31
|
+
|
|
32
|
+
### From PyPI
|
|
33
|
+
```bash
|
|
34
|
+
pip install tagdiff
|
|
35
|
+
```
|
|
36
|
+
https://pypi.org/project/tagdiff/
|
|
37
|
+
|
|
38
|
+
### From source
|
|
39
|
+
```bash
|
|
40
|
+
pip install .
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Editable (development)
|
|
44
|
+
```bash
|
|
45
|
+
pip install -e .
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Usage
|
|
49
|
+
|
|
50
|
+
### Diff: Compare releases between two tags
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
tagdiff psf/requests v2.31.0 v2.32.0
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
With AI-structured changelog:
|
|
57
|
+
```bash
|
|
58
|
+
tagdiff psf/requests v2.31.0 v2.32.0 --structured --model gpt-5-nano
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Save to file:
|
|
62
|
+
```bash
|
|
63
|
+
tagdiff psf/requests v2.31.0 v2.32.0 --output result.json
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Search: Find keywords across changelogs
|
|
67
|
+
|
|
68
|
+
Search between two versions:
|
|
69
|
+
```bash
|
|
70
|
+
tagdiff search psf/requests "bug fix" --from v2.31.0 --to v2.32.3
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Search from a version onwards:
|
|
74
|
+
```bash
|
|
75
|
+
tagdiff search psf/requests "deprecat" --from v2.31.0
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Search up to a version:
|
|
79
|
+
```bash
|
|
80
|
+
tagdiff search psf/requests "SSL" --to v2.32.3
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Search all releases:
|
|
84
|
+
```bash
|
|
85
|
+
tagdiff search psf/requests "security"
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Output as JSON:
|
|
89
|
+
```bash
|
|
90
|
+
tagdiff search psf/requests "fix" --from v2.31.0 --to v2.32.3 --json
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Save search results to file:
|
|
94
|
+
```bash
|
|
95
|
+
tagdiff search psf/requests "fix" --from v2.31.0 --json --output results.json
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Case-sensitive search:
|
|
99
|
+
```bash
|
|
100
|
+
tagdiff search psf/requests "SSL" --case-sensitive
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Analyze: AI-powered deep research
|
|
104
|
+
|
|
105
|
+
Ask a natural language question about what changed across versions. TagDiff gathers the changelogs (and optionally the actual code diff), then uses an LLM to produce a structured analysis.
|
|
106
|
+
|
|
107
|
+
Basic analysis:
|
|
108
|
+
```bash
|
|
109
|
+
tagdiff analyze psf/requests "What SSL and security changes happened?" --from v2.31.0 --to v2.32.3
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
With code diff context (fetches commits + changed files from GitHub compare API):
|
|
113
|
+
```bash
|
|
114
|
+
tagdiff analyze psf/requests "What breaking changes should I worry about?" --from v2.31.0 --to v2.32.3 --with-diff
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Use a specific model:
|
|
118
|
+
```bash
|
|
119
|
+
tagdiff analyze psf/requests "Summarize all deprecations" --from v2.31.0 --to v2.32.3 --model gpt-5-nano
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Only from-version (analyzes everything after):
|
|
123
|
+
```bash
|
|
124
|
+
tagdiff analyze psf/requests "What changed in auth?" --from v2.31.0
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Save analysis to file:
|
|
128
|
+
```bash
|
|
129
|
+
tagdiff analyze psf/requests "Migration guide from v2.31 to v2.32" --from v2.31.0 --to v2.32.3 --output migration.md
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Get full result as JSON:
|
|
133
|
+
```bash
|
|
134
|
+
tagdiff analyze psf/requests "What changed?" --from v2.31.0 --to v2.32.3 --json
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
#### How it works
|
|
138
|
+
|
|
139
|
+
The analyze command runs a multi-step pipeline:
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
[1] Fetching releases for psf/requests...
|
|
143
|
+
Found 5 releases: v2.31.0 -> v2.32.3
|
|
144
|
+
|
|
145
|
+
[2] Collecting changelogs...
|
|
146
|
+
Collected 5 changelogs (6833 chars)
|
|
147
|
+
|
|
148
|
+
[3] Fetching code diff from GitHub... # only with --with-diff
|
|
149
|
+
139 commits, 78 files changed
|
|
150
|
+
|
|
151
|
+
[4] Analyzing with gpt-5-nano...
|
|
152
|
+
|
|
153
|
+
**Summary**
|
|
154
|
+
Between v2.31.0 and v2.32.3, the major SSL changes include...
|
|
155
|
+
|
|
156
|
+
**Detailed Analysis**
|
|
157
|
+
...version-by-version breakdown...
|
|
158
|
+
|
|
159
|
+
**Key Findings**
|
|
160
|
+
- verify=True now reuses a global SSLContext...
|
|
161
|
+
- Custom SSLContext support was broken and fixed in v2.32.3...
|
|
162
|
+
|
|
163
|
+
**Impact Assessment**
|
|
164
|
+
- Users with custom SSLContext subclasses should upgrade to v2.32.3...
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
The LLM response is streamed to the terminal in real-time.
|
|
168
|
+
|
|
169
|
+
### Caching
|
|
170
|
+
|
|
171
|
+
Add `--cache` to any command to cache GitHub API responses locally in `~/.cache/tagdiff`. This avoids hitting the API repeatedly for the same repo. Works with `diff`, `search`, and `analyze`.
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
# First run fetches from GitHub and caches
|
|
175
|
+
tagdiff search psf/requests "fix" --from v2.31.0 --to v2.32.3 --cache
|
|
176
|
+
|
|
177
|
+
# Subsequent runs use the cache (instant)
|
|
178
|
+
tagdiff search psf/requests "SSL" --from v2.31.0 --to v2.32.3 --cache
|
|
179
|
+
|
|
180
|
+
# Great for analyze — iterate on questions without re-fetching
|
|
181
|
+
tagdiff analyze psf/requests "What broke?" --from v2.31.0 --to v2.32.3 --cache
|
|
182
|
+
tagdiff analyze psf/requests "What about SSL?" --from v2.31.0 --to v2.32.3 --cache
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Set a custom TTL (in seconds, default is 3600 = 1 hour):
|
|
186
|
+
```bash
|
|
187
|
+
tagdiff search psf/requests "fix" --cache --cache-ttl 86400 # 24 hours
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Clear the cache:
|
|
191
|
+
```bash
|
|
192
|
+
# Clear all cached data
|
|
193
|
+
tagdiff clear-cache
|
|
194
|
+
|
|
195
|
+
# Clear cache for a specific repo
|
|
196
|
+
tagdiff clear-cache psf/requests
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Override the cache directory with the `TAGDIFF_CACHE_DIR` environment variable.
|
|
200
|
+
|
|
201
|
+
### CLI output example (search)
|
|
202
|
+
|
|
203
|
+
```
|
|
204
|
+
Search: "fix" in psf/requests (v2.31.0 -> v2.32.3)
|
|
205
|
+
Searched 5 releases, found 10 match(es) across 3 release(s)
|
|
206
|
+
|
|
207
|
+
v2.32.0 (2024-05-20) [6 match(es)]
|
|
208
|
+
──────────────────────────────────────────────────
|
|
209
|
+
- Fixed an issue where setting `verify=False` on the first request from a
|
|
210
|
+
**Bugfixes**
|
|
211
|
+
- Fixed bug in length detection where emoji length was incorrectly
|
|
212
|
+
- Fixed deserialization bug in JSONDecodeError. (#6629)
|
|
213
|
+
- Fixed bug where an extra leading `/` (path separator) could lead
|
|
214
|
+
- Various typo fixes and doc improvements.
|
|
215
|
+
|
|
216
|
+
v2.32.1 (2024-05-21) [1 match(es)]
|
|
217
|
+
──────────────────────────────────────────────────
|
|
218
|
+
**Bugfixes**
|
|
219
|
+
|
|
220
|
+
v2.32.3 (2024-05-29) [3 match(es)]
|
|
221
|
+
──────────────────────────────────────────────────
|
|
222
|
+
**Bugfixes**
|
|
223
|
+
- Fixed bug breaking the ability to specify custom SSLContexts in sub-classes of
|
|
224
|
+
- Fixed issue where Requests started failing to run on Python versions compiled
|
|
225
|
+
|
|
226
|
+
Total: 10 match(es) in 3 release(s)
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
## Run as module
|
|
230
|
+
```bash
|
|
231
|
+
python -m tagdiff.cli psf/requests v2.31.0 v2.32.0
|
|
232
|
+
python -m tagdiff.cli search psf/requests "fix" --from v2.31.0
|
|
233
|
+
python -m tagdiff.cli analyze psf/requests "What changed?" --from v2.31.0 --to v2.32.3
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
## Run with Docker
|
|
237
|
+
```bash
|
|
238
|
+
docker build -t tagdiff-local .
|
|
239
|
+
docker run --rm tagdiff-local psf/requests v2.31.0 v2.32.0
|
|
240
|
+
docker run --rm tagdiff-local search psf/requests "fix" --from v2.31.0
|
|
241
|
+
docker run --rm -e OPENAI_API_KEY tagdiff-local analyze psf/requests "What changed?" --from v2.31.0 --to v2.32.3
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
## Use as a library
|
|
245
|
+
```python
|
|
246
|
+
from tagdiff import get_changelog, search_changelogs, analyze_changelog, clear_cache
|
|
247
|
+
|
|
248
|
+
# Diff between versions
|
|
249
|
+
result = get_changelog("psf/requests", "v2.31.0", "v2.32.0")
|
|
250
|
+
|
|
251
|
+
# Search changelogs
|
|
252
|
+
result = search_changelogs("psf/requests", "SSL", from_version="v2.31.0", to_version="v2.32.3")
|
|
253
|
+
|
|
254
|
+
# Deep research with AI
|
|
255
|
+
result = analyze_changelog("psf/requests", "What SSL changes happened?",
|
|
256
|
+
from_version="v2.31.0", to_version="v2.32.3",
|
|
257
|
+
with_diff=True, model="gpt-5-nano")
|
|
258
|
+
|
|
259
|
+
# With caching
|
|
260
|
+
result = get_changelog("psf/requests", "v2.31.0", "v2.32.0", cache=True)
|
|
261
|
+
result = search_changelogs("psf/requests", "SSL", cache=True, cache_ttl=86400)
|
|
262
|
+
result = analyze_changelog("psf/requests", "What changed?",
|
|
263
|
+
from_version="v2.31.0", cache=True)
|
|
264
|
+
|
|
265
|
+
# Clear cache
|
|
266
|
+
clear_cache() # all
|
|
267
|
+
clear_cache(repo="psf/requests") # specific repo
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
## Environment Variables
|
|
271
|
+
- `GITHUB_TOKEN` - GitHub API token (recommended, avoids rate limits)
|
|
272
|
+
- `TAGDIFF_MODEL` - Default AI model for `--structured` and `analyze` (default: `gpt-5-nano`)
|
|
273
|
+
- `TAGDIFF_CACHE_DIR` - Custom cache directory (default: `~/.cache/tagdiff`)
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "tagdiff"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.2"
|
|
8
8
|
description = "Compare GitHub release changelogs between tags"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.9"
|
|
@@ -20,6 +20,7 @@ classifiers = [
|
|
|
20
20
|
dependencies = [
|
|
21
21
|
"requests>=2.31.0",
|
|
22
22
|
"litellm>=1.0.0",
|
|
23
|
+
"python-dotenv>=1.0.0",
|
|
23
24
|
]
|
|
24
25
|
|
|
25
26
|
[project.urls]
|