Skip to main content

A package to auto-generate changelogs from git commits using OpenAI's APIs

Project description

Logedit

Logedit is a Python utility that auto-generates changelogs from git commits using OpenAI's APIs.

Installation

You can install Logedit from PyPI:

pip install logedit

You'll also need to set your OpenAI API key:

export OPENAI_API_KEY='your-api-key-here'

Usage

You can specify the version, the path to the changelog file, the AI model, and whether to append the new entry to the original changelog file using the --version, --changelog, --gpt3, and --append arguments, respectively:

logedit --version [current_version] --changelog [changelog_file] --gpt3 --append

The --version parameter can be used to specify both the old and new version in the format old_version:new_version. If only the new version is provided, Logedit will get the most recent version tag in your git repository as the old version. If no new version is provided or "HEAD" is given, GPT-4 will try to infer the new version based on the changes found in the commits.

The --changelog parameter is the path to your CHANGELOG.md file.

The --gpt3 flag can be added to use the GPT-3.5 Turbo model for generating the changelog. If it's not provided, GPT-4 will be used by default.

If --append is provided, the new changelog entry will be automatically appended to the specified changelog file.

If you're generating a changelog for version 0.2 with version 0.1 as the old version and your CHANGELOG.md is in the same directory, you would use the command:

logedit --version 0.1:0.2 --changelog CHANGELOG.md --append

If you only provide the new version 0.2, Logedit will consider the most recent tagged release in your repository as the old version:

logedit --version 0.2 --changelog CHANGELOG.md --append

Shorter aliases -v for version, -c for changelog, -3 for GPT-3, and -a for append are also available:

logedit -v 0.2 -c CHANGELOG.md -3 -a

How it Works

Logedit retrieves all commits between the old and new versions specified. It then uses OpenAI's GPT-4 (or GPT-3.5 Turbo, if specified) to summarize each commit.

Next, it feeds the tail of your current CHANGELOG.md file, the new version (or its best guess if not specified or "HEAD" is provided), and the commit summaries to the selected AI model and generates a changelog entry in the same format as your existing CHANGELOG.md.

If the --append option is used, the new entry is automatically added to your changelog file.

Change Log

See CHANGELOG.md.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

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

logedit-0.1.1.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

logedit-0.1.1-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: logedit-0.1.1.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for logedit-0.1.1.tar.gz
Algorithm Hash digest
SHA256 550449e931d08209b85da4a686332e5662dbc3344296ecba5832e4fc1cb8ade1
MD5 05d7d9a0ae9944c904043f72b18086db
BLAKE2b-256 7df24d4a01fbcc5e5f97f4f8ec8baa8d49f7a452b708d2f30fd698416611d881

See more details on using hashes here.

File details

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

File metadata

  • Download URL: logedit-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for logedit-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 de3bf1415ea1dd46602c1cfedbf7f9c0d5af7a2cd37715541144db5332bafe55
MD5 4694aeaf6be690334f8faba51f7543ba
BLAKE2b-256 01f4f41319716ad248fe5a688db63eaaf27bdae61f61d98796dabce8088582bd

See more details on using hashes here.

Supported by

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