Skip to main content

Compare GitHub release changelogs between tags

Project description

TagDiff

TagDiff compares GitHub release notes between two version tags and lets you search through changelogs by keyword.

What It Does

  • Fetches releases from GitHub for a repository
  • Compares releases between old_version and new_version
  • Search changelogs by keyword across version ranges
  • Returns results as JSON or formatted CLI output
  • Caches GitHub API responses locally to avoid repeated fetches
  • Uses one shared core function for package, CLI, and Docker

Project Structure

  • tagdiff/core.py: shared logic (get_changelog, search_changelogs)
  • tagdiff/cli.py: CLI wrapper
  • tagdiff/__init__.py: package export
  • pyproject.toml: package + CLI entrypoint config
  • Dockerfile: Docker image setup

Install

From PyPI

pip install tagdiff

https://pypi.org/project/tagdiff/

From source

pip install .

Editable (development)

pip install -e .

Usage

Diff: Compare releases between two tags

tagdiff psf/requests v2.31.0 v2.32.0

With AI-structured changelog:

tagdiff psf/requests v2.31.0 v2.32.0 --structured --model gpt-4o

Save to file:

tagdiff psf/requests v2.31.0 v2.32.0 --output result.json

Search: Find keywords across changelogs

Search between two versions:

tagdiff search psf/requests "bug fix" --from v2.31.0 --to v2.32.3

Search from a version onwards:

tagdiff search psf/requests "deprecat" --from v2.31.0

Search up to a version:

tagdiff search psf/requests "SSL" --to v2.32.3

Search all releases:

tagdiff search psf/requests "security"

Output as JSON:

tagdiff search psf/requests "fix" --from v2.31.0 --to v2.32.3 --json

Save search results to file:

tagdiff search psf/requests "fix" --from v2.31.0 --json --output results.json

Case-sensitive search:

tagdiff search psf/requests "SSL" --case-sensitive

Caching

Add --cache to any command to cache GitHub API responses locally in ~/.cache/tagdiff. This avoids hitting the API repeatedly for the same repo.

# First run fetches from GitHub and caches
tagdiff search psf/requests "fix" --from v2.31.0 --to v2.32.3 --cache

# Subsequent runs use the cache (instant)
tagdiff search psf/requests "SSL" --from v2.31.0 --to v2.32.3 --cache

# Also works with diff
tagdiff psf/requests v2.31.0 v2.32.0 --cache

Set a custom TTL (in seconds, default is 3600 = 1 hour):

tagdiff search psf/requests "fix" --cache --cache-ttl 86400  # 24 hours

Clear the cache:

# Clear all cached data
tagdiff clear-cache

# Clear cache for a specific repo
tagdiff clear-cache psf/requests

Override the cache directory with the TAGDIFF_CACHE_DIR environment variable.

CLI output example

  Search: "fix" in psf/requests (v2.31.0 -> v2.32.3)
  Searched 5 releases, found 10 match(es) across 3 release(s)

  v2.32.0  (2024-05-20)  [6 match(es)]
  ──────────────────────────────────────────────────
    - Fixed an issue where setting `verify=False` on the first request from a
    **Bugfixes**
    - Fixed bug in length detection where emoji length was incorrectly
    - Fixed deserialization bug in JSONDecodeError. (#6629)
    - Fixed bug where an extra leading `/` (path separator) could lead
    - Various typo fixes and doc improvements.

  v2.32.1  (2024-05-21)  [1 match(es)]
  ──────────────────────────────────────────────────
    **Bugfixes**

  v2.32.3  (2024-05-29)  [3 match(es)]
  ──────────────────────────────────────────────────
    **Bugfixes**
    - Fixed bug breaking the ability to specify custom SSLContexts in sub-classes of
    - Fixed issue where Requests started failing to run on Python versions compiled

  Total: 10 match(es) in 3 release(s)

Run as module

python -m tagdiff.cli psf/requests v2.31.0 v2.32.0
python -m tagdiff.cli search psf/requests "fix" --from v2.31.0

Run with Docker

docker build -t tagdiff-local .
docker run --rm tagdiff-local psf/requests v2.31.0 v2.32.0
docker run --rm tagdiff-local search psf/requests "fix" --from v2.31.0

Use as a library

from tagdiff import get_changelog, search_changelogs, clear_cache

# Diff between versions
result = get_changelog("psf/requests", "v2.31.0", "v2.32.0")

# Search changelogs
result = search_changelogs("psf/requests", "SSL", from_version="v2.31.0", to_version="v2.32.3")

# With caching
result = get_changelog("psf/requests", "v2.31.0", "v2.32.0", cache=True)
result = search_changelogs("psf/requests", "SSL", cache=True, cache_ttl=86400)

# Clear cache
clear_cache()                     # all
clear_cache(repo="psf/requests")  # specific repo

Environment Variables

  • GITHUB_TOKEN - GitHub API token (recommended, avoids rate limits)
  • TAGDIFF_MODEL - Default AI model for --structured (default: gpt-4o-mini)
  • TAGDIFF_CACHE_DIR - Custom cache directory (default: ~/.cache/tagdiff)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tagdiff-0.1.1.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tagdiff-0.1.1-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file tagdiff-0.1.1.tar.gz.

File metadata

  • Download URL: tagdiff-0.1.1.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for tagdiff-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e0e5784d30c2ed76855a06527a3fa79f949b5ad6db9ef5624e2024b782ed2236
MD5 ca965cdfb0234afb074f453ab765c541
BLAKE2b-256 590a8b2e116c0e91f01b4c97729a18594d9355a5fa78aaa3a721a3d6fa9a7eb4

See more details on using hashes here.

File details

Details for the file tagdiff-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: tagdiff-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for tagdiff-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 36329ed2de2559a83bf68f5eba6cfaa369170965d62ca25129cb890ad3462e17
MD5 72ea8a966b1084136d9446424405c151
BLAKE2b-256 487938972ba476354a2b2cda1fce049f2a944d9626a357d98a1fca58ac57d167

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page