postext 1.91.2__tar.gz → 1.92.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.
- {postext-1.91.2 → postext-1.92.0}/PKG-INFO +1 -1
- {postext-1.91.2 → postext-1.92.0}/src/postext/__init__.py +4 -0
- {postext-1.91.2 → postext-1.92.0}/src/postext/_client.py +36 -0
- {postext-1.91.2 → postext-1.92.0}/src/postext/_version.py +1 -1
- {postext-1.91.2 → postext-1.92.0}/.gitignore +0 -0
- {postext-1.91.2 → postext-1.92.0}/LICENSE +0 -0
- {postext-1.91.2 → postext-1.92.0}/README.md +0 -0
- {postext-1.91.2 → postext-1.92.0}/pyproject.toml +0 -0
- {postext-1.91.2 → postext-1.92.0}/src/postext/__main__.py +0 -0
- {postext-1.91.2 → postext-1.92.0}/src/postext/_args.py +0 -0
- {postext-1.91.2 → postext-1.92.0}/src/postext/_binary.py +0 -0
- {postext-1.91.2 → postext-1.92.0}/src/postext/_design_idml.py +0 -0
- {postext-1.91.2 → postext-1.92.0}/src/postext/_errors.py +0 -0
- {postext-1.91.2 → postext-1.92.0}/src/postext/_report.py +0 -0
- {postext-1.91.2 → postext-1.92.0}/src/postext/_runner.py +0 -0
- {postext-1.91.2 → postext-1.92.0}/src/postext/py.typed +0 -0
- {postext-1.91.2 → postext-1.92.0}/tests/conftest.py +0 -0
- {postext-1.91.2 → postext-1.92.0}/tests/test_args.py +0 -0
- {postext-1.91.2 → postext-1.92.0}/tests/test_binary.py +0 -0
- {postext-1.91.2 → postext-1.92.0}/tests/test_commands.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: postext
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.92.0
|
|
4
4
|
Summary: Typeset books from Python with Postext: PDF, HTML, EPUB, page images and Word from a .postext book or Markdown, through the self-contained postext command line.
|
|
5
5
|
Project-URL: Homepage, https://postext.dev/
|
|
6
6
|
Project-URL: Documentation, https://postext.dev/en/docs/command-line#python
|
|
@@ -46,6 +46,7 @@ _default = Postext()
|
|
|
46
46
|
pdf = _default.pdf
|
|
47
47
|
html = _default.html
|
|
48
48
|
epub = _default.epub
|
|
49
|
+
cover = _default.cover
|
|
49
50
|
image = _default.image
|
|
50
51
|
images = _default.images
|
|
51
52
|
docx = _default.docx
|
|
@@ -62,6 +63,7 @@ build = _default.build
|
|
|
62
63
|
pdf_bytes = _default.pdf_bytes
|
|
63
64
|
html_bytes = _default.html_bytes
|
|
64
65
|
epub_bytes = _default.epub_bytes
|
|
66
|
+
cover_bytes = _default.cover_bytes
|
|
65
67
|
image_bytes = _default.image_bytes
|
|
66
68
|
docx_bytes = _default.docx_bytes
|
|
67
69
|
idml_bytes = _default.idml_bytes
|
|
@@ -86,6 +88,7 @@ __all__ = [
|
|
|
86
88
|
"pdf",
|
|
87
89
|
"html",
|
|
88
90
|
"epub",
|
|
91
|
+
"cover",
|
|
89
92
|
"image",
|
|
90
93
|
"images",
|
|
91
94
|
"docx",
|
|
@@ -101,6 +104,7 @@ __all__ = [
|
|
|
101
104
|
"pdf_bytes",
|
|
102
105
|
"html_bytes",
|
|
103
106
|
"epub_bytes",
|
|
107
|
+
"cover_bytes",
|
|
104
108
|
"image_bytes",
|
|
105
109
|
"docx_bytes",
|
|
106
110
|
"idml_bytes",
|
|
@@ -90,6 +90,37 @@ class Postext(DesignIdmlCommands):
|
|
|
90
90
|
own = opt("layout", layout) + opt("cover", cover)
|
|
91
91
|
return self._book_command("epub", book, own, options, Report, out=out)
|
|
92
92
|
|
|
93
|
+
def cover(
|
|
94
|
+
self,
|
|
95
|
+
book: Books,
|
|
96
|
+
*,
|
|
97
|
+
out: Optional[PathLike] = None,
|
|
98
|
+
print_version: Optional[str] = None,
|
|
99
|
+
sheet: Optional[str] = None,
|
|
100
|
+
zone: Optional[str] = None,
|
|
101
|
+
color_space: Optional[str] = None,
|
|
102
|
+
pdfx: Optional[str] = None,
|
|
103
|
+
profile: Optional[PathLike] = None,
|
|
104
|
+
die_line: Optional[str] = None,
|
|
105
|
+
format: Optional[str] = None,
|
|
106
|
+
dpi: Optional[float] = None,
|
|
107
|
+
quality: Optional[int] = None,
|
|
108
|
+
**options: "Unpack[BookOptions]",
|
|
109
|
+
) -> Report:
|
|
110
|
+
"""The print cover of a version (``print_version``, default: the
|
|
111
|
+
book's first): the sheet as a PDF, or, with an ``out`` ending in
|
|
112
|
+
``.png``, ``.jpg`` or ``.webp`` (or a ``format``), one panel of it as
|
|
113
|
+
an image (``zone``: ``front`` by default, ``back``, ``spine``,
|
|
114
|
+
``flapFront``, ``flapBack`` or ``sheet``).
|
|
115
|
+
|
|
116
|
+
``sheet``: ``cover`` (default), ``jacket``, ``endpaper-front`` or
|
|
117
|
+
``endpaper-back``. The PDF options are ``pdf``'s.
|
|
118
|
+
"""
|
|
119
|
+
own = opt("print-version", print_version) + opt("sheet", sheet) + opt("zone", zone)
|
|
120
|
+
own += opt("color-space", color_space) + opt("pdfx", pdfx) + opt("profile", profile) + opt("die-line", die_line)
|
|
121
|
+
own += opt("format", format) + opt("dpi", dpi) + opt("quality", quality)
|
|
122
|
+
return self._book_command("cover", book, own, options, Report, out=out)
|
|
123
|
+
|
|
93
124
|
def image(
|
|
94
125
|
self,
|
|
95
126
|
book: Books,
|
|
@@ -302,6 +333,11 @@ class Postext(DesignIdmlCommands):
|
|
|
302
333
|
"""The EPUB's bytes."""
|
|
303
334
|
return content(self.epub(book, out=STDOUT, **kwargs))
|
|
304
335
|
|
|
336
|
+
def cover_bytes(self, book: Books, **kwargs: Any) -> bytes:
|
|
337
|
+
"""The cover sheet's PDF bytes, or with ``format`` an image of a
|
|
338
|
+
panel of it (the front cover unless ``zone`` names another)."""
|
|
339
|
+
return content(self.cover(book, out=STDOUT, **kwargs))
|
|
340
|
+
|
|
305
341
|
def image_bytes(self, book: Books, *, page: Union[int, str], **kwargs: Any) -> bytes:
|
|
306
342
|
"""One page's image bytes (PNG unless ``format`` says otherwise)."""
|
|
307
343
|
return content(self.image(book, page=page, out=STDOUT, **kwargs))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|