pestifer.util.readme_to_changelog_with_dates module

This script was written to do a one-time conversion of version notes in README.md to a CHANGELOG.md format. It extracts version information from Git tags and PyPI releases, then formats it into a changelog.

pestifer.util.readme_to_changelog_with_dates.extract_changelog_from_readme(readme_path: Path, version_dates: dict) str[source]

Extract the changelog from the README.md file. This function reads the README.md file, identifies the release history section, and formats the version notes into a changelog format. It uses the provided version_dates dictionary to include release dates. The changelog is formatted with version headings and bullet points for each item.

pestifer.util.readme_to_changelog_with_dates.get_git_tag_dates()[source]

Get the creation dates of Git tags. This function retrieves the tags from the Git repository, sorts them by creation date, and returns a dictionary mapping tag names to their creation dates. The dates are formatted as ‘YYYY-MM-DD’.

pestifer.util.readme_to_changelog_with_dates.get_pypi_release_dates(package_name: str) dict[source]

Get the release dates of a package from PyPI. This function queries the PyPI JSON API for the specified package, retrieves the release dates for each version, and returns a dictionary mapping version numbers to their release dates. The dates are formatted as ‘YYYY-MM-DD’.