Skip to main content

Git-based changelog generator from conventional commits

Project description

philiprehberger-changelog-gen

Tests PyPI version Last updated

Git-based changelog generator from conventional commits.

Installation

pip install philiprehberger-changelog-gen

Usage

Python API

from philiprehberger_changelog_gen import generate_changelog

changelog = generate_changelog(
    repo_path=".",
    from_tag="v0.1.0",
    version="0.2.0",
)

# Print markdown
print(changelog.to_markdown())

# Write to file (prepend to existing)
changelog.write("CHANGELOG.md", mode="prepend")

CLI

# Print to stdout
changelog-gen

# From a specific tag
changelog-gen --from v0.1.0 --version 0.2.0

# Write to file
changelog-gen --output CHANGELOG.md --prepend

Conventional Commits

The generator parses conventional commit messages:

feat: add user authentication
fix(auth): handle expired tokens
feat!: redesign API (breaking change)
chore: update dependencies

Commits are grouped by type: Features, Bug Fixes, Performance, Refactoring, Documentation, Tests, Chores, CI/CD, Build, Style.

Output Example

## 0.2.0 (2026-03-10)

### Breaking Changes

- **api:** redesign authentication flow

### Features

- add user dashboard
- **auth:** add OAuth2 support

### Bug Fixes

- **db:** fix connection pool leak

API

Function / Class Description
generate_changelog(repo_path, from_tag, to_ref, version, include_types, exclude_types) Generate a changelog from git history between tags/refs
Changelog Generated changelog content with to_markdown() and write(path, mode) methods
CommitEntry A parsed conventional commit (hash, type, scope, message, breaking, date, author)
main() CLI entrypoint for command-line usage

Development

pip install -e .
python -m pytest tests/ -v

Support

If you find this project useful:

Star the repo

🐛 Report issues

💡 Suggest features

❤️ Sponsor development

🌐 All Open Source Projects

💻 GitHub Profile

🔗 LinkedIn Profile

License

MIT

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

philiprehberger_changelog_gen-0.1.10.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file philiprehberger_changelog_gen-0.1.10.tar.gz.

File metadata

File hashes

Hashes for philiprehberger_changelog_gen-0.1.10.tar.gz
Algorithm Hash digest
SHA256 791d92586173fe7eee634b431a0837c5bd9b9850f9560c063b68b9d519b9731a
MD5 4e513cb15fd443927247d4c1d3d0dd17
BLAKE2b-256 f8b7af7841da1579cca8cd6beff15911d62e4fe14c61123cc4731d8c532d617f

See more details on using hashes here.

File details

Details for the file philiprehberger_changelog_gen-0.1.10-py3-none-any.whl.

File metadata

File hashes

Hashes for philiprehberger_changelog_gen-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 a67579491ba5f83706c19db492a7033920648733a3d0c243c9b09525b306c8ca
MD5 53738ef6b5f52b1cd51d62a1017e8cb1
BLAKE2b-256 cd01f05f0f6fbe8b55cfa31c1c7f77e80b389d47d9d5df80e5cf009f94c26faa

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