Skip to main content

Git-based changelog generator from conventional commits

Project description

philiprehberger-changelog-gen

Tests PyPI version License

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

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.9.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

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

philiprehberger_changelog_gen-0.1.9-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for philiprehberger_changelog_gen-0.1.9.tar.gz
Algorithm Hash digest
SHA256 5cd8374311e59b2e377d715a3f707d49a38b838097f7ffad722c32e57a878a48
MD5 acb3885d4610f5ad740c00cb69c53642
BLAKE2b-256 fb16c82c0ab437d3368696efbc4f16763018df254b6f433cc82035508c7235c3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for philiprehberger_changelog_gen-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 20bfd1d4684bb297aa1f1f874bf7b30ddea2bba98c760e86ac2608140b95a8e5
MD5 0ffd23a14fa17b432a91ab6f1411456a
BLAKE2b-256 dd6568d3ad899550063ac9fc2743895178514092d2ec68ad3e24264b2b72043b

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