No project description provided
Project description
A flake8 plugin that validates the formatting of Google-style docstrings. The name is the museum-wall label affixed to the thing it describes: short, fixed-form explanatory text, checked for shape, bound to the artifact it annotates.
Install
pip install placard
placard registers itself with flake8 via the flake8.extension entry point. Once installed, flake8 discovers it automatically; no extra configuration is needed to start emitting PLC codes.
What it checks
placard does one job: given a docstring that exists, check that it is shaped the way the Google style guide demands. It does not decide whether a docstring should exist, and it does not check whether the docstring’s contents are true about the code.
Code |
Band |
Rule |
|---|---|---|
PLC101 |
summary |
Summary line is empty |
PLC102 |
summary |
Summary line does not end with a period |
PLC103 |
summary |
Summary line restates the function signature |
PLC104 |
summary |
Multi-line docstring has no blank line after summary |
PLC201 |
section |
Unrecognized section header |
PLC202 |
section |
Recognized section header with incorrect case |
PLC203 |
section |
Recognized section header missing its trailing colon |
PLC204 |
section |
Section header has trailing content after the colon |
PLC301 |
args |
Args: entry is not in name: description form |
PLC302 |
args |
Args: section is present but empty |
Recognized section headers: Args:, Attributes:, Raises:, Returns:, Yields:. Attributes: is included because Google style uses it in class docstrings to document instance attributes (e.g. dataclass fields), using the same name: description shape as Args: entries.
Types belong in the signature
placard requires Args: entries in the bare name: description form and rejects name (type): description. Every consumer of a docstring that cares about types already has the signature – IDEs, help(), Sphinx autodoc, mkdocstrings, pydoc – so a parenthesized type in the docstring duplicates information already visible an inch above, with the added cost of having to stay in sync.
This is the one place placard is more opinionated than the published Google spec, which calls both forms canonical. Projects that prefer the typed form can # noqa: PLC301 on the entries that use it.
Works with pydoclint
Two tools, one flake8 invocation, no overlap:
placard (PLC) – is the docstring shaped correctly?
pydoclint (DOC) – does the docstring agree with the code?
A lowercase args: with a ragged body is correct-by-pydoclint, wrong-by-placard. A perfectly formatted Args: block missing half the parameters is correct-by-placard, wrong-by-pydoclint. The prefixes differ, so the two compose cleanly in one flake8 run.
A placard-aligned pydoclint invocation:
pydoclint \
--style=google \
--skip-checking-short-docstrings=False \
--arg-type-hints-in-docstring=False \
--check-return-types=False \
--check-yield-types=False \
src/
--skip-checking-short-docstrings=False makes pydoclint reject description-only docstrings on functions that take arguments; the remaining flags align with placard’s opinion that types belong in the signature, not the docstring.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file placard-2026.5.30.83589.tar.gz.
File metadata
- Download URL: placard-2026.5.30.83589.tar.gz
- Upload date:
- Size: 11.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68c2fe3202594dc6972a15f37585c0ede02e0b3a9a66436e4d493e1d796b15ed
|
|
| MD5 |
74c7653f1a960365dae511ed073478c4
|
|
| BLAKE2b-256 |
b390c988cd22678338b079ccf4c7ca00b4118ae470d4c1530b6cac2ea782de53
|
Provenance
The following attestation bundles were made for placard-2026.5.30.83589.tar.gz:
Publisher:
release.yml on moshez/placard
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
placard-2026.5.30.83589.tar.gz -
Subject digest:
68c2fe3202594dc6972a15f37585c0ede02e0b3a9a66436e4d493e1d796b15ed - Sigstore transparency entry: 1676708178
- Sigstore integration time:
-
Permalink:
moshez/placard@9e6fc08889bf5de375eefea014ec88869b6374b7 -
Branch / Tag:
refs/heads/trunk - Owner: https://github.com/moshez
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9e6fc08889bf5de375eefea014ec88869b6374b7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file placard-2026.5.30.83589-py3-none-any.whl.
File metadata
- Download URL: placard-2026.5.30.83589-py3-none-any.whl
- Upload date:
- Size: 11.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a954b1a26e67092f6ad26f7403a6ac0b78616aa0c3eb445ab63ad23b45adee7f
|
|
| MD5 |
30ab8d23780072bc7b923f24a079f37f
|
|
| BLAKE2b-256 |
73b0b1e06e596ec51343d59bceac4e3116e8fd5c40b59d99d54516a1cd5b717a
|
Provenance
The following attestation bundles were made for placard-2026.5.30.83589-py3-none-any.whl:
Publisher:
release.yml on moshez/placard
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
placard-2026.5.30.83589-py3-none-any.whl -
Subject digest:
a954b1a26e67092f6ad26f7403a6ac0b78616aa0c3eb445ab63ad23b45adee7f - Sigstore transparency entry: 1676708215
- Sigstore integration time:
-
Permalink:
moshez/placard@9e6fc08889bf5de375eefea014ec88869b6374b7 -
Branch / Tag:
refs/heads/trunk - Owner: https://github.com/moshez
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9e6fc08889bf5de375eefea014ec88869b6374b7 -
Trigger Event:
push
-
Statement type: