KDP Preflight CLI & Rules (kdp-preflight-cli)
Zero-dependency Python CLI and machine-readable JSON rules (kdp-rules.json) for calculating Amazon KDP paperback & hardcover spine width, full cover wrap size, minimum inside (gutter) margins, and 300 DPI image checks before you upload to KDP.
Quick start
Requires Python 3.10+. No external packages.
# Run directly with uvx (or pip install kdp-preflight-cli)
# 1. Inspect an actual exported PDF manuscript (page count, trim size, spine, wrap, KDP checks)
uvx kdp-preflight-cli pdf manuscript.pdf --paper white
# 2. Paperback cover wrap + spine calculation (5.5 × 8.5 in, 174 pages, white paper)
kdp-preflight cover --trim 5.5x8.5 --pages 174 --paper white
# 3. Hardcover (case laminate) cover wrap (6 × 9 in, 300 pages, cream paper)
kdp-preflight cover --trim 6x9 --pages 300 --paper cream --binding hardcover
# 4. Preflight check on margins, page range, trim, and image resolution
kdp-preflight check --trim 6x9 --pages 320 --paper white --inside 0.625 --outside 0.5 --image-px 1800x2700 --image-in 6x9
# JSON output for scripts or build pipelines (also works standalone via `python3 kdp_preflight.py`)
kdp-preflight pdf manuscript.pdf --paper cream --json
Amazon KDP reference rules
Minimum inside (gutter) margin by page count
| Pages | Minimum inside margin | Outside margin (no bleed) | Outside margin (with bleed) |
|---|---|---|---|
| 24–150 | 0.375 in |
0.25 in |
0.375 in |
| 151–300 | 0.500 in |
0.25 in |
0.375 in |
| 301–500 | 0.625 in |
0.25 in |
0.375 in |
| 501–700 | 0.750 in |
0.25 in |
0.375 in |
| 701–828 | 0.875 in |
0.25 in |
0.375 in |
Spine thickness & page limits (black-and-white interior)
- White paper:
0.002252 inper page · Paperback24–828pages - Cream paper:
0.002500 inper page · Paperback24–776pages - Spine text minimum (paperback):
79pages (with0.0625 inclearance to each fold) - Hardcover (case laminate):
75–550pages ·0.189 inadded to spine · supported trims:5.5×8.5,6×9,6.14×9.21,7×10,8.25×11in - Images: minimum
300 dpiat printed size
All formulas match Amazon KDP's cover calculator (G201953020, G201834180).
FAQ
What is the KDP minimum inside (gutter) margin by page count?
Amazon KDP steps the minimum inside margin up with page count: 0.375 in (24–150 pages), 0.5 in (151–300 pages), 0.625 in (301–500 pages), 0.75 in (501–700 pages), and 0.875 in (701–828 pages).
How do I calculate Amazon KDP paperback and hardcover spine width?
Multiply your even page count by 0.002252 in for white paper or 0.0025 in for cream paper. For KDP case-laminate hardcovers (75–550 pages), add 0.189 in to the paperback spine width. Run python3 kdp_preflight.py cover --trim 5.5x8.5 --pages 174 --paper white for exact wrap dimensions.
What causes most KDP paperback upload rejections?
The top three triggers are inside margins too narrow for the final page count, outside text crossing the 0.25 in (0.375 in with bleed) safe zone, and images below 300 dpi at print size. Glava runs these KDP checks live in the browser before exporting your print PDF, cover wrap, and EPUB 3.
Want automatic KDP typesetting + cover wrap in the browser?
If you want to drop in a .docx or Markdown manuscript and export a KDP-checked interior PDF, full cover wrap PDF, and EPUB 3 directly in your browser (Windows, Mac, Linux), check out Glava.
License
MIT
Metadata
Release files for kdp-preflight-cli 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| kdp_preflight_cli-0.1.0.tar.gz | 8.8 kB | Without provenance | Details for kdp_preflight_cli-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| kdp_preflight_cli-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for kdp_preflight_cli-0.1.0-py3-none-any.whl |
Total release size: 17.8 kB
Release files / kdp_preflight_cli-0.1.0.tar.gz
| Download URL | kdp_preflight_cli-0.1.0.tar.gz |
|---|---|
| Size | 8.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a592c0e80b2f73eca8a573c228c60750e4ac33185349a8b8416c66a8e9077577
|
|
BLAKE2b-256 checksum How to use checksums |
54afc6582bde4001df737c442ae9d15fd82fd837dbe706b62c280cc184d73055
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / kdp_preflight_cli-0.1.0-py3-none-any.whl
| Download URL | kdp_preflight_cli-0.1.0-py3-none-any.whl |
|---|---|
| Size | 8.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cfda0e243ea5376585648b8f36e878e4838969489f59cdc15ffe6b8287b515e0
|
|
BLAKE2b-256 checksum How to use checksums |
28cae55c9fb38abaab384bf31da71f8e0b5fc5298221648c1436e90e1d93d75d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for kdp-preflight-cli 0.1.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.