Skip to main content

towncrier is a utility to produce useful, summarised news files for your project. Rather than reading the Git history as some newer tools to produce it, or having one single file which developers all write to, towncrier reads “news fragments” which contain information useful to end users.

Philosophy

towncrier delivers the news which is convenient to those that hear it, not those that write it.

That is, by duplicating what has changed from the “developer log” (which may contain complex information about the original issue, how it was fixed, who authored the fix, and who reviewed the fix) into a “news fragment” (a small file containing just enough information to be useful to end users), towncrier can produce a digest of the changes which is valuable to those who may wish to use the software. These fragments are also commonly called “topfiles” or “newsfiles” in Twisted parlance.

towncrier works best in a development system where all merges involve closing a ticket.

Quick Start

Install from PyPI:

python3 -m pip install towncrier

In your project root, add a towncrier.ini file, with the contents:

[towncrier]
; Your project name
package = mypackage
; Where your project is kept -- current dir by default
package_dir = src/
; The filename that it will write to, relative to the current dir
filename = NEWS.rst

Then put news fragments (see “News Fragments” below) into a “newsfragments” directory under your package (so, if your project is named “myproject”, and it’s kept under src, your newsfragments dir would be src/myproject/newsfragments/).

To prevent git from removing the newsfragments directory, make a .gitignore file in it with:

!.gitignore

This will keep the folder around, but otherwise “empty”.

towncrier needs to know what version your project is, and there are two ways you can give it:

  • For Python 2/3 compatible projects, a __version__ in the top level package. This can be either a string literal, a tuple, or an Incremental version.

  • Manually passing --version=<myversionhere> when interacting with towncrier.

To produce a draft of the news file, run:

towncrier --draft

To produce the news file for real, run:

towncrier

This command will remove the news files (with git rm) and append the built news to the filename specified in towncrier.ini, and then stage the news file changes (with git add). It leaves committing the changes up to the user.

If you wish to have content at the top of the news file (for example, to say where you can find the tickets), put your text above a rST comment that says:

.. towncrier release notes start

towncrier will then put the version notes after this comment, and leave your existing content that was above it where it is.

News Fragments

towncrier has a few standard types of news fragments, signified by the file extension. These are:

  • .feature: Signifying a new feature.

  • .bugfix: Signifying a bug fix.

  • .doc: Signifying a documentation improvement.

  • .removal: Signifying a deprecation or removal of public API.

  • .misc: A ticket has been closed, but it is not of interest to users.

The start of the filename is the ticket number, and the content is what will end up in the news file. For example, if ticket #850 is about adding a new widget, the filename would be myproject/newsfragments/850.feature and the content would be myproject.widget has been added.

Metadata

Release files for towncrier 16.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for towncrier 16.0.0
File Size Uploaded Provenance Actions
towncrier-16.0.0.tar.gz 9.7 kB Without provenance Details for towncrier-16.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for towncrier 16.0.0
File Interpreter ABI Platform Actions
towncrier-16.0.0-py3-none-any.whl Python 3 none any Details for towncrier-16.0.0-py3-none-any.whl

Total release size: 24.0 kB

Release files / towncrier-16.0.0.tar.gz

Download URL towncrier-16.0.0.tar.gz
Size 9.7 kB
Tags Source
SHA-256 checksum
How to use checksums
50b12e6a756b5bf58a251f92515c1060ba19a9af95dcff15d70def0eb20d0e3a
BLAKE2b-256 checksum
How to use checksums
41815c6877282a1bfe5e296e986e03eae69c96606cc973e19263583295ff7443
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / towncrier-16.0.0-py3-none-any.whl

Download URL towncrier-16.0.0-py3-none-any.whl
Size 14.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eb1a9a198f476deb5e39d32edc67aa20135189c65ba787b23e31e828fa61e820
BLAKE2b-256 checksum
How to use checksums
0c4a5e0bb4c08bea73d348f57c4e0d57f9066b1e2e1fbee447e801966bdb6ec2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for towncrier 16.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

16.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page