ai-changelog


Nameai-changelog JSON
Version 0.0.14 PyPI version JSON
download
home_page
SummaryA Python project that generates AI-based changelogs.
upload_time2023-12-11 18:11:37
maintainer
docs_urlNone
authorJoshua Sundance Bailey
requires_python>=3.7
licenseMIT License Copyright (c) 2023 Joshua Sundance Bailey Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords langchain changelog github openai developer-tools documentation
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ai_changelog

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![python](https://img.shields.io/badge/Python-3.7+-3776AB.svg?style=flat&logo=python&logoColor=white)](https://www.python.org)

[![Publish to PyPI](https://github.com/joshuasundance-swca/ai_changelog/actions/workflows/publish_on_pypi.yml/badge.svg)](https://github.com/joshuasundance-swca/ai_changelog/actions/workflows/publish_on_pypi.yml)
![GitHub tag (with filter)](https://img.shields.io/github/v/tag/joshuasundance-swca/ai_changelog)

[![Push to Docker Hub](https://github.com/joshuasundance-swca/ai_changelog/actions/workflows/docker-hub.yml/badge.svg)](https://github.com/joshuasundance-swca/ai_changelog/actions/workflows/docker-hub.yml)
[![Docker Image Size (tag)](https://img.shields.io/docker/image-size/joshuasundance/ai_changelog/latest)](https://hub.docker.com/r/joshuasundance/ai_changelog)

![Code Climate maintainability](https://img.shields.io/codeclimate/maintainability/joshuasundance-swca/ai_changelog)
![Code Climate issues](https://img.shields.io/codeclimate/issues/joshuasundance-swca/ai_changelog)
![Code Climate technical debt](https://img.shields.io/codeclimate/tech-debt/joshuasundance-swca/ai_changelog)

[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v1.json)](https://github.com/charliermarsh/ruff)
[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

[![security: bandit](https://img.shields.io/badge/security-bandit-yellow.svg)](https://github.com/PyCQA/bandit)
![Known Vulnerabilities](https://snyk.io/test/github/joshuasundance-swca/ai_changelog/badge.svg)

[![Update AI Changelog on Push to Main](https://github.com/joshuasundance-swca/ai_changelog/actions/workflows/ai_changelog_main_push.yml/badge.svg)](https://github.com/joshuasundance-swca/ai_changelog/actions/workflows/ai_changelog_main_push.yml)

`ai_changelog` is a Python project that automatically generates changelog files summarizing code changes, using AI.

It uses [LangChain](https://github.com/langchain-ai/langchain) and [OpenAI](https://openai.com/) models to analyze Git commit diffs and generate natural language descriptions of the changes. This allows maintaining an up-to-date changelog without manual effort.

This README was originally written by Claude, an LLM from Anthropic.

## Usage

```bash
usage: ai_changelog [-h] [--provider {openai,anthropic,anyscale}] [--model MODEL] [--temperature TEMPERATURE] [--max_tokens MAX_TOKENS] [--hub_prompt HUB_PROMPT]
                    [--context_lines CONTEXT_LINES] [--max_concurrency MAX_CONCURRENCY] [-v]
                    refs

Process command line arguments.

positional arguments:
  refs                  Reference comparison with standard git syntax

options:
  -h, --help            show this help message and exit
  --provider {openai,anthropic,anyscale}
                        Model API provider
  --model MODEL         Model name
  --temperature TEMPERATURE
                        Model temperature
  --max_tokens MAX_TOKENS
                        Max tokens in output
  --hub_prompt HUB_PROMPT
                        Prompt to pull from LangChain Hub
  --context_lines CONTEXT_LINES
                        Number of context lines for each commit
  --max_concurrency MAX_CONCURRENCY
                        Number of concurrent connections to llm provider (0 means no limit)
  -v, --verbose         Run LangChain in verbose mode

http://github.com/joshuasundance-swca/ai_changelog
```

### Local install

To generate a changelog locally:

```bash
pip install ai_changelog

ai_changelog --help
ai_changelog main..HEAD  # to summarize changes locally
```

### Docker

```bash
docker pull joshuasundance/ai_changelog:latest
docker run \
    --env-file .env \
    -v /local_repo_dir:/container_dir_in_repo \
    -w /container_dir_in_repo \
    joshuasundance/ai_changelog:latest \
    main..HEAD
```

### GitHub Workflow

The [ai_changelog_main_pr.yml](.github/workflows/ai_changelog_main_push.yml) workflow runs on pushes to `main`.

It generates summaries for the new commits and appends them to `AI_CHANGELOG.md`. The updated file is then committed back to the PR branch.

```bash
ai_changelog origin/main^..origin/main  # in a GitHub action to summarize changes in response to a push to main
ai_changelog origin/main..HEAD  # in a GitHub action to summarize changes in response to a PR
```

Another flow was made to commit an updated changelog to an incoming PR before it was merged, but that seemed less useful although it did work well.

## Configuration

- Set environment variables as needed for your provider of choice (default requires `OPENAI_API_KEY`).
- Set LangSmith environment variables to enable LangSmith integration, if applicable.
- Use command line arguments.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.


## TODO

- Testing
- Get CodeLlama working reliably in CICD (currently hit or miss on structured output)

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "ai-changelog",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "langchain,changelog,github,openai,developer-tools,documentation",
    "author": "Joshua Sundance Bailey",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/b9/97/8409d7a1c3e60e8bd13dd05ff12d365e5c938c1ef338742d641622816ede/ai_changelog-0.0.14.tar.gz",
    "platform": null,
    "description": "# ai_changelog\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![python](https://img.shields.io/badge/Python-3.7+-3776AB.svg?style=flat&logo=python&logoColor=white)](https://www.python.org)\n\n[![Publish to PyPI](https://github.com/joshuasundance-swca/ai_changelog/actions/workflows/publish_on_pypi.yml/badge.svg)](https://github.com/joshuasundance-swca/ai_changelog/actions/workflows/publish_on_pypi.yml)\n![GitHub tag (with filter)](https://img.shields.io/github/v/tag/joshuasundance-swca/ai_changelog)\n\n[![Push to Docker Hub](https://github.com/joshuasundance-swca/ai_changelog/actions/workflows/docker-hub.yml/badge.svg)](https://github.com/joshuasundance-swca/ai_changelog/actions/workflows/docker-hub.yml)\n[![Docker Image Size (tag)](https://img.shields.io/docker/image-size/joshuasundance/ai_changelog/latest)](https://hub.docker.com/r/joshuasundance/ai_changelog)\n\n![Code Climate maintainability](https://img.shields.io/codeclimate/maintainability/joshuasundance-swca/ai_changelog)\n![Code Climate issues](https://img.shields.io/codeclimate/issues/joshuasundance-swca/ai_changelog)\n![Code Climate technical debt](https://img.shields.io/codeclimate/tech-debt/joshuasundance-swca/ai_changelog)\n\n[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v1.json)](https://github.com/charliermarsh/ruff)\n[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\n[![security: bandit](https://img.shields.io/badge/security-bandit-yellow.svg)](https://github.com/PyCQA/bandit)\n![Known Vulnerabilities](https://snyk.io/test/github/joshuasundance-swca/ai_changelog/badge.svg)\n\n[![Update AI Changelog on Push to Main](https://github.com/joshuasundance-swca/ai_changelog/actions/workflows/ai_changelog_main_push.yml/badge.svg)](https://github.com/joshuasundance-swca/ai_changelog/actions/workflows/ai_changelog_main_push.yml)\n\n`ai_changelog` is a Python project that automatically generates changelog files summarizing code changes, using AI.\n\nIt uses [LangChain](https://github.com/langchain-ai/langchain) and [OpenAI](https://openai.com/) models to analyze Git commit diffs and generate natural language descriptions of the changes. This allows maintaining an up-to-date changelog without manual effort.\n\nThis README was originally written by Claude, an LLM from Anthropic.\n\n## Usage\n\n```bash\nusage: ai_changelog [-h] [--provider {openai,anthropic,anyscale}] [--model MODEL] [--temperature TEMPERATURE] [--max_tokens MAX_TOKENS] [--hub_prompt HUB_PROMPT]\n                    [--context_lines CONTEXT_LINES] [--max_concurrency MAX_CONCURRENCY] [-v]\n                    refs\n\nProcess command line arguments.\n\npositional arguments:\n  refs                  Reference comparison with standard git syntax\n\noptions:\n  -h, --help            show this help message and exit\n  --provider {openai,anthropic,anyscale}\n                        Model API provider\n  --model MODEL         Model name\n  --temperature TEMPERATURE\n                        Model temperature\n  --max_tokens MAX_TOKENS\n                        Max tokens in output\n  --hub_prompt HUB_PROMPT\n                        Prompt to pull from LangChain Hub\n  --context_lines CONTEXT_LINES\n                        Number of context lines for each commit\n  --max_concurrency MAX_CONCURRENCY\n                        Number of concurrent connections to llm provider (0 means no limit)\n  -v, --verbose         Run LangChain in verbose mode\n\nhttp://github.com/joshuasundance-swca/ai_changelog\n```\n\n### Local install\n\nTo generate a changelog locally:\n\n```bash\npip install ai_changelog\n\nai_changelog --help\nai_changelog main..HEAD  # to summarize changes locally\n```\n\n### Docker\n\n```bash\ndocker pull joshuasundance/ai_changelog:latest\ndocker run \\\n    --env-file .env \\\n    -v /local_repo_dir:/container_dir_in_repo \\\n    -w /container_dir_in_repo \\\n    joshuasundance/ai_changelog:latest \\\n    main..HEAD\n```\n\n### GitHub Workflow\n\nThe [ai_changelog_main_pr.yml](.github/workflows/ai_changelog_main_push.yml) workflow runs on pushes to `main`.\n\nIt generates summaries for the new commits and appends them to `AI_CHANGELOG.md`. The updated file is then committed back to the PR branch.\n\n```bash\nai_changelog origin/main^..origin/main  # in a GitHub action to summarize changes in response to a push to main\nai_changelog origin/main..HEAD  # in a GitHub action to summarize changes in response to a PR\n```\n\nAnother flow was made to commit an updated changelog to an incoming PR before it was merged, but that seemed less useful although it did work well.\n\n## Configuration\n\n- Set environment variables as needed for your provider of choice (default requires `OPENAI_API_KEY`).\n- Set LangSmith environment variables to enable LangSmith integration, if applicable.\n- Use command line arguments.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n\n## TODO\n\n- Testing\n- Get CodeLlama working reliably in CICD (currently hit or miss on structured output)\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 Joshua Sundance Bailey  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "A Python project that generates AI-based changelogs.",
    "version": "0.0.14",
    "project_urls": {
        "Homepage": "https://github.com/joshuasundance-swca/ai_changelog"
    },
    "split_keywords": [
        "langchain",
        "changelog",
        "github",
        "openai",
        "developer-tools",
        "documentation"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dce160ad34da9200d853a090d683115410f9c9a698b8ee1e875454bfd880874f",
                "md5": "b3b9e9cbae6efe2e4d3c779ed85faed6",
                "sha256": "cd20e710b1291ea60a7048e0b88cf73072367585617822a25b737494576485e1"
            },
            "downloads": -1,
            "filename": "ai_changelog-0.0.14-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b3b9e9cbae6efe2e4d3c779ed85faed6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 10161,
            "upload_time": "2023-12-11T18:11:36",
            "upload_time_iso_8601": "2023-12-11T18:11:36.693172Z",
            "url": "https://files.pythonhosted.org/packages/dc/e1/60ad34da9200d853a090d683115410f9c9a698b8ee1e875454bfd880874f/ai_changelog-0.0.14-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b9978409d7a1c3e60e8bd13dd05ff12d365e5c938c1ef338742d641622816ede",
                "md5": "fac086282d679554982cb1970e39f5ca",
                "sha256": "49cb4ea4b339a6547dcfb529f6f7b17834240c3ebd8905933a508c50f0a2b6be"
            },
            "downloads": -1,
            "filename": "ai_changelog-0.0.14.tar.gz",
            "has_sig": false,
            "md5_digest": "fac086282d679554982cb1970e39f5ca",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 10662,
            "upload_time": "2023-12-11T18:11:37",
            "upload_time_iso_8601": "2023-12-11T18:11:37.798181Z",
            "url": "https://files.pythonhosted.org/packages/b9/97/8409d7a1c3e60e8bd13dd05ff12d365e5c938c1ef338742d641622816ede/ai_changelog-0.0.14.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-11 18:11:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "joshuasundance-swca",
    "github_project": "ai_changelog",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "ai-changelog"
}
        
Elapsed time: 0.14794s