Skip to main content

Validation, sanitization and metrics for Markdown manuscripts.

Project description

manuscript-tools

A QA toolkit for German Markdown manuscripts. Validates style, sanitizes encoding, converts quotation marks, and measures readability.

Deutsche Version | Wiki

Installation

pip install manuscript-tools

Or as project dependency:

poetry add manuscript-tools

Commands

Command Description
ms-check Style checks (5 core rules, --strict adds 3 prose rules)
ms-sanitize Fix encoding, strip invisible chars, normalize Unicode
ms-quotes Convert quotation marks to German typographic style „ " ‚ '
ms-metrics Word counts, sentence analysis, Flesch-DE readability score
ms-validate Full QA pipeline (sanitize + quotes + check + readability)

Quick start

# Full QA pipeline
ms-validate manuscript/

# Style check only (core rules)
ms-check manuscript/

# Style check with prose analysis (filler words, passive voice, sentence length)
ms-check manuscript/ --strict

# Readability report
ms-metrics manuscript/

# Fix quotation marks (dry-run)
ms-quotes manuscript/ --dry-run

Rules

Core (always active):

no-dashes, no-invisible-chars, no-repeated-words, no-double-spaces, non-german-quotes

Prose (with --strict or ms-validate):

max-sentence-length, filler-words-de, passive-voice-de

Custom rules are simple callables with the signature (text: str, path: Path) -> list[StyleViolation]. See the Wiki for a step-by-step tutorial.

Configuration

Configure via [tool.manuscript-tools] in your pyproject.toml:

[tool.manuscript-tools]
rules = ["max-sentence-length"]          # merge with defaults
disable = ["passive-voice-de"]           # remove from active set
max-sentence-words = 30                  # default: 40
flesch-target = [65, 80]                 # warn if outside range
filler-words-extra = ["definitiv", "absolut"]  # extend filler list

No config = all defaults. rules merges with defaults (union). disable removes from the active set and takes precedence over rules. See the Wiki for details.

Readability

ms-metrics computes the Flesch-DE reading ease score (Amstad, 1978) with German-optimized syllable counting. Score interpretation:

Score Level Typical use
80-100 Very easy Children's books
60-80 Easy to medium Fiction, non-fiction
30-60 Difficult Journalism, academic
0-30 Very difficult Legal, scientific

Development

git clone https://github.com/astrapi69/manuscript-tools.git
cd manuscript-tools
make install-dev
make ci          # lint + format check + 112 tests

Documentation

Full documentation is available in the Wiki:

License

BSD 3-Clause. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

manuscript_tools-0.5.0.tar.gz (19.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

manuscript_tools-0.5.0-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

File details

Details for the file manuscript_tools-0.5.0.tar.gz.

File metadata

  • Download URL: manuscript_tools-0.5.0.tar.gz
  • Upload date:
  • Size: 19.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.11.13 Linux/6.8.0-101-lowlatency

File hashes

Hashes for manuscript_tools-0.5.0.tar.gz
Algorithm Hash digest
SHA256 2de8247b6ac1900f1e1610c6693ffea456c850f7ecc5f8895b3930b2ba905e3c
MD5 928322d98034baccd3ccfd2136d098d9
BLAKE2b-256 ea6da680a645cf01b30f14a3fd8b443f704dd750fbc258ebdee9788aee340c95

See more details on using hashes here.

File details

Details for the file manuscript_tools-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: manuscript_tools-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 22.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.11.13 Linux/6.8.0-101-lowlatency

File hashes

Hashes for manuscript_tools-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 876d59b488801bc3cdf92222e319bca857f15f9962a1b3add129a36c01e2ee6d
MD5 46d4fb973c50eaac0f88c31979c822d4
BLAKE2b-256 76a0e52e3e7041df4c2372907514c4f1788f9df538f9c1cc977b21f83ec3d077

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page