philoch-bib-sdk 0.1.2__py3-none-any.whl → 0.1.4__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.
- philoch_bib_sdk/adapters/tabular_data/read_journal_volume_number_index.py +59 -0
- philoch_bib_sdk/converters/latex.py +6 -0
- philoch_bib_sdk/converters/plaintext/author/formatter.py +31 -0
- philoch_bib_sdk/converters/plaintext/author/parser.py +72 -0
- philoch_bib_sdk/converters/plaintext/bib_string_formatter.py +8 -0
- philoch_bib_sdk/converters/plaintext/bibitem/bibkey_formatter.py +21 -0
- philoch_bib_sdk/converters/plaintext/bibitem/bibkey_parser.py +144 -0
- philoch_bib_sdk/converters/plaintext/bibitem/date_formatter.py +37 -0
- philoch_bib_sdk/converters/plaintext/bibitem/date_parser.py +62 -0
- philoch_bib_sdk/converters/plaintext/bibitem/formatter.py +182 -0
- philoch_bib_sdk/converters/plaintext/bibitem/pages_formatter.py +13 -0
- philoch_bib_sdk/converters/plaintext/bibitem/pages_parser.py +63 -0
- philoch_bib_sdk/converters/plaintext/bibitem/parser.py +3 -0
- philoch_bib_sdk/converters/plaintext/journal/formatter.py +25 -0
- philoch_bib_sdk/converters/plaintext/journal/parser.py +36 -0
- philoch_bib_sdk/converters/plaintext/shared/renderable_formatter.py +25 -0
- philoch_bib_sdk/logic/default_models.py +315 -0
- philoch_bib_sdk/logic/functions/comparator.py +134 -0
- philoch_bib_sdk/logic/functions/journal_article_matcher.py +40 -0
- philoch_bib_sdk/logic/literals.py +7 -3
- philoch_bib_sdk/logic/models.py +226 -219
- {philoch_bib_sdk-0.1.2.dist-info → philoch_bib_sdk-0.1.4.dist-info}/METADATA +2 -1
- philoch_bib_sdk-0.1.4.dist-info/RECORD +28 -0
- {philoch_bib_sdk-0.1.2.dist-info → philoch_bib_sdk-0.1.4.dist-info}/WHEEL +1 -1
- philoch_bib_sdk-0.1.4.dist-info/entry_points.txt +3 -0
- philoch_bib_sdk-0.1.2.dist-info/RECORD +0 -8
- {philoch_bib_sdk-0.1.2.dist-info → philoch_bib_sdk-0.1.4.dist-info}/LICENSE +0 -0
philoch_bib_sdk/logic/models.py
CHANGED
|
@@ -1,8 +1,34 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
-
from typing import Tuple
|
|
2
|
+
from typing import Literal, Tuple, get_args
|
|
3
3
|
import attrs
|
|
4
4
|
|
|
5
|
-
from philoch_bib_sdk.logic.literals import TBibTeXEntryType, TEpoch, TLanguageID, TPubState
|
|
5
|
+
from philoch_bib_sdk.logic.literals import TBasicPubState, TBibTeXEntryType, TEpoch, TLanguageID, TPubState
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
type Maybe[T] = T | None
|
|
9
|
+
type MaybeStr[T] = T | Literal[""]
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@attrs.define(frozen=True, slots=True)
|
|
13
|
+
class BibStringAttr:
|
|
14
|
+
"""
|
|
15
|
+
A representation of the different forms of a string we may need for different purposes.
|
|
16
|
+
|
|
17
|
+
Args:
|
|
18
|
+
latex: formatted string for LaTeX, can be used in bib files
|
|
19
|
+
unicode: formatted string for Unicode, can be used in text. Produced from the LaTeX string
|
|
20
|
+
simplified: simplified string, can be used to match strings. Produced from the Unicode string
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
latex: str = ""
|
|
24
|
+
unicode: str = ""
|
|
25
|
+
simplified: str = ""
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
BibStringLiteral = Literal["latex", "unicode", "simplified"]
|
|
29
|
+
|
|
30
|
+
type TBibString = BibStringLiteral
|
|
31
|
+
BIB_STRING_VALUES: Tuple[str, ...] = get_args(BibStringLiteral)
|
|
6
32
|
|
|
7
33
|
|
|
8
34
|
############
|
|
@@ -13,33 +39,35 @@ from philoch_bib_sdk.logic.literals import TBibTeXEntryType, TEpoch, TLanguageID
|
|
|
13
39
|
@attrs.define(frozen=True, slots=True)
|
|
14
40
|
class BaseRenderable:
|
|
15
41
|
"""
|
|
16
|
-
Base class for renderable objects
|
|
42
|
+
Base class for renderable objects that contain a single 'text' attribute.
|
|
17
43
|
|
|
18
44
|
Args:
|
|
19
|
-
text:
|
|
20
|
-
|
|
21
|
-
id: int = -1
|
|
45
|
+
text: BibString
|
|
46
|
+
id: Maybe[int] = None
|
|
22
47
|
"""
|
|
23
48
|
|
|
24
|
-
text:
|
|
25
|
-
|
|
26
|
-
id: int = -1
|
|
49
|
+
text: BibStringAttr
|
|
50
|
+
id: Maybe[int] = None
|
|
27
51
|
|
|
28
52
|
|
|
29
53
|
@attrs.define(frozen=True, slots=True)
|
|
30
54
|
class BaseNamedRenderable:
|
|
31
55
|
"""
|
|
32
|
-
Base class for renderable
|
|
56
|
+
Base class for renderable objects that contain a single 'name' attribute.
|
|
33
57
|
|
|
34
58
|
Args:
|
|
35
|
-
name:
|
|
36
|
-
|
|
37
|
-
id: int | None = None
|
|
59
|
+
name: BibString
|
|
60
|
+
id: Maybe[int] = None
|
|
38
61
|
"""
|
|
39
62
|
|
|
40
|
-
name:
|
|
41
|
-
|
|
42
|
-
|
|
63
|
+
name: BibStringAttr
|
|
64
|
+
id: Maybe[int] = None
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
RenderablesLiteral = Literal["text", "name"]
|
|
68
|
+
|
|
69
|
+
type TRenderable = RenderablesLiteral
|
|
70
|
+
RENDERABLES_VALUES: Tuple[str, ...] = get_args(RenderablesLiteral)
|
|
43
71
|
|
|
44
72
|
|
|
45
73
|
############
|
|
@@ -53,21 +81,21 @@ class Author:
|
|
|
53
81
|
An author of a publication.
|
|
54
82
|
|
|
55
83
|
Args:
|
|
56
|
-
given_name:
|
|
57
|
-
family_name:
|
|
58
|
-
given_name_latex:
|
|
59
|
-
family_name_latex:
|
|
60
|
-
publications:
|
|
61
|
-
id: int =
|
|
84
|
+
given_name: BibStringAttr
|
|
85
|
+
family_name: BibStringAttr
|
|
86
|
+
given_name_latex: BibStringAttr
|
|
87
|
+
family_name_latex: BibStringAttr
|
|
88
|
+
publications: Tuple[BibItem] = []
|
|
89
|
+
id: Maybe[int] = None
|
|
62
90
|
"""
|
|
63
91
|
|
|
64
|
-
given_name:
|
|
65
|
-
family_name:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
famous_name:
|
|
69
|
-
publications: Tuple[BibItem, ...]
|
|
70
|
-
id: int =
|
|
92
|
+
given_name: BibStringAttr
|
|
93
|
+
family_name: BibStringAttr
|
|
94
|
+
mononym: BibStringAttr
|
|
95
|
+
shorthand: BibStringAttr
|
|
96
|
+
famous_name: BibStringAttr
|
|
97
|
+
publications: Tuple[BibItem, ...]
|
|
98
|
+
id: Maybe[int] = None
|
|
71
99
|
|
|
72
100
|
|
|
73
101
|
############
|
|
@@ -81,41 +109,21 @@ class Journal:
|
|
|
81
109
|
A journal that publishes publications.
|
|
82
110
|
|
|
83
111
|
Args:
|
|
84
|
-
name:
|
|
85
|
-
name_latex: str
|
|
86
|
-
issn_print: str
|
|
87
|
-
issn_electronic: str
|
|
88
|
-
id: int =
|
|
89
|
-
"""
|
|
90
|
-
|
|
91
|
-
name: str = ""
|
|
92
|
-
name_latex: str = ""
|
|
93
|
-
issn_print: str = ""
|
|
94
|
-
issn_electronic: str = ""
|
|
95
|
-
id: int = -1
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
############
|
|
99
|
-
# Note
|
|
100
|
-
############
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
@attrs.define(frozen=True, slots=True)
|
|
104
|
-
class Note(BaseRenderable):
|
|
105
|
-
"""
|
|
106
|
-
Notes (metadata) about a publication.
|
|
107
|
-
|
|
108
|
-
Args:
|
|
109
|
-
text: str = ""
|
|
110
|
-
text_latex: str = ""
|
|
111
|
-
id: int = -1
|
|
112
|
+
name: BibStringAttr
|
|
113
|
+
name_latex: str
|
|
114
|
+
issn_print: str
|
|
115
|
+
issn_electronic: str
|
|
116
|
+
id: Maybe[int] = None
|
|
112
117
|
"""
|
|
113
118
|
|
|
114
|
-
|
|
119
|
+
name: BibStringAttr
|
|
120
|
+
issn_print: str
|
|
121
|
+
issn_electronic: str
|
|
122
|
+
id: Maybe[int] = None
|
|
115
123
|
|
|
116
124
|
|
|
117
125
|
############
|
|
118
|
-
#
|
|
126
|
+
# Keyword
|
|
119
127
|
############
|
|
120
128
|
|
|
121
129
|
|
|
@@ -125,172 +133,136 @@ class Keyword:
|
|
|
125
133
|
Keyword of a publication.
|
|
126
134
|
|
|
127
135
|
Args:
|
|
128
|
-
name: str
|
|
129
|
-
id: int =
|
|
136
|
+
name: str
|
|
137
|
+
id: Maybe[int] = None
|
|
130
138
|
"""
|
|
131
139
|
|
|
132
|
-
name: str
|
|
133
|
-
id: int =
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
@attrs.define(frozen=True, slots=True)
|
|
137
|
-
class Keywords:
|
|
138
|
-
level1: Keyword = Keyword()
|
|
139
|
-
level2: Keyword = Keyword()
|
|
140
|
-
level3: Keyword = Keyword()
|
|
140
|
+
name: str
|
|
141
|
+
id: Maybe[int] = None
|
|
141
142
|
|
|
142
143
|
|
|
143
144
|
############
|
|
144
|
-
#
|
|
145
|
+
# BibItem
|
|
145
146
|
############
|
|
146
147
|
|
|
147
148
|
|
|
148
|
-
|
|
149
|
-
class Series(BaseNamedRenderable):
|
|
150
|
-
"""
|
|
151
|
-
A series of publications.
|
|
152
|
-
|
|
153
|
-
Args:
|
|
154
|
-
name: str = ""
|
|
155
|
-
name_latex: str = ""
|
|
156
|
-
id: int = -1
|
|
157
|
-
"""
|
|
158
|
-
|
|
149
|
+
class BibKeyValidationError(Exception):
|
|
159
150
|
pass
|
|
160
151
|
|
|
161
152
|
|
|
162
153
|
@attrs.define(frozen=True, slots=True)
|
|
163
|
-
class
|
|
154
|
+
class BibKeyAttr:
|
|
164
155
|
"""
|
|
165
|
-
|
|
156
|
+
A unique identifier for a publication.
|
|
166
157
|
|
|
167
158
|
Args:
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
159
|
+
first_author: str
|
|
160
|
+
other_authors: str
|
|
161
|
+
date: int | TBasicPubStatus
|
|
162
|
+
date_suffix: str
|
|
171
163
|
"""
|
|
172
164
|
|
|
173
|
-
|
|
165
|
+
first_author: str
|
|
166
|
+
other_authors: str
|
|
167
|
+
date: int | TBasicPubState
|
|
168
|
+
date_suffix: str
|
|
174
169
|
|
|
170
|
+
def __attrs_post_init__(self) -> None:
|
|
171
|
+
if not self.first_author or not self.date:
|
|
172
|
+
raise BibKeyValidationError("Both 'first_author' and 'date' must not be empty.")
|
|
175
173
|
|
|
176
|
-
@attrs.define(frozen=True, slots=True)
|
|
177
|
-
class School(BaseNamedRenderable):
|
|
178
|
-
"""
|
|
179
|
-
A school that publishes publications.
|
|
180
|
-
|
|
181
|
-
Args:
|
|
182
|
-
name: str = ""
|
|
183
|
-
name_latex: str = ""
|
|
184
|
-
id: int = -1
|
|
185
|
-
"""
|
|
186
174
|
|
|
175
|
+
class BibItemDateValidationError(Exception):
|
|
187
176
|
pass
|
|
188
177
|
|
|
189
178
|
|
|
190
179
|
@attrs.define(frozen=True, slots=True)
|
|
191
|
-
class
|
|
180
|
+
class BibItemDateAttr:
|
|
192
181
|
"""
|
|
193
|
-
|
|
182
|
+
Year of a publication.
|
|
183
|
+
|
|
184
|
+
Example:
|
|
185
|
+
BibItemDate(year=2021, year_revised=2022) represents `2021/2022`.
|
|
186
|
+
BibItemDate(year=2021, month=1, day=1) represents `2021-01-01`.
|
|
194
187
|
|
|
195
188
|
Args:
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
189
|
+
year: int
|
|
190
|
+
year_part_2_hyphen: Maybe[int] = None
|
|
191
|
+
year_part_2_slash: Maybe[int] = None
|
|
192
|
+
month: Maybe[int] = None
|
|
193
|
+
day: Maybe[int] = None
|
|
199
194
|
"""
|
|
200
195
|
|
|
201
|
-
|
|
196
|
+
year: int
|
|
197
|
+
year_part_2_hyphen: Maybe[int] = None
|
|
198
|
+
year_part_2_slash: Maybe[int] = None
|
|
199
|
+
month: Maybe[int] = None
|
|
200
|
+
day: Maybe[int] = None
|
|
202
201
|
|
|
202
|
+
def __attrs_post_init__(self) -> None:
|
|
203
|
+
if any([self.year_part_2_hyphen, self.year_part_2_slash]) and not self.year:
|
|
204
|
+
raise BibItemDateValidationError(
|
|
205
|
+
"If 'year_part_2_hyphens' or 'year_part_2_slash' is set, 'year' must not be empty."
|
|
206
|
+
)
|
|
203
207
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
"""
|
|
207
|
-
A type of publication.
|
|
208
|
+
if not ((self.month and self.day) or (not self.month and not self.day)):
|
|
209
|
+
raise BibItemDateValidationError("If 'day' is set, 'month' must be set too, and vice versa.")
|
|
208
210
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
name_latex: str = ""
|
|
212
|
-
id: int = -1
|
|
213
|
-
"""
|
|
211
|
+
if self.month and not self.year:
|
|
212
|
+
raise BibItemDateValidationError("If 'month' is set, 'year' must not be empty.")
|
|
214
213
|
|
|
215
|
-
|
|
214
|
+
if self.year_part_2_hyphen and self.year_part_2_slash:
|
|
215
|
+
raise BibItemDateValidationError("If 'year_part_2_hyphen' is set, 'year_part_2_slash' must not be set.")
|
|
216
216
|
|
|
217
217
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
218
|
+
VALID_DATE_FORMATS = [
|
|
219
|
+
"{year}",
|
|
220
|
+
"{year_1}-{year_2}",
|
|
221
|
+
"{year}/{year_2}",
|
|
222
|
+
"{year}-{month}-{day}",
|
|
223
|
+
"{year}-{month}",
|
|
224
|
+
]
|
|
221
225
|
|
|
222
226
|
|
|
223
227
|
@attrs.define(frozen=True, slots=True)
|
|
224
|
-
class
|
|
228
|
+
class KeywordsAttr:
|
|
225
229
|
"""
|
|
226
|
-
|
|
230
|
+
Keywords of a publication.
|
|
227
231
|
|
|
228
232
|
Args:
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
other_authors: str = ""
|
|
233
|
-
et_al: bool = False
|
|
234
|
-
year_suffix
|
|
233
|
+
level_1: Keyword
|
|
234
|
+
level_2: Keyword
|
|
235
|
+
level_3: Keyword
|
|
235
236
|
"""
|
|
236
237
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
pub_status: TPubState = ""
|
|
241
|
-
year_suffix: str = ""
|
|
242
|
-
|
|
238
|
+
level_1: Keyword
|
|
239
|
+
level_2: Keyword
|
|
240
|
+
level_3: Keyword
|
|
243
241
|
|
|
244
|
-
@attrs.define(frozen=True, slots=True)
|
|
245
|
-
class BibItemDate:
|
|
246
|
-
"""
|
|
247
|
-
Year of a publication.
|
|
248
242
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
BibItemDate(year=2021, month=1, day=1) represents `2021-01-01`.
|
|
252
|
-
BibItemDate(forthcoming=True) represents `forthcoming`.
|
|
253
|
-
|
|
254
|
-
Args:
|
|
255
|
-
year: int | None = None
|
|
256
|
-
year_revised: int | None = None
|
|
257
|
-
month: int | None = None
|
|
258
|
-
day: int | None = None
|
|
259
|
-
forthcoming: bool | None = None
|
|
260
|
-
"""
|
|
261
|
-
|
|
262
|
-
year: int | None = None
|
|
263
|
-
year_revised: int | None = None
|
|
264
|
-
month: int | None = None
|
|
265
|
-
day: int | None = None
|
|
266
|
-
forthcoming: bool = False
|
|
243
|
+
class PageValidationError(Exception):
|
|
244
|
+
pass
|
|
267
245
|
|
|
268
246
|
|
|
269
247
|
@attrs.define(frozen=True, slots=True)
|
|
270
|
-
class
|
|
248
|
+
class PageAttr:
|
|
271
249
|
"""
|
|
272
250
|
Page numbers of a publication. Can be a range, roman numerals, or a single page.
|
|
273
251
|
|
|
274
252
|
Args:
|
|
275
253
|
start: str
|
|
276
|
-
end: str
|
|
254
|
+
end: str
|
|
277
255
|
"""
|
|
278
256
|
|
|
279
257
|
start: str
|
|
280
|
-
end: str
|
|
281
|
-
|
|
258
|
+
end: str
|
|
282
259
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
Title of an issue of a publication.
|
|
260
|
+
def __attrs_post_init__(self) -> None:
|
|
261
|
+
if self.end and not self.start:
|
|
262
|
+
raise PageValidationError("If 'end' is set, 'start' must not be empty.")
|
|
287
263
|
|
|
288
|
-
Args:
|
|
289
|
-
text: str
|
|
290
|
-
text_latex: str | None = None
|
|
291
|
-
id: int | None = None
|
|
292
|
-
"""
|
|
293
264
|
|
|
265
|
+
class BibItemValidationError(Exception):
|
|
294
266
|
pass
|
|
295
267
|
|
|
296
268
|
|
|
@@ -303,57 +275,92 @@ class BibItem:
|
|
|
303
275
|
|
|
304
276
|
"""
|
|
305
277
|
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
278
|
+
# Normal string fields
|
|
279
|
+
_to_do_general: str
|
|
280
|
+
_change_request: str
|
|
281
|
+
|
|
282
|
+
# Official fields, may be stored in different formats
|
|
283
|
+
entry_type: TBibTeXEntryType
|
|
284
|
+
bibkey: MaybeStr[BibKeyAttr]
|
|
285
|
+
author: Tuple[Author, ...]
|
|
286
|
+
editor: Tuple[Author, ...]
|
|
287
|
+
options: Tuple[str, ...]
|
|
288
|
+
# shorthand: BibStringAttr # Mononym of the author
|
|
289
|
+
date: BibItemDateAttr | Literal["no date"]
|
|
290
|
+
pubstate: TPubState
|
|
291
|
+
title: MaybeStr[BibStringAttr]
|
|
292
|
+
booktitle: MaybeStr[BibStringAttr]
|
|
293
|
+
crossref: MaybeStr[CrossrefBibItemAttr]
|
|
294
|
+
journal: Maybe[Journal]
|
|
295
|
+
volume: str
|
|
296
|
+
number: str
|
|
297
|
+
pages: Tuple[PageAttr, ...]
|
|
298
|
+
eid: str
|
|
299
|
+
series: MaybeStr[BaseNamedRenderable]
|
|
300
|
+
address: MaybeStr[BibStringAttr]
|
|
301
|
+
institution: MaybeStr[BibStringAttr]
|
|
302
|
+
school: MaybeStr[BibStringAttr]
|
|
303
|
+
publisher: MaybeStr[BibStringAttr]
|
|
304
|
+
type: MaybeStr[BibStringAttr]
|
|
305
|
+
edition: Maybe[int]
|
|
306
|
+
note: MaybeStr[BibStringAttr]
|
|
307
|
+
issuetitle: MaybeStr[BibStringAttr]
|
|
308
|
+
_guesteditor: Tuple[Author, ...] # Custom field
|
|
309
|
+
_extra_note: MaybeStr[BibStringAttr] # Custom field
|
|
310
|
+
urn: str
|
|
311
|
+
eprint: str
|
|
312
|
+
doi: str
|
|
313
|
+
url: str
|
|
314
|
+
|
|
315
|
+
# String fields
|
|
316
|
+
_kws: MaybeStr[KeywordsAttr]
|
|
317
|
+
_epoch: TEpoch
|
|
318
|
+
_person: MaybeStr[Author]
|
|
319
|
+
_comm_for_profile_bib: str
|
|
320
|
+
_langid: TLanguageID
|
|
321
|
+
_lang_der: str
|
|
322
|
+
_further_refs: Tuple[BibKeyAttr, ...]
|
|
323
|
+
_depends_on: Tuple[BibKeyAttr, ...]
|
|
324
|
+
_dltc_num: Maybe[int]
|
|
325
|
+
_spec_interest: str
|
|
326
|
+
_note_perso: str
|
|
327
|
+
_note_stock: str
|
|
328
|
+
_note_status: str
|
|
329
|
+
_num_inwork_coll: Maybe[int]
|
|
330
|
+
_num_inwork: str
|
|
331
|
+
_num_coll: Maybe[int]
|
|
332
|
+
_dltc_copyediting_note: str
|
|
333
|
+
_note_missing: str
|
|
334
|
+
_num_sort: Maybe[int]
|
|
335
|
+
|
|
336
|
+
# Additional fields
|
|
337
|
+
id: Maybe[int] = None
|
|
359
338
|
_bib_info_source: str = ""
|
|
339
|
+
|
|
340
|
+
def __attrs_post_init__(self) -> None:
|
|
341
|
+
|
|
342
|
+
if self.crossref and self.bibkey == self.crossref.bibkey:
|
|
343
|
+
raise BibItemValidationError("Crossref bibkey must be different from the main bibkey.")
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
@attrs.define(frozen=True, slots=True)
|
|
347
|
+
class CrossrefBibItemAttr(BibItem):
|
|
348
|
+
"""
|
|
349
|
+
A cross-reference to another bibliographic item.
|
|
350
|
+
|
|
351
|
+
Args:
|
|
352
|
+
bibkey: str
|
|
353
|
+
"""
|
|
354
|
+
|
|
355
|
+
def __attrs_post_init__(self) -> None:
|
|
356
|
+
if self.entry_type != "book":
|
|
357
|
+
raise ValueError("Crossref must have a 'type' of 'book'.")
|
|
358
|
+
|
|
359
|
+
if not self.booktitle:
|
|
360
|
+
raise ValueError("Crossref must have a 'booktitle'.")
|
|
361
|
+
|
|
362
|
+
if not self.bibkey:
|
|
363
|
+
raise ValueError("Crossref must have a 'bibkey'.")
|
|
364
|
+
|
|
365
|
+
if self.crossref and self.bibkey == self.crossref.bibkey:
|
|
366
|
+
raise BibItemValidationError("Crossref bibkey must be different from the main bibkey.")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: philoch-bib-sdk
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.4
|
|
4
4
|
Summary: Standard development kit for the Philosophie Bibliography project
|
|
5
5
|
License: MIT
|
|
6
6
|
Author: Luis Alejandro Bordo García
|
|
@@ -13,6 +13,7 @@ Classifier: Programming Language :: Python :: 3
|
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.13
|
|
14
14
|
Requires-Dist: aletk (>=0.1.6,<0.2.0)
|
|
15
15
|
Requires-Dist: attrs (>=25.3.0,<26.0.0)
|
|
16
|
+
Requires-Dist: polars (>=1.32.3,<2.0.0)
|
|
16
17
|
Description-Content-Type: text/markdown
|
|
17
18
|
|
|
18
19
|
# Philosophie.ch Bibliography SDK
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
philoch_bib_sdk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
philoch_bib_sdk/adapters/tabular_data/read_journal_volume_number_index.py,sha256=espgeln4xH29X1STIDLKiO1IRwmzN5WMjr5QYjPCKls,1757
|
|
3
|
+
philoch_bib_sdk/converters/latex.py,sha256=LuAKLrClECuBeaDQYJc7tIJECEV4h0kt0VE_ssv3s0o,236
|
|
4
|
+
philoch_bib_sdk/converters/plaintext/author/formatter.py,sha256=hsqKUyNhIZeqisnEQU43DokAfEfG78rgQ8POTjYnToM,965
|
|
5
|
+
philoch_bib_sdk/converters/plaintext/author/parser.py,sha256=LL12mtgN59eJCv551c6s7YfMTjfJAJqm-jRQkdntmIg,2514
|
|
6
|
+
philoch_bib_sdk/converters/plaintext/bib_string_formatter.py,sha256=5Z97u5GryHUgZcPhWE41thgWCB4wYu22pZ9et6nakmw,329
|
|
7
|
+
philoch_bib_sdk/converters/plaintext/bibitem/bibkey_formatter.py,sha256=YivsY0gblKJdC4yKYZ3tvWmKIvFXW4iNht9zhz8oFUs,565
|
|
8
|
+
philoch_bib_sdk/converters/plaintext/bibitem/bibkey_parser.py,sha256=lmcDD-NN0hiAF_uKRUcucTBELd_F9q_qjbW9Df7srwY,4624
|
|
9
|
+
philoch_bib_sdk/converters/plaintext/bibitem/date_formatter.py,sha256=G2mbaJidDg8avKBbro1rVcEznPC92XVTDQ4fSdmvhJo,1480
|
|
10
|
+
philoch_bib_sdk/converters/plaintext/bibitem/date_parser.py,sha256=3ZYGhhGqILzrvnwOvG4NPAjErLwVva0dfsN0B9eFomg,2242
|
|
11
|
+
philoch_bib_sdk/converters/plaintext/bibitem/formatter.py,sha256=EjSwHYAPn0YRjeLGK_rCi26Wtug6X5x5DFEKPjStn30,6298
|
|
12
|
+
philoch_bib_sdk/converters/plaintext/bibitem/pages_formatter.py,sha256=punzwm8ObrLJhsCOS1oKHSnTXMX_R_0Xs9M866J44pU,397
|
|
13
|
+
philoch_bib_sdk/converters/plaintext/bibitem/pages_parser.py,sha256=mMFviMZo5qHs0K_SXfbmjJ_nbmTGnSiKMrXyazzO2Qs,2018
|
|
14
|
+
philoch_bib_sdk/converters/plaintext/bibitem/parser.py,sha256=B8xF3OKr6R4-FwsV8iC-cEuY90TEiA22GT5b-WaOwvo,63
|
|
15
|
+
philoch_bib_sdk/converters/plaintext/journal/formatter.py,sha256=o5ikU-aNFr6cxgzD0rBCjymHLpGrD6RGvNE8V2sX52s,599
|
|
16
|
+
philoch_bib_sdk/converters/plaintext/journal/parser.py,sha256=kT1YHwc9Am82WHRhaSWXaCeKitPn9QLWIbmIe8T1of4,1092
|
|
17
|
+
philoch_bib_sdk/converters/plaintext/shared/renderable_formatter.py,sha256=oS5u8RJpkRXaDTmauVqZi-uuXsyG-UQZMK2pgzSk-qo,686
|
|
18
|
+
philoch_bib_sdk/logic/default_models.py,sha256=cHHKSFmNR29qBxQkPwelQ09sx66isHlAIr1PiIHAvH4,10467
|
|
19
|
+
philoch_bib_sdk/logic/functions/comparator.py,sha256=4G5EUEVf8v6URt1v1Fqk1pjqni6fxUs_Goh4EQ4RBJY,4034
|
|
20
|
+
philoch_bib_sdk/logic/functions/journal_article_matcher.py,sha256=qow-szblPDF9ZFaL3nIj-h54rVUwDJz9YXjxycTlTT8,1195
|
|
21
|
+
philoch_bib_sdk/logic/literals.py,sha256=_9poyFdSqbMWNg686xaexvkZTIrpCbQqPNTCVi0PlFc,1573
|
|
22
|
+
philoch_bib_sdk/logic/models.py,sha256=xHCQWFq_rEcX967icALD4oOQjM8AlLKLzXQ8SP-YNis,8681
|
|
23
|
+
philoch_bib_sdk/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
24
|
+
philoch_bib_sdk-0.1.4.dist-info/LICENSE,sha256=nplGobji9gkYmJxDBbBz2SKjZY27SUaqhqKkpUB-C30,1070
|
|
25
|
+
philoch_bib_sdk-0.1.4.dist-info/METADATA,sha256=uZJQLAGQRjOtQZCskgWwjaLPZ8UyGkFEAVLcdYjF82I,816
|
|
26
|
+
philoch_bib_sdk-0.1.4.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
27
|
+
philoch_bib_sdk-0.1.4.dist-info/entry_points.txt,sha256=5PDcoKK00cdaL0CabioRUz08ZJeXLa94Ca-C0umGPTU,46
|
|
28
|
+
philoch_bib_sdk-0.1.4.dist-info/RECORD,,
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
philoch_bib_sdk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
philoch_bib_sdk/logic/literals.py,sha256=cyoS4Bs9vN35fMkKESlbgLV3YfnRpviZSs4es76t71o,1512
|
|
3
|
-
philoch_bib_sdk/logic/models.py,sha256=b0O7zUP8lzco9Csq5mphGeS2t6Bjyc3LgLELYb-uYt0,7109
|
|
4
|
-
philoch_bib_sdk/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
-
philoch_bib_sdk-0.1.2.dist-info/LICENSE,sha256=nplGobji9gkYmJxDBbBz2SKjZY27SUaqhqKkpUB-C30,1070
|
|
6
|
-
philoch_bib_sdk-0.1.2.dist-info/METADATA,sha256=PLXUGi9pB6CN4OBAUN589G5Dm4X1NB9PVnZXx6oyDaQ,776
|
|
7
|
-
philoch_bib_sdk-0.1.2.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
|
8
|
-
philoch_bib_sdk-0.1.2.dist-info/RECORD,,
|
|
File without changes
|