poster-tile-planner 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 js-upup
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,36 @@
1
+ Metadata-Version: 2.4
2
+ Name: poster-tile-planner
3
+ Version: 0.1.0
4
+ Summary: Plan poster printing across sheets using physical dimensions, margins, and overlap.
5
+ Author: js-upup
6
+ License-Expression: MIT
7
+ Project-URL: Tiled Printing, https://tiledprinting.org/
8
+ Keywords: printing,poster,tiles,paper
9
+ Requires-Python: >=3.9
10
+ Description-Content-Type: text/markdown
11
+ License-File: LICENSE
12
+ Dynamic: license-file
13
+
14
+ # Poster Tile Planner
15
+
16
+ Calculate how many physical sheets a large poster needs, then export the layout
17
+ as JSON for a print or cropping workflow. Runs locally with Python 3.9+ and has
18
+ no third-party runtime dependencies.
19
+
20
+ ```sh
21
+ pip install poster-tile-planner
22
+ poster-tile-planner --poster 600 400 --paper 210 297 --margin 5 --overlap 10
23
+ ```
24
+
25
+ This layout uses two rows and four columns, with a 200 x 287 mm printable area.
26
+ Each tile has a one-based row and column and a source box in millimetres
27
+ `[left, top, right, bottom]`, measured from the poster's top-left corner.
28
+ For example, the first tile covers `[0.0, 0.0, 200.0, 287.0]`.
29
+
30
+ Set paper width and height in the desired orientation. The same margin is applied
31
+ to all paper edges. Neighbouring tiles share the requested overlap, and tiles
32
+ at the right and bottom edges stop at the poster boundary. This tool returns
33
+ geometry for up to 10,000 sheets and does not render images or create a PDF.
34
+
35
+ If you already have an image and want to split it into printable pages in your
36
+ browser, use [Tiled Printing](https://tiledprinting.org/).
@@ -0,0 +1,23 @@
1
+ # Poster Tile Planner
2
+
3
+ Calculate how many physical sheets a large poster needs, then export the layout
4
+ as JSON for a print or cropping workflow. Runs locally with Python 3.9+ and has
5
+ no third-party runtime dependencies.
6
+
7
+ ```sh
8
+ pip install poster-tile-planner
9
+ poster-tile-planner --poster 600 400 --paper 210 297 --margin 5 --overlap 10
10
+ ```
11
+
12
+ This layout uses two rows and four columns, with a 200 x 287 mm printable area.
13
+ Each tile has a one-based row and column and a source box in millimetres
14
+ `[left, top, right, bottom]`, measured from the poster's top-left corner.
15
+ For example, the first tile covers `[0.0, 0.0, 200.0, 287.0]`.
16
+
17
+ Set paper width and height in the desired orientation. The same margin is applied
18
+ to all paper edges. Neighbouring tiles share the requested overlap, and tiles
19
+ at the right and bottom edges stop at the poster boundary. This tool returns
20
+ geometry for up to 10,000 sheets and does not render images or create a PDF.
21
+
22
+ If you already have an image and want to split it into printable pages in your
23
+ browser, use [Tiled Printing](https://tiledprinting.org/).
@@ -0,0 +1,19 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "poster-tile-planner"
7
+ version = "0.1.0"
8
+ description = "Plan poster printing across sheets using physical dimensions, margins, and overlap."
9
+ readme = "README.md"
10
+ license = "MIT"
11
+ requires-python = ">=3.9"
12
+ authors = [{name = "js-upup"}]
13
+ keywords = ["printing", "poster", "tiles", "paper"]
14
+
15
+ [project.scripts]
16
+ poster-tile-planner = "poster_tile_planner:main"
17
+
18
+ [project.urls]
19
+ "Tiled Printing" = "https://tiledprinting.org/"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,65 @@
1
+ """Calculate tiled print layouts in millimetres."""
2
+
3
+ import argparse
4
+ import json
5
+ from math import ceil
6
+ from decimal import Decimal, InvalidOperation
7
+ from fractions import Fraction
8
+
9
+
10
+ def millimetres(text):
11
+ try:
12
+ value = Decimal(text)
13
+ if value.is_finite() and 0 <= value <= 1_000_000 and value.as_tuple().exponent >= -3:
14
+ return Fraction(value)
15
+ except InvalidOperation:
16
+ pass
17
+ raise argparse.ArgumentTypeError("enter 0 to 1000000 mm with up to three decimal places")
18
+
19
+
20
+ def tile_count(length, printable, overlap):
21
+ if length <= printable:
22
+ return 1
23
+ return 1 + ceil((length - printable) / (printable - overlap))
24
+
25
+
26
+ def main():
27
+ parser = argparse.ArgumentParser(description=__doc__)
28
+ parser.add_argument("--poster", nargs=2, type=millimetres, required=True, metavar=("WIDTH", "HEIGHT"))
29
+ parser.add_argument("--paper", nargs=2, type=millimetres, required=True, metavar=("WIDTH", "HEIGHT"))
30
+ parser.add_argument("--margin", type=millimetres, default=Fraction(0), help="Uniform margin on each edge")
31
+ parser.add_argument("--overlap", type=millimetres, default=Fraction(0), help="Overlap between neighbouring tiles")
32
+ args = parser.parse_args()
33
+
34
+ width, height = args.poster
35
+ printable_width, printable_height = (size - 2 * args.margin for size in args.paper)
36
+ if min(width, height) <= 0:
37
+ parser.error("poster dimensions must be positive")
38
+ if min(printable_width, printable_height) <= args.overlap:
39
+ parser.error("both printable dimensions must exceed the overlap")
40
+
41
+ columns = tile_count(width, printable_width, args.overlap)
42
+ rows = tile_count(height, printable_height, args.overlap)
43
+ if rows * columns > 10_000:
44
+ parser.error("layout exceeds the 10000-tile limit")
45
+
46
+ tiles = []
47
+ for row in range(rows):
48
+ for column in range(columns):
49
+ left = column * (printable_width - args.overlap)
50
+ top = row * (printable_height - args.overlap)
51
+ right = min(left + printable_width, width)
52
+ bottom = min(top + printable_height, height)
53
+ tiles.append({
54
+ "row": row + 1,
55
+ "column": column + 1,
56
+ "source_box_mm": [float(edge) for edge in (left, top, right, bottom)],
57
+ })
58
+
59
+ print(json.dumps({
60
+ "rows": rows,
61
+ "columns": columns,
62
+ "total_pages": len(tiles),
63
+ "printable_area_mm": [float(printable_width), float(printable_height)],
64
+ "tiles": tiles,
65
+ }, indent=2))
@@ -0,0 +1,36 @@
1
+ Metadata-Version: 2.4
2
+ Name: poster-tile-planner
3
+ Version: 0.1.0
4
+ Summary: Plan poster printing across sheets using physical dimensions, margins, and overlap.
5
+ Author: js-upup
6
+ License-Expression: MIT
7
+ Project-URL: Tiled Printing, https://tiledprinting.org/
8
+ Keywords: printing,poster,tiles,paper
9
+ Requires-Python: >=3.9
10
+ Description-Content-Type: text/markdown
11
+ License-File: LICENSE
12
+ Dynamic: license-file
13
+
14
+ # Poster Tile Planner
15
+
16
+ Calculate how many physical sheets a large poster needs, then export the layout
17
+ as JSON for a print or cropping workflow. Runs locally with Python 3.9+ and has
18
+ no third-party runtime dependencies.
19
+
20
+ ```sh
21
+ pip install poster-tile-planner
22
+ poster-tile-planner --poster 600 400 --paper 210 297 --margin 5 --overlap 10
23
+ ```
24
+
25
+ This layout uses two rows and four columns, with a 200 x 287 mm printable area.
26
+ Each tile has a one-based row and column and a source box in millimetres
27
+ `[left, top, right, bottom]`, measured from the poster's top-left corner.
28
+ For example, the first tile covers `[0.0, 0.0, 200.0, 287.0]`.
29
+
30
+ Set paper width and height in the desired orientation. The same margin is applied
31
+ to all paper edges. Neighbouring tiles share the requested overlap, and tiles
32
+ at the right and bottom edges stop at the poster boundary. This tool returns
33
+ geometry for up to 10,000 sheets and does not render images or create a PDF.
34
+
35
+ If you already have an image and want to split it into printable pages in your
36
+ browser, use [Tiled Printing](https://tiledprinting.org/).
@@ -0,0 +1,9 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ src/poster_tile_planner/__init__.py
5
+ src/poster_tile_planner.egg-info/PKG-INFO
6
+ src/poster_tile_planner.egg-info/SOURCES.txt
7
+ src/poster_tile_planner.egg-info/dependency_links.txt
8
+ src/poster_tile_planner.egg-info/entry_points.txt
9
+ src/poster_tile_planner.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ poster-tile-planner = poster_tile_planner:main
@@ -0,0 +1 @@
1
+ poster_tile_planner