Metadata-Version: 2.4
Name: fragcha
Version: 0.1.5
Summary: Tool to generate a changelog from changelog fragments
License-Expression: AGPL-3.0-only
Project-URL: Repository, https://gitea.holm.dev/kjh/fragcha
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: agpl-3.0.md
License-File: LICENSE.md
Requires-Dist: PyYAML~=6.0.0
Requires-Dist: semver~=3.0.0
Requires-Dist: json5~=0.15.0
Requires-Dist: Jinja2~=3.0.0
Dynamic: license-file

# Fragcha - Automate changelog from fragments
## Installation
```
pip install fragcha
```
## Usage
```
usage: python -m fragcha [-h] [--fragments FRAGMENTS] [--config CONFIG] {bump,changelog} ...

positional arguments:
  {bump,changelog}
    bump                Generate subsequent semver based on changelog fragments
    changelog           Generate changelog from fragments

options:
  -h, --help            show this help message and exit
  --fragments FRAGMENTS
                        Folder with changelog fragments (.yaml or .yml)
  --config CONFIG       Path to config file
```

```
usage: python -m fragcha bump [-h] --version VERSION [--output OUTPUT] [--ignore-major-zero]

options:
  -h, --help           show this help message and exit
  --version VERSION    Current version for which to generate the subsequent semver
  --output OUTPUT      File append changelog to (- for stdout)
  --ignore-major-zero  Don't treat major version 0 special (use to move from 0.X.Y to 1.0.0)
```

```
usage: python -m fragcha changelog [-h] [--version VERSION] [--output OUTPUT] [--append]

options:
  -h, --help         show this help message and exit
  --version VERSION  Version number to use in changelog header
  --output OUTPUT    File append changelog to (- for stdout)
  --append           Append to output file instead of prepending
```

## Example changelog fragment
Without any extra configuration fragcha will check the `.fragcha` directory for `yml` and `yaml` files to generate a
changelog from. This is an example with all sections that are available by default:
```yaml
breaking_changes:
  - This is a major change, it will cause `fragcha bump` to increase the major version (except when on major version 0)
features:
  - This is a minor change, it will cause `fragcha bump` to increase the minor version
bugfixes:
  - This is a patch change, it will cause `fragcha bump` to increase the patch version
documentation:
  - This is a misc change, it will cause `fragcha bump` to increase the patch version
```

## Example config
The build in defaults are equivalent to this `fragcha.json5` being present:
```json5
{
  "sections": {
    "major": {
      "breaking_changes": "Breaking Changes"
    },
    "minor": {
      "features": "Features"
    },
    "patch": {
      "bugfixes": "Fixed bugs"
    },
    "misc": {
      "documentation": "Documentation"
    }
  },
  "template": "# {{ version }}\n\
\n\
{%- for section in sections %}\n\
## {{ section.title }}\n\
{%- for change in section['changes'] %}\n\
- {{ change }}\n\
{%- endfor %}\n\
{%- endfor %}\n\
***\n\
"
}
```
