graphpaper
Make printable graph paper as PDF or SVG from Python or the command line: square grids, dot grids, lined and handwriting paper, isometric and hexagon grids, and music staff / guitar tab paper.
- Exact size. Whole cells are fitted inside the margin and centred, so a 1/4 inch grid measures 1/4 inch when printed at 100% ("Actual size", not "Fit to page").
- Small files. Pure vector output. Multi-page PDFs share one content stream, so a 100-page notebook is barely bigger than one page.
- No dependencies. Pure Python 3.8+.
pip install graphpaper
Command line
graphpaper grid --spacing 0.25in --major 4 -o quarter-inch.pdf
graphpaper grid --spacing 5mm --size a4 --major 2 -o 5mm.pdf
graphpaper dot --spacing 5mm --size a4 --pages 50 -o dot-notebook.pdf
graphpaper lined --spacing 0.75in --midline --header --no-margin-line -o handwriting.pdf
graphpaper isometric --spacing 0.5in -o iso.svg
graphpaper hex --spacing 0.577in -o one-inch-hexes.pdf # 1 in across the flats
graphpaper staff --spacing 2mm --staves 12 -o staff.pdf
graphpaper staff --spacing 2.5mm --staves 8 --tab -o guitar-tab.pdf
Run graphpaper --help for every option. The output format follows the file extension (.pdf or .svg).
Python
import graphpaper
graphpaper.save("quarter-inch.pdf", "grid", spacing="0.25in", major=4)
graphpaper.save("dots.pdf", "dot", spacing="5mm", size="a4", pages=50)
data = graphpaper.pdf("lined", spacing="0.28125in", header=True) # bytes
svg = graphpaper.svg("isometric", spacing="0.5in", color="#999999") # str
page = graphpaper.layout("grid", spacing="1cm", size="a4")
print(page.info) # {'columns': 19, 'rows': 28}
Lengths are strings with a unit ("5mm", "0.25in", "1cm", "18pt") or plain numbers in inches.
| Kind | spacing means |
Useful options |
|---|---|---|
grid |
square size | major (every Nth line bold), border, header |
dot |
distance between dots | major (bigger dot every Nth), dot_size |
lined |
line gap (college ruled = 9/32 in, wide = 11/32 in) | midline, margin_line, header |
isometric |
triangle side | major, border |
isodot |
triangle side | dot_size |
hex |
hexagon side (across the flats = side × √3) | |
staff |
gap between staff lines | staves, staff_lines=6 (TAB), grand |
Common options: size (letter, a4, legal, tabloid, a3, a5 or a (width, height) tuple),
landscape, margin, color, major_color, weight, major_weight (points).
Notes
- Isometric lines all pass through one lattice point at the centre of the page, so the vertical lines meet the diagonals exactly on every page size.
- Hexagon edges shared by two cells are drawn once, which keeps lines even and files small.
- For e-ink tablets, set
sizeto the screen size, e.g. reMarkable 2:size=("6.212in", "8.283in").
This package is the Python counterpart of the browser generator at https://graphpaperpdf.net/, which also has coordinate planes, polar, semi-log and log-log paper, Cornell notes and engineering pads.
License
MIT
Metadata
Release files for graphpaper 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 |
|---|---|---|---|---|
| graphpaper-0.1.0.tar.gz | 12.1 kB | Without provenance | Details for graphpaper-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| graphpaper-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for graphpaper-0.1.0-py3-none-any.whl |
Total release size: 23.0 kB
Release files / graphpaper-0.1.0.tar.gz
| Download URL | graphpaper-0.1.0.tar.gz |
|---|---|
| Size | 12.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b33829267d14eacdd9136173ecc6dd459c876ecdf5d376a74bfc36e54f34898c
|
|
BLAKE2b-256 checksum How to use checksums |
fdc059994e48f99a9f517b9205ac59d22d2b6987260594fee571a464444c5171
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.8.10
|
Release files / graphpaper-0.1.0-py3-none-any.whl
| Download URL | graphpaper-0.1.0-py3-none-any.whl |
|---|---|
| Size | 10.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
99da4c23126b279185d52057b7eba9dc443816d55fae24c345ea8f18effce2ff
|
|
BLAKE2b-256 checksum How to use checksums |
4766a597a4bd2b5cbbeda7083694cabbf62ea37fcc2dc927438001b0c40f2cfd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.8.10
|
Security for graphpaper 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.