pdfgen-juanipis 0.1.3__py3-none-any.whl

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 (33) hide show
  1. pdfgen/__init__.py +17 -0
  2. pdfgen/api.py +69 -0
  3. pdfgen/assets/banner-clean.png +0 -0
  4. pdfgen/assets/banner.png +0 -0
  5. pdfgen/assets/fonts/BCDEEE_Calibri_5.ttf +0 -0
  6. pdfgen/assets/fonts/BCDFEE_CenturyGothic-Bold_9.ttf +0 -0
  7. pdfgen/assets/fonts/BCDGEE_CenturyGothic-Bold_14.ttf +0 -0
  8. pdfgen/assets/fonts/BCDHEE_Calibri-Bold_20.ttf +0 -0
  9. pdfgen/assets/fonts/BCDIEE_Calibri-Bold_25.ttf +0 -0
  10. pdfgen/assets/fonts/BCDJEE_Calibri_27.ttf +0 -0
  11. pdfgen/assets/fonts/BCDKEE_Calibri-Italic_33.ttf +0 -0
  12. pdfgen/assets/fonts/BCDLEE_Calibri-Italic_52.ttf +0 -0
  13. pdfgen/assets/fonts/BCDMEE_SegoeUI_54.ttf +0 -0
  14. pdfgen/assets/fonts/BCDNEE_SegoeUI_60.ttf +0 -0
  15. pdfgen/assets/fonts/BCDOEE_Aptos Narrow,Bold_142.ttf +0 -0
  16. pdfgen/assets/fonts/BCDPEE_Aptos Narrow,Bold_144.ttf +0 -0
  17. pdfgen/assets/fonts/BCEAEE_Aptos Narrow_149.ttf +0 -0
  18. pdfgen/assets/fonts/BCEBEE_Aptos Narrow_154.ttf +0 -0
  19. pdfgen/assets/fonts/TimesNewRomanPS-BoldMT_38.ttf +0 -0
  20. pdfgen/assets/logo.png +0 -0
  21. pdfgen/cli.py +106 -0
  22. pdfgen/pagination.py +1045 -0
  23. pdfgen/render.py +348 -0
  24. pdfgen/schema.json +126 -0
  25. pdfgen/templates/boletin.css +389 -0
  26. pdfgen/templates/boletin_template.html.jinja +129 -0
  27. pdfgen/validator.py +247 -0
  28. pdfgen_juanipis-0.1.3.dist-info/METADATA +170 -0
  29. pdfgen_juanipis-0.1.3.dist-info/RECORD +33 -0
  30. pdfgen_juanipis-0.1.3.dist-info/WHEEL +5 -0
  31. pdfgen_juanipis-0.1.3.dist-info/entry_points.txt +2 -0
  32. pdfgen_juanipis-0.1.3.dist-info/licenses/LICENSE +21 -0
  33. pdfgen_juanipis-0.1.3.dist-info/top_level.txt +1 -0
@@ -0,0 +1,389 @@
1
+ @page {
2
+ size: Letter;
3
+ margin: 0;
4
+ }
5
+
6
+ :root {
7
+ --blue-title: #2e5395;
8
+ --orange-footer: #f58534;
9
+ --text: #000000;
10
+ }
11
+
12
+ @font-face {
13
+ font-family: 'Calibri';
14
+ src: url('../assets/fonts/BCDEEE_Calibri_5.ttf') format('truetype');
15
+ font-weight: 400;
16
+ font-style: normal;
17
+ }
18
+
19
+ @font-face {
20
+ font-family: 'Calibri';
21
+ src: url('../assets/fonts/BCDHEE_Calibri-Bold_20.ttf') format('truetype');
22
+ font-weight: 700;
23
+ font-style: normal;
24
+ }
25
+
26
+ @font-face {
27
+ font-family: 'Calibri';
28
+ src: url('../assets/fonts/BCDKEE_Calibri-Italic_33.ttf') format('truetype');
29
+ font-weight: 400;
30
+ font-style: italic;
31
+ }
32
+
33
+ @font-face {
34
+ font-family: 'Century Gothic';
35
+ src: url('../assets/fonts/BCDFEE_CenturyGothic-Bold_9.ttf') format('truetype');
36
+ font-weight: 700;
37
+ font-style: normal;
38
+ }
39
+
40
+ @font-face {
41
+ font-family: 'Times New Roman';
42
+ src: url('../assets/fonts/TimesNewRomanPS-BoldMT_38.ttf') format('truetype');
43
+ font-weight: 700;
44
+ font-style: normal;
45
+ }
46
+
47
+ @font-face {
48
+ font-family: 'Aptos Narrow';
49
+ src: url('../assets/fonts/BCEAEE_Aptos Narrow_149.ttf') format('truetype');
50
+ font-weight: 400;
51
+ font-style: normal;
52
+ }
53
+
54
+ @font-face {
55
+ font-family: 'Aptos Narrow';
56
+ src: url('../assets/fonts/BCDOEE_Aptos Narrow,Bold_142.ttf') format('truetype');
57
+ font-weight: 700;
58
+ font-style: normal;
59
+ }
60
+
61
+ html, body {
62
+ margin: 0;
63
+ padding: 0;
64
+ font-family: 'Calibri', sans-serif;
65
+ font-size: 12pt;
66
+ color: var(--text);
67
+ }
68
+
69
+ .page {
70
+ width: 8.5in;
71
+ height: 11in;
72
+ position: relative;
73
+ background: #ffffff;
74
+ overflow: hidden;
75
+ page-break-after: always;
76
+ }
77
+
78
+ .page:last-child {
79
+ page-break-after: auto;
80
+ }
81
+
82
+ .header-banner {
83
+ position: absolute;
84
+ top: 0;
85
+ left: 0.35pt;
86
+ width: 817.5pt;
87
+ height: 79.5pt;
88
+ object-fit: cover;
89
+ }
90
+
91
+ .header-logo {
92
+ position: absolute;
93
+ top: 13.95pt;
94
+ left: 498.25pt;
95
+ width: 81.41pt;
96
+ height: 36.75pt;
97
+ }
98
+
99
+ .header-title {
100
+ position: absolute;
101
+ top: 73.7pt;
102
+ left: 94.7pt;
103
+ width: 430pt;
104
+ font-family: 'Calibri', sans-serif;
105
+ font-size: 14pt;
106
+ font-weight: 700;
107
+ color: var(--blue-title);
108
+ line-height: 1.15;
109
+ }
110
+
111
+ .header-subtitle {
112
+ position: absolute;
113
+ top: 90.77pt;
114
+ left: 260.8pt;
115
+ width: 220pt;
116
+ font-family: 'Calibri', sans-serif;
117
+ font-size: 14pt;
118
+ font-weight: 700;
119
+ color: var(--blue-title);
120
+ line-height: 1.15;
121
+ }
122
+
123
+ .intro {
124
+ position: absolute;
125
+ top: 122.18pt;
126
+ left: 85.1pt;
127
+ width: 444pt;
128
+ font-size: 12pt;
129
+ line-height: 1.0;
130
+ }
131
+
132
+ .content {
133
+ position: absolute;
134
+ top: 150pt;
135
+ left: 85.1pt;
136
+ width: 444pt;
137
+ font-size: 12pt;
138
+ line-height: 1.1;
139
+ }
140
+
141
+ .content-block {
142
+ break-inside: avoid;
143
+ page-break-inside: avoid;
144
+ }
145
+
146
+ .content .section-title {
147
+ margin: 0 0 6pt 0;
148
+ font-family: 'Calibri', sans-serif;
149
+ font-size: 14.04pt;
150
+ font-weight: 700;
151
+ color: #000000;
152
+ }
153
+
154
+ .content .section-title .roman {
155
+ display: inline-block;
156
+ width: 32pt;
157
+ }
158
+
159
+ .content .section-subtitle {
160
+ margin: 10pt 0 12pt 0;
161
+ font-family: 'Calibri', sans-serif;
162
+ font-size: 14.04pt;
163
+ font-weight: 400;
164
+ color: var(--blue-title);
165
+ text-align: center;
166
+ }
167
+
168
+ .content .section-title-serif {
169
+ margin: 12pt 0 8pt 0;
170
+ font-family: 'Times New Roman', serif;
171
+ font-size: 14.04pt;
172
+ font-weight: 700;
173
+ color: #000000;
174
+ text-align: center;
175
+ }
176
+
177
+ .content p {
178
+ margin: 0 0 6pt 0;
179
+ font-size: 12pt;
180
+ }
181
+
182
+ .cover {
183
+ position: absolute;
184
+ top: 170pt;
185
+ left: 85.1pt;
186
+ width: 444pt;
187
+ text-align: center;
188
+ color: var(--blue-title);
189
+ }
190
+
191
+ .cover-title {
192
+ font-size: 20pt;
193
+ font-weight: 700;
194
+ line-height: 1.2;
195
+ margin-bottom: 10pt;
196
+ }
197
+
198
+ .cover-subtitle {
199
+ font-size: 14pt;
200
+ font-weight: 700;
201
+ margin-bottom: 12pt;
202
+ }
203
+
204
+ .cover-lines {
205
+ font-size: 11pt;
206
+ color: #333333;
207
+ line-height: 1.35;
208
+ }
209
+
210
+ .chart {
211
+ width: 100%;
212
+ height: auto;
213
+ display: block;
214
+ margin: 6pt 0 2pt 0;
215
+ }
216
+
217
+ .chart-caption {
218
+ font-size: 9pt;
219
+ font-style: italic;
220
+ color: #333333;
221
+ margin-bottom: 8pt;
222
+ }
223
+
224
+ .tabla-abaco {
225
+ border-collapse: collapse;
226
+ table-layout: fixed;
227
+ font-family: 'Aptos Narrow', sans-serif;
228
+ font-size: 11.04pt;
229
+ color: #000000;
230
+ margin: 6pt 0 10pt 0;
231
+ width: 532.66pt;
232
+ }
233
+
234
+ .tabla-abaco th,
235
+ .tabla-abaco td {
236
+ border: 0.6pt solid #000000;
237
+ padding: 2pt 4pt;
238
+ line-height: 1.0;
239
+ text-align: center;
240
+ overflow-wrap: break-word;
241
+ word-break: break-word;
242
+ }
243
+
244
+ .tabla-abaco thead th {
245
+ background: #d9d9d9;
246
+ font-weight: 700;
247
+ white-space: normal;
248
+ }
249
+
250
+ .tabla-abaco .col-dep {
251
+ text-align: left;
252
+ width: 120pt;
253
+ }
254
+
255
+ .tabla-abaco .col-num {
256
+ width: 58pt;
257
+ }
258
+
259
+ .table-wrap {
260
+ width: 532.66pt;
261
+ margin-left: -45.38pt;
262
+ }
263
+
264
+ .tabla-lg { width: 532.66pt; }
265
+ .tabla-md { width: 532.66pt; }
266
+ .tabla-sm { width: 532.66pt; }
267
+
268
+ .footer-meta {
269
+ position: absolute;
270
+ left: 85.1pt;
271
+ right: 85.1pt;
272
+ bottom: 70pt;
273
+ }
274
+
275
+ .refs {
276
+ margin-bottom: 8pt;
277
+ }
278
+
279
+ .refs-line {
280
+ width: 120pt;
281
+ border-top: 0.6pt solid #000000;
282
+ margin-bottom: 4pt;
283
+ }
284
+
285
+ .refs-text {
286
+ font-family: 'Calibri', sans-serif;
287
+ font-style: italic;
288
+ font-size: 8pt;
289
+ line-height: 1.1;
290
+ color: #000000;
291
+ }
292
+
293
+ .footer-notes {
294
+ font-size: 8pt;
295
+ line-height: 1.1;
296
+ color: #000000;
297
+ }
298
+
299
+ .footer-contact {
300
+ position: absolute;
301
+ left: 0;
302
+ right: 0;
303
+ bottom: 32pt;
304
+ text-align: center;
305
+ font-family: 'Century Gothic', sans-serif;
306
+ font-weight: 700;
307
+ font-size: 11.04pt;
308
+ color: var(--orange-footer);
309
+ line-height: 1.0;
310
+ }
311
+
312
+ .footer-page {
313
+ position: absolute;
314
+ left: 85.1pt;
315
+ bottom: 134pt;
316
+ font-size: 6.5pt;
317
+ color: #000000;
318
+ }
319
+
320
+ .report-title {
321
+ font-size: 20pt;
322
+ font-weight: 700;
323
+ text-align: center;
324
+ color: #2e5395;
325
+ margin-top: 12pt;
326
+ }
327
+
328
+ .report-subtitle {
329
+ font-size: 12pt;
330
+ font-weight: 700;
331
+ text-align: center;
332
+ color: #2e5395;
333
+ margin-top: 6pt;
334
+ margin-bottom: 12pt;
335
+ }
336
+
337
+ .section-subtitle {
338
+ font-size: 10pt;
339
+ color: #2e5395;
340
+ text-align: center;
341
+ margin-bottom: 8pt;
342
+ }
343
+
344
+ .figure {
345
+ display: block;
346
+ max-width: 100%;
347
+ height: auto;
348
+ margin: 8pt auto 4pt;
349
+ }
350
+
351
+ .figure-wide {
352
+ width: 100%;
353
+ }
354
+
355
+ .figure-caption {
356
+ font-size: 8pt;
357
+ color: #333;
358
+ text-align: center;
359
+ margin-bottom: 6pt;
360
+ }
361
+
362
+ .figure-source {
363
+ font-size: 8pt;
364
+ text-align: center;
365
+ margin-bottom: 10pt;
366
+ }
367
+
368
+ .map-grid {
369
+ display: flex;
370
+ gap: 10pt;
371
+ justify-content: space-between;
372
+ margin: 6pt 0 2pt;
373
+ }
374
+
375
+ .map-item {
376
+ width: 31%;
377
+ text-align: center;
378
+ }
379
+
380
+ .map-img {
381
+ width: 100%;
382
+ height: auto;
383
+ border-radius: 2pt;
384
+ }
385
+
386
+ .map-label {
387
+ font-weight: 700;
388
+ margin-top: 4pt;
389
+ }
@@ -0,0 +1,129 @@
1
+ <!DOCTYPE html>
2
+ <html lang="es">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <title>{{ title }}</title>
6
+ </head>
7
+ <body>
8
+ {% macro render_table(table) %}
9
+ {% set total_width = table.total_width or 532.66 %}
10
+ {% set dep_width = table.dep_width or 120.0 %}
11
+ {% set show_header = table.show_header if table.show_header is defined else true %}
12
+ {% set ns = namespace(num_cols=0) %}
13
+ {% for g in table.groups %}
14
+ {% set ns.num_cols = ns.num_cols + (g.months | length) %}
15
+ {% endfor %}
16
+ {% set num_cols = ns.num_cols %}
17
+ {% set num_width = (total_width - dep_width) / (num_cols if num_cols else 1) %}
18
+ <div class="table-wrap">
19
+ <table class="tabla-abaco">
20
+ <colgroup>
21
+ <col style="width: {{ '%.2f' % dep_width }}pt;">
22
+ {% for _ in range(num_cols) %}
23
+ <col style="width: {{ '%.2f' % num_width }}pt;">
24
+ {% endfor %}
25
+ </colgroup>
26
+ {% if show_header %}
27
+ <thead>
28
+ <tr>
29
+ <th class="col-dep" rowspan="2">Departamento/Mes</th>
30
+ {% for g in table.groups %}
31
+ <th class="col-num" colspan="{{ g.months | length }}">{{ g.title }}</th>
32
+ {% endfor %}
33
+ </tr>
34
+ <tr>
35
+ {% for g in table.groups %}
36
+ {% for month in g.months %}
37
+ <th class="col-num">{{ month }}</th>
38
+ {% endfor %}
39
+ {% endfor %}
40
+ </tr>
41
+ </thead>
42
+ {% endif %}
43
+ <tbody>
44
+ {% for row in table.rows %}
45
+ <tr>
46
+ <td class="col-dep">{{ row.dep }}</td>
47
+ {% for val in row.vals %}
48
+ <td>{{ val }}</td>
49
+ {% endfor %}
50
+ </tr>
51
+ {% endfor %}
52
+ </tbody>
53
+ </table>
54
+ </div>
55
+ {% endmacro %}
56
+
57
+ {% for page in pages %}
58
+ <div class="page">
59
+ <img class="header-banner" src="{{ page.header_banner_path_cont if not page.show_header_titles and page.header_banner_path_cont is defined else page.header_banner_path }}" alt="Banner" />
60
+ <img class="header-logo" src="{{ page.header_logo_path }}" alt="Logo" />
61
+
62
+ {% if page.show_header_titles %}
63
+ <div class="header-title" style="top: {{ page.header_title_top | default(73.7) }}pt; left: {{ page.header_title_left | default(94.7) }}pt; width: {{ page.header_title_width | default(430) }}pt; text-align: {{ page.header_title_align | default('left') }};">{{ page.title_line1 }}</div>
64
+ <div class="header-subtitle" style="top: {{ page.header_subtitle_top | default(90.77) }}pt; left: {{ page.header_subtitle_left | default(260.8) }}pt; width: {{ page.header_subtitle_width | default(220) }}pt; text-align: {{ page.header_subtitle_align | default('left') }};">{{ page.title_line2 }}</div>
65
+ {% endif %}
66
+
67
+ {% if page.cover %}
68
+ <div class="cover">
69
+ <div class="cover-title">{{ page.cover_title }}</div>
70
+ {% if page.cover_subtitle %}
71
+ <div class="cover-subtitle">{{ page.cover_subtitle }}</div>
72
+ {% endif %}
73
+ {% if page.cover_lines %}
74
+ <div class="cover-lines">
75
+ {% for line in page.cover_lines %}
76
+ <div>{{ line }}</div>
77
+ {% endfor %}
78
+ </div>
79
+ {% endif %}
80
+ </div>
81
+ {% else %}
82
+ <div class="intro" style="top: {{ page.intro_top | default(layout.intro_top) }}pt;">{{ page.intro }}</div>
83
+
84
+ <div class="content" style="top: {{ page.content_top | default(layout.content_top) }}pt;">
85
+ {% for block in page.blocks %}
86
+ <div class="content-block">
87
+ {% if block.type == "html" %}
88
+ {{ block.html | safe }}
89
+ {% elif block.type == "table" %}
90
+ {{ render_table(block.table) }}
91
+ {% endif %}
92
+ </div>
93
+ {% endfor %}
94
+ </div>
95
+ {% endif %}
96
+
97
+ {% if not page.cover and (page.refs or page.footer_notes) %}
98
+ <div class="footer-meta" style="bottom: {{ page.footer_meta_bottom | default(70) }}pt;">
99
+ {% if page.refs %}
100
+ <div class="refs">
101
+ <div class="refs-line"></div>
102
+ {% for ref in page.refs %}
103
+ <div class="refs-text">{{ ref }}</div>
104
+ {% endfor %}
105
+ </div>
106
+ {% endif %}
107
+
108
+ {% if page.footer_notes %}
109
+ <div class="footer-notes">
110
+ {% for note in page.footer_notes %}
111
+ <div>{{ note }}</div>
112
+ {% endfor %}
113
+ </div>
114
+ {% endif %}
115
+ </div>
116
+ {% endif %}
117
+
118
+ {% if page.page_number %}
119
+ <div class="footer-page">{{ page.page_number }}</div>
120
+ {% endif %}
121
+
122
+ <div class="footer-contact">
123
+ <div>{{ page.footer_site }}</div>
124
+ <div>{{ page.footer_phone }}</div>
125
+ </div>
126
+ </div>
127
+ {% endfor %}
128
+ </body>
129
+ </html>