Skip to main content

Plagx Preflight for Python

A free academic writing tool by Plagiarism Checker X.

Plagx Preflight for Python is a free, open-source draft checker for Python. Use it as an essay checker before you submit: it checks the word count and structure, matches in-text citations against the reference list, and gives punctuation and basic grammar suggestions plus readability stats.

  • No dependencies, works offline: your text never leaves the machine
  • Python 3.9+, typed
  • APA and MLA citation checks
  • Command line with JSON output and CI-friendly exit codes
  • Results identical to the JavaScript version, offsets included

Try the live demo →

Developer downloads: PyPI · npm · Packagist · Docker Hub · GitHub

Plagx Preflight is a free academic writing utility by Plagiarism Checker X. It checks length, structure, references, punctuation and basic grammar, and every result is a suggestion. Plagiarism checking and AI-generated text detection are available in Plagiarism Checker X, linked at the end of this page.

Install

pip install plagx-preflight

Quick start

from plagx_preflight import check_draft

result = check_draft(text, min_words=1500, max_words=2000, style="apa",
                     required_headings=["Introduction", "Conclusion"])

result["stats"]
# {'words': 1620, 'sentences': 84, 'paragraphs': 12, 'characters': 9811,
#  'readingTimeMinutes': 9, 'fleschReadingEase': 48.2}

for issue in result["issues"]:
    print(f"{issue['line']}:{issue['column']} {issue['level']} {issue['message']}")
# 5:14 warning Suggestion: "the the" looks like a repeated word.

Command line

plagx-preflight check essay.txt --min-words 1500 --max-words 2000 --style apa
plagx-preflight check essay.md --json
plagx-preflight stats essay.txt
cat essay.txt | plagx-preflight check -
python -m plagx_preflight --help
Option Meaning
--min-words <n>, --max-words <n> Word limits (reference list excluded)
--style apa|mla Citation style (default apa)
--checks <list> Comma-separated check groups
--require-heading <name> Required heading, repeatable
--strict Count warnings as failures
--json JSON output

Exit codes: 0 no errors, 1 errors found (with --strict, warnings too), 2 usage or input error. Accepts .txt and .md.

API

check_draft(text, *, min_words=None, max_words=None, style="apa", checks=None, required_headings=()) returns a dict with stats, errors, warnings, infos and issues. Each issue has level, code, message, start, end, line, column, text and suggestion. Issues are sorted by position.

start, end and column count UTF-16 code units, like JavaScript, so results match the other Plagx Preflight libraries exactly. For Python string slicing, use text or line and column (they differ only after emoji and other characters outside the Basic Multilingual Plane).

Option Default
min_words, max_words None Word limits (reference list excluded)
style "apa" "apa" or "mla"
checks all except "passive-voice" length, references, punctuation, grammar, passive-voice
required_headings () e.g. ["Introduction", "Conclusion"]

Helpers: count_words(text), split_sentences(text), find_citations(text, style), VERSION, CHECKS. Invalid options raise ValueError.

Checks

Group Codes Level
Length & structure word-count-low, word-count-high, long-sentence (over 40 words), long-paragraph (over 250 words), single-sentence-paragraph, missing-heading warning / info
References citation-no-reference, missing-reference-section, reference-not-cited, et-al-format error / warning
Punctuation unmatched-quote, unmatched-bracket, double-space, space-before-punctuation, missing-space-after-punctuation, repeated-punctuation, mixed-quote-styles warning / info
Grammar repeated-word, a-an, sentence-capital, lowercase-i, common-confusion, passive-voice (off by default) warning / info

Good to know

  • Every result is a suggestion. The grammar rules are deliberately conservative, so they miss some mistakes rather than flag correct text.
  • The reference list starts at a heading such as References, Bibliography or Works Cited. It is excluded from the word count and from the punctuation and grammar checks.

Development

pip install -e . pytest
pytest

tests/parity/expected.json and tests/fixtures/ come from the JavaScript reference (npm run parity in plagx-preflight). Every case must match exactly. src/plagx_preflight/_unicode.py holds Unicode letter classes generated from the JavaScript regex engine (node scripts/build_unicode.mjs), because Python's re module has no \p{...}.

Plagx Preflight - Free Draft & Grammar Checker

An open-source writing utility for students, researchers and developers. Check length, structure, citations, punctuation and basic grammar before you submit.

Developed by Plagiarism Checker X.

Plagx Preflight gives writing suggestions; it does not detect plagiarism or AI-generated text. For full document checks, explore Plagiarism Checker X and its AI Content Detector.

License

MIT © Plagiarism Checker X

Metadata

Release files for plagx-preflight 0.1.2

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

Source distribution (sdist)

Source distribution for plagx-preflight 0.1.2
File Size Uploaded Provenance Actions
plagx_preflight-0.1.2.tar.gz 31.1 kB With provenance Details for plagx_preflight-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for plagx-preflight 0.1.2
File Interpreter ABI Platform Actions
plagx_preflight-0.1.2-py3-none-any.whl Python 3 none any Details for plagx_preflight-0.1.2-py3-none-any.whl

Total release size: 59.8 kB

Release files / plagx_preflight-0.1.2.tar.gz

Download URL plagx_preflight-0.1.2.tar.gz
Size 31.1 kB
Tags Source
SHA-256 checksum
How to use checksums
7d33b653af99158fa58dff7fa2cf4f498d705dc6760095be7b9b4a67cd928d42
BLAKE2b-256 checksum
How to use checksums
aba0000eae8b3bb2d70f63485c1e54c7f509ec0f009dc89fe40741446e91f9e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

Release files / plagx_preflight-0.1.2-py3-none-any.whl

Download URL plagx_preflight-0.1.2-py3-none-any.whl
Size 28.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
95849e550ba89698ce25392b47c49ae393d2e677e7aa7afa9ec1483e1fd52f3f
BLAKE2b-256 checksum
How to use checksums
7e7af9d5bfda1c6d9221ec30c979970ac246f0563611bbb22603aa728577d079
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

Security for plagx-preflight 0.1.2

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for plagx_preflight-0.1.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

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.1.2 This release

2 release files Full 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