pubmarq 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.
Files changed (72) hide show
  1. pubmarq-0.1.0/PKG-INFO +153 -0
  2. pubmarq-0.1.0/license +21 -0
  3. pubmarq-0.1.0/pubmarq/__init__.py +45 -0
  4. pubmarq-0.1.0/pubmarq/__main__.py +6 -0
  5. pubmarq-0.1.0/pubmarq/article.py +600 -0
  6. pubmarq-0.1.0/pubmarq/build.py +212 -0
  7. pubmarq-0.1.0/pubmarq/check.py +221 -0
  8. pubmarq-0.1.0/pubmarq/cli.py +164 -0
  9. pubmarq-0.1.0/pubmarq/emblems/umg-pl.svg +53 -0
  10. pubmarq-0.1.0/pubmarq/faces/CascadiaCode/CascadiaCode-Bold.ttf +0 -0
  11. pubmarq-0.1.0/pubmarq/faces/CascadiaCode/CascadiaCode-BoldItalic.ttf +0 -0
  12. pubmarq-0.1.0/pubmarq/faces/CascadiaCode/CascadiaCode-Italic.ttf +0 -0
  13. pubmarq-0.1.0/pubmarq/faces/CascadiaCode/CascadiaCode-Regular.ttf +0 -0
  14. pubmarq-0.1.0/pubmarq/faces/IBMPlexMono/IBMPlexMono-Bold.ttf +0 -0
  15. pubmarq-0.1.0/pubmarq/faces/IBMPlexMono/IBMPlexMono-BoldItalic.ttf +0 -0
  16. pubmarq-0.1.0/pubmarq/faces/IBMPlexMono/IBMPlexMono-Italic.ttf +0 -0
  17. pubmarq-0.1.0/pubmarq/faces/IBMPlexMono/IBMPlexMono-Regular.ttf +0 -0
  18. pubmarq-0.1.0/pubmarq/faces/OFL-CascadiaCode.txt +88 -0
  19. pubmarq-0.1.0/pubmarq/faces/OFL-IBMPlex.txt +88 -0
  20. pubmarq-0.1.0/pubmarq/faces/OFL-OpenSans.txt +88 -0
  21. pubmarq-0.1.0/pubmarq/faces/OFL-Sora.txt +88 -0
  22. pubmarq-0.1.0/pubmarq/faces/OFL-SourceSerif4.txt +88 -0
  23. pubmarq-0.1.0/pubmarq/faces/OFL-Tinos.txt +88 -0
  24. pubmarq-0.1.0/pubmarq/faces/OpenSans/OpenSans-Bold.ttf +0 -0
  25. pubmarq-0.1.0/pubmarq/faces/OpenSans/OpenSans-BoldItalic.ttf +0 -0
  26. pubmarq-0.1.0/pubmarq/faces/OpenSans/OpenSans-Italic.ttf +0 -0
  27. pubmarq-0.1.0/pubmarq/faces/OpenSans/OpenSans-Regular.ttf +0 -0
  28. pubmarq-0.1.0/pubmarq/faces/OpenSansCondensed/OpenSansCondensed-Bold.ttf +0 -0
  29. pubmarq-0.1.0/pubmarq/faces/OpenSansCondensed/OpenSansCondensed-BoldItalic.ttf +0 -0
  30. pubmarq-0.1.0/pubmarq/faces/OpenSansCondensed/OpenSansCondensed-Italic.ttf +0 -0
  31. pubmarq-0.1.0/pubmarq/faces/OpenSansCondensed/OpenSansCondensed-Regular.ttf +0 -0
  32. pubmarq-0.1.0/pubmarq/faces/OpenSansSemiBold/OpenSansSemiBold-Bold.ttf +0 -0
  33. pubmarq-0.1.0/pubmarq/faces/OpenSansSemiBold/OpenSansSemiBold-BoldItalic.ttf +0 -0
  34. pubmarq-0.1.0/pubmarq/faces/OpenSansSemiBold/OpenSansSemiBold-Italic.ttf +0 -0
  35. pubmarq-0.1.0/pubmarq/faces/OpenSansSemiBold/OpenSansSemiBold-Regular.ttf +0 -0
  36. pubmarq-0.1.0/pubmarq/faces/Sora/Sora-Bold.ttf +0 -0
  37. pubmarq-0.1.0/pubmarq/faces/Sora/Sora-Regular.ttf +0 -0
  38. pubmarq-0.1.0/pubmarq/faces/SourceSerif4/SourceSerif4-Bold.ttf +0 -0
  39. pubmarq-0.1.0/pubmarq/faces/SourceSerif4/SourceSerif4-BoldItalic.ttf +0 -0
  40. pubmarq-0.1.0/pubmarq/faces/SourceSerif4/SourceSerif4-Italic.ttf +0 -0
  41. pubmarq-0.1.0/pubmarq/faces/SourceSerif4/SourceSerif4-Regular.ttf +0 -0
  42. pubmarq-0.1.0/pubmarq/faces/Tinos/Tinos-Bold.ttf +0 -0
  43. pubmarq-0.1.0/pubmarq/faces/Tinos/Tinos-BoldItalic.ttf +0 -0
  44. pubmarq-0.1.0/pubmarq/faces/Tinos/Tinos-Italic.ttf +0 -0
  45. pubmarq-0.1.0/pubmarq/faces/Tinos/Tinos-Regular.ttf +0 -0
  46. pubmarq-0.1.0/pubmarq/fonts.py +79 -0
  47. pubmarq-0.1.0/pubmarq/journal.py +348 -0
  48. pubmarq-0.1.0/pubmarq/journals.py +285 -0
  49. pubmarq-0.1.0/pubmarq/langs.py +82 -0
  50. pubmarq-0.1.0/pubmarq/layout.py +423 -0
  51. pubmarq-0.1.0/pubmarq/pages.py +30 -0
  52. pubmarq-0.1.0/pubmarq/refs.py +149 -0
  53. pubmarq-0.1.0/pubmarq/thesis_docx.py +414 -0
  54. pubmarq-0.1.0/pubmarq/thesis_pdf.py +422 -0
  55. pubmarq-0.1.0/pubmarq/to_docx.py +427 -0
  56. pubmarq-0.1.0/pubmarq/to_pdf.py +858 -0
  57. pubmarq-0.1.0/pubmarq/typography.py +69 -0
  58. pubmarq-0.1.0/pubmarq.egg-info/PKG-INFO +153 -0
  59. pubmarq-0.1.0/pubmarq.egg-info/SOURCES.txt +70 -0
  60. pubmarq-0.1.0/pubmarq.egg-info/dependency_links.txt +1 -0
  61. pubmarq-0.1.0/pubmarq.egg-info/entry_points.txt +2 -0
  62. pubmarq-0.1.0/pubmarq.egg-info/requires.txt +12 -0
  63. pubmarq-0.1.0/pubmarq.egg-info/top_level.txt +1 -0
  64. pubmarq-0.1.0/pyproject.toml +35 -0
  65. pubmarq-0.1.0/readme.md +130 -0
  66. pubmarq-0.1.0/setup.cfg +4 -0
  67. pubmarq-0.1.0/tests/test_article.py +193 -0
  68. pubmarq-0.1.0/tests/test_doctorate.py +265 -0
  69. pubmarq-0.1.0/tests/test_layers.py +63 -0
  70. pubmarq-0.1.0/tests/test_text.py +118 -0
  71. pubmarq-0.1.0/tests/test_thesis.py +423 -0
  72. pubmarq-0.1.0/tests/test_writers.py +677 -0
pubmarq-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,153 @@
1
+ Metadata-Version: 2.4
2
+ Name: pubmarq
3
+ Version: 0.1.0
4
+ Summary: Scientific articles and theses from markdown, set for a journal as PDF and DOCX
5
+ Author: Xaeian
6
+ License-Expression: MIT
7
+ Project-URL: Repository, https://github.com/Xaeian/PubMarQ
8
+ Keywords: journal,article,thesis,markdown,pdf,docx,ieee
9
+ Requires-Python: >=3.12
10
+ Description-Content-Type: text/markdown
11
+ License-File: license
12
+ Requires-Dist: docmarq[md]>=0.5.1
13
+ Requires-Dist: pdfmarq[md]>=0.7.1
14
+ Requires-Dist: markdown-it-py
15
+ Requires-Dist: Pillow
16
+ Requires-Dist: xaeian>=1.2.2
17
+ Requires-Dist: rlPyCairo
18
+ Provides-Extra: pages
19
+ Requires-Dist: xaeian[media]; extra == "pages"
20
+ Provides-Extra: all
21
+ Requires-Dist: xaeian[media]; extra == "all"
22
+ Dynamic: license-file
23
+
24
+ # PubMarQ
25
+
26
+ Scientific articles and theses from markdown, set as each journal or school wants them: PDF through [PDFMarQ](https://github.com/Xaeian/PDFMarQ), DOCX through [DocMarQ](https://github.com/Xaeian/DocMarQ).
27
+ Source says what the article is, its journal profile how it looks, so one markdown file goes to every journal pubmarq knows.
28
+
29
+ ## Install
30
+
31
+ ```sh
32
+ pip install pubmarq # articles and theses
33
+ pip install pubmarq[pages] # + PDF pages a dissertation sets in
34
+ ```
35
+
36
+ ## Use
37
+
38
+ ```sh
39
+ py -m pubmarq build paper.md ijet # paper.ijet.pdf and .docx
40
+ py -m pubmarq build paper.md ijet --blind # + copies for blind review
41
+ py -m pubmarq check paper.md ijet # preflight only
42
+ py -m pubmarq journals # known journals
43
+ ```
44
+
45
+ `-j` answers in one JSON document.
46
+ Exit code: 0 with nothing to fix, 1 after errors, 2 for wrong arguments.
47
+
48
+ ```py
49
+ from pubmarq import build
50
+ result = build("paper.md", "ijet", out_dir="out")
51
+ result.files, result.pages, result.issues
52
+ ```
53
+
54
+ ## Journals
55
+
56
+ | Key | Journal | Layout |
57
+ | --- | --- | --- |
58
+ | `ijet` | International Journal of Electronics and Telecommunications | IEEE, two columns, Times New Roman 10pt |
59
+ | `pe` | Przegląd Elektrotechniczny | Polish or English, two abstracts, Times New Roman 10.5pt, DOCX in Arial 9pt |
60
+ | `mdpi` | MDPI journals | one column, Palatino, general rules |
61
+ | `umg` | Gdynia Maritime University: diploma thesis | title page form, statement, both sides, Source Serif 4 and Sora |
62
+ | `umg-dr` | Gdynia Maritime University: doctoral dissertation | as `umg`, Rector's title page, articles set in |
63
+
64
+ Profiles are `Journal` dataclasses, so variants are one `replace` away:
65
+
66
+ ```py
67
+ from dataclasses import replace
68
+ from pubmarq import JOURNALS, build
69
+ build("paper.md", replace(JOURNALS["ijet"], key="ijet-short", pages=(4, 6)))
70
+ ```
71
+
72
+ ## Article
73
+
74
+ ```md
75
+ ---
76
+ title: A Shared Register Specification as the Source of Complete Modbus RTU Device Support
77
+ short_title: Shared register specification # running head
78
+ lang: en # else the journal's
79
+ title_pl: Wspólna specyfikacja rejestrów # second title PE prints
80
+ author:
81
+ - Emilian Świtalski, 0000-0002-5437-381X, e.switalski@we.umg.edu.pl
82
+ entity: Gdynia Maritime University
83
+ address: Morska 81/87, 81-225 Gdynia, Poland
84
+ published: IJET 2027, 73(1), 245-250 # once accepted
85
+ doi: 10.24425/ijet.2027.123456
86
+ ---
87
+
88
+ ### Abstract
89
+
90
+ One paragraph.
91
+
92
+ **Keywords:** first, second, third
93
+
94
+ ## Introduction
95
+
96
+ Text citing a work[^1], as Table 1 and Fig. 1 show.
97
+ ```
98
+
99
+ - `### Abstract` or `### Streszczenie` opens abstracts, `**Keywords:**` their keywords.
100
+ - `##` and `###` are sections and subsections, numbered as each journal numbers them.
101
+ - Footnotes are references, set in each journal's style.
102
+ - `> **Table 1.** title` over tables and `> **Figure 1.** caption` under pictures, each pair in `<!-- group -->`, make captions; `<!-- group wide -->` spans both columns.
103
+ - `\label{x}` in `$$` formulas and `\eqref{x}` in text refer to them by number.
104
+ - Articles in two languages may keep each in its own file, `paper.PL.md` and `paper.EN.md`, each taking from the other what it lacks.
105
+ - Blind copies leave out authors, their places, funding and acknowledgment.
106
+
107
+ ## Theses
108
+
109
+ ```md
110
+ ---
111
+ title: System monitorowania zużycia energii w instalacji okrętowej
112
+ title_en: Energy consumption monitoring in a ship installation
113
+ author: Jan Kowalski
114
+ album: 45678
115
+ degree: engineering # or master
116
+ faculty: Wydział Elektryczny
117
+ department: Katedra Elektroenergetyki Okrętowej
118
+ specialization: Elektroautomatyka okrętowa
119
+ supervisor: dr inż. Anna Nowak, prof. UMG
120
+ reviewer: dr hab. inż. Piotr Wiśniewski
121
+ date: 2027-01-15 # of the statement
122
+ oecd: Nauki inżynieryjne i techniczne, Elektrotechnika, elektronika, inżynieria informatyczna
123
+ ---
124
+ ```
125
+
126
+ - `umg` sets the title page form with university emblem, statement, contents, each chapter on its own page and abstracts at the back.
127
+ - `## Wykaz rysunków` and `## Wykaz tabel` list captions with their pages.
128
+ - `umg-dr` sets dissertations: Rector's title page, abstracts before contents, parts as `## Część I. ...`, and `![](article.pdf)` setting articles in as published.
129
+ - DOCX files carry their faces, and Word fills their contents on opening.
130
+
131
+ ## Preflight
132
+
133
+ Every build checks its article against the journal first, and `check` does only that: title, authors, abstracts and keywords, references and their DOIs, figures, tables and formulas never mentioned, raster figures under 300dpi, PDF page count, and what school forms need.
134
+
135
+ ```text
136
+ ERR No title in en, which PE prints too
137
+ TIP Add it: title_en: in the frontmatter, or keep the article in en beside it, as paper.EN.md
138
+ WRN 8 keywords in pl, PE takes 4–6
139
+ ERR 1 error, 1 warning
140
+ ```
141
+
142
+ ## Fonts
143
+
144
+ Both formats set faces each journal names: Times New Roman and others from the system, else metric twins from a `--fonts` folder.
145
+ pubmarq carries open faces it needs, under SIL Open Font License: Open Sans, Tinos, Cascadia Code, Source Serif 4, Sora and IBM Plex Mono.
146
+ Palatino of MDPI has no open twin.
147
+
148
+ ## Limits
149
+
150
+ - Word lays DOCX out on opening, so PDF page count is the guide.
151
+ - In DOCX, figures missing a column's rest leave gaps, and tables split between columns.
152
+ - MDPI profile follows general rules: check it against the journal's own.
153
+ - Dissertation DOCX names PDFs its PDF sets in, for pages to be added by hand.
pubmarq-0.1.0/license ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Xaeian Emilian Świtalski
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,45 @@
1
+ # pubmarq/__init__.py
2
+
3
+ """
4
+ Scientific articles and theses from markdown, set for a journal or a school:
5
+ PDF through pdfmarq, DOCX through docmarq.
6
+
7
+ The article says what it is, a journal profile how it looks,
8
+ so one source goes to any journal pubmarq has a profile for.
9
+
10
+ Example:
11
+ >>> from pubmarq import build
12
+ >>> build("paper.md", "ijet", out_dir="out").files
13
+ """
14
+
15
+ #--------------------------------------------------------------------------- Metadata for auto-toml
16
+
17
+ __version__ = "0.1.0"
18
+ __repo__ = "Xaeian/PubMarQ"
19
+ __python__ = ">=3.12" # as xaeian
20
+ __description__ = "Scientific articles and theses from markdown, set for a journal as PDF and DOCX"
21
+ __author__ = "Xaeian"
22
+ __keywords__ = ["journal", "article", "thesis", "markdown", "pdf", "docx", "ieee"]
23
+ __dependencies__ = [
24
+ "docmarq[md]>=0.5.1", "pdfmarq[md]>=0.7.1", "markdown-it-py", "Pillow", "xaeian>=1.2.2",
25
+ "rlPyCairo", # docmarq's, named so CI installs the system cairo pycairo builds against
26
+ ]
27
+ __scripts__ = {"pubmarq": "pubmarq.cli:main"}
28
+
29
+ #--------------------------------------------------------------------------------------- Public API
30
+
31
+ from .langs import Lang, LANGS
32
+ from .journal import Foot, Head, Journal, RunIn, School, Type
33
+ from .journals import JOURNALS, get_journal
34
+ from .article import Article, Parser, read
35
+ from .check import Issue, check
36
+ from .to_docx import write_docx
37
+ from .to_pdf import write_pdf
38
+ from .build import Result, build, preflight, read_md, read_file
39
+
40
+ __all__ = [
41
+ "Lang", "LANGS", "Foot", "Head", "RunIn", "School", "Type", "Journal", "JOURNALS", "get_journal",
42
+ "Article", "Parser", "read", "Issue", "check",
43
+ "write_docx", "write_pdf",
44
+ "Result", "build", "preflight", "read_md", "read_file",
45
+ ]
@@ -0,0 +1,6 @@
1
+ # pubmarq/__main__.py
2
+
3
+ import sys
4
+ from .cli import main
5
+
6
+ sys.exit(main())