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.

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

Uploaded Source

Built Distribution

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

logedit-0.0.1-py3-none-any.whl (2.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for logedit-0.0.1.tar.gz
Algorithm Hash digest
SHA256 bf549e8bee6fbb0bcb27baa2379d4c377f866adc77a70abf6560eddf81d22872
MD5 302061beaea0f80c2d4afbdec20bbf52
BLAKE2b-256 f7f32f5e2ebc919fbfd09811c084500b7fd673dab68753ca771dc35a29b3f96b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: logedit-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.5 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.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e8e9a51b33214fe6c5649bb38e036b8df77108557b62ba6260bbf48652738727
MD5 9b453872c4b875bbaa3dd9e9dafb0f15
BLAKE2b-256 009357d9747271571ffa0020d5d852c1b743ed2a6cb399564db7a096bf43aa3c

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