Skip to main content

flake8-only-english

⭐️ Thanks everyone who has starred the project, it means a lot!

PyPI version Install from PyPI by clicking the badge above

GitHub
View the source code on GitHub

Downloads License

Flake8 plugin that enforces corporate code style by detecting and reporting any only-english text in Python source code.
It ensures that comments, docstrings, and string literals are written in English only, maintaining consistency across the codebase.


Features

  • Scans Python files for only-english characters in:
    • Comments (# ...)
    • Docstrings (""" ... """ / ''' ... ''')
    • String literals ("..." / '...')
  • Raises a linting error (NL001) when only-english text is found.
  • Works seamlessly with Flake8 and pre-commit hooks.
  • Lightweight and dependency-minimal.

Installation

pip install flake8-only-english

Usage

Run normally via flake8:

flake8 app
flake8 --select=NLE
flake8 --select=NLE001
flake8 --select=NLE002

Example output:

/example.py:5:10: NLE001 Non-English text in docstring

Example

# This is a valid English comment
def hello():
    """Valid English docstring"""
    msg = "Hello world"
    return msg

Example (with pre-commit)

Add to .pre-commit-config.yaml:

repos:
  - repo: https://github.com/AlgorithmAlchemy/flake8-only-english
    rev: v0.1.0
    hooks:
      - id: flake8
        additional_dependencies: [ flake8-only-english ]

Run:

pre-commit run --all-files

Error Codes

  • NLE001 — Non-English text in docstring.
  • NLE002 — Non-English text in string literal

Development

Clone and install in editable mode:

git clone https://github.com/AlgorithmAlchemy/flake8-only-english
cd flake8-only-english
pip install -e .[dev]
pytest

License

MIT License © 2025 AlgorithmAlchemy

Metadata

Release files for flake8-only-english 0.3.3

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

Source distribution (sdist)

Source distribution for flake8-only-english 0.3.3
File Size Uploaded Provenance
flake8_only_english-0.3.3.tar.gz 7.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for flake8-only-english 0.3.3
File Interpreter ABI Platform
flake8_only_english-0.3.3-py3-none-any.whl Python 3 none any Details

Total release size: 12.6 kB

Release files / flake8_only_english-0.3.3.tar.gz

Download URL flake8_only_english-0.3.3.tar.gz
Size 7.5 kB
Tags Source
SHA-256 checksum
How to use checksums
153ef8165835421cdaae97b30ab67cd46bc26ec1e19ba61e5e76986d05458380
BLAKE2b-256 checksum
How to use checksums
b2aae2d49021649625b1d1cc87cbb518ad29b90c515df946330d46be272362dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / flake8_only_english-0.3.3-py3-none-any.whl

Download URL flake8_only_english-0.3.3-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
14f3ded68ed3e8264de202fb9ff19e9a3952fb71f9f80374da9c927274fc0a00
BLAKE2b-256 checksum
How to use checksums
0923e9c6a19729ec65e0b3df44f4bb2e40e4ec36efa51363e66e2ee64a011e1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Security for flake8-only-english 0.3.3

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

0.3.3 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