open-paleo 0.4.7__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.
open_paleo/__init__.py ADDED
@@ -0,0 +1,746 @@
1
+ # generated by datamodel-codegen:
2
+ # filename: open-paleo.schema.json
3
+
4
+ from __future__ import annotations
5
+
6
+ from enum import Enum
7
+ from typing import Dict, List, Optional
8
+
9
+ from pydantic import (
10
+ AwareDatetime,
11
+ BaseModel,
12
+ Field,
13
+ PositiveFloat,
14
+ confloat,
15
+ conint,
16
+ constr,
17
+ )
18
+
19
+
20
+ class Paleogeography(BaseModel):
21
+ model: str = Field(
22
+ ..., description="The model's name, as recorded in each paleocoordinates.model."
23
+ )
24
+ citation: str
25
+ license: str = Field(..., description="License of the model's data.")
26
+
27
+
28
+ class Metadata(BaseModel):
29
+ version: str = Field(
30
+ ..., description='Calendar version of the data release (YYYY.MM).'
31
+ )
32
+ schema_version: str = Field(
33
+ ...,
34
+ description='Semantic version of this output schema (see docs/VERSIONING.md).',
35
+ )
36
+ built_at: AwareDatetime
37
+ license: str
38
+ attribution: str
39
+ genus_count: conint(ge=0)
40
+ clade_count: conint(ge=0)
41
+ paleogeography: Optional[Paleogeography] = Field(
42
+ None,
43
+ description='The plate model behind location.paleocoordinates, with the citation and license to credit it by. Absent when the build attached no paleocoordinates.',
44
+ )
45
+
46
+
47
+ class FormerIdReasons(Enum):
48
+ renumbered = 'renumbered'
49
+ rehoused = 'rehoused'
50
+
51
+
52
+ class ThesisTypes(Enum):
53
+ doctoral = 'doctoral'
54
+ masters = 'masters'
55
+ habilitation = 'habilitation'
56
+ dissertation_abstract = 'dissertation-abstract'
57
+
58
+
59
+ class FormerId(BaseModel):
60
+ from_id: str = Field(..., description='The catalogue number before the change.')
61
+ to_id: str = Field(..., description='The catalogue number after the change.')
62
+ from_institution: Optional[str] = Field(
63
+ None,
64
+ description="Resolved display name of the institution before the change. Present only when reason is 'rehoused'.",
65
+ )
66
+ to_institution: Optional[str] = Field(
67
+ None,
68
+ description="Resolved display name of the institution after the change. Present only when reason is 'rehoused'.",
69
+ )
70
+ reason: FormerIdReasons
71
+ source: Optional[str] = Field(
72
+ None,
73
+ description='Reference id of the work documenting the change -- not the works that merely used the old number. Absent when no publication documents it.',
74
+ )
75
+ notes: Optional[str] = Field(
76
+ None, description='Why the change happened, when that is itself of interest.'
77
+ )
78
+
79
+
80
+ class Discovered(BaseModel):
81
+ year: Optional[int] = None
82
+ by: Optional[str] = None
83
+
84
+
85
+ class Reference(BaseModel):
86
+ id: str
87
+ authors: Optional[str] = None
88
+ year: Optional[int] = None
89
+ title: Optional[str] = None
90
+ journal: Optional[str] = None
91
+ book: Optional[str] = None
92
+ series: Optional[str] = None
93
+ thesis: Optional[ThesisTypes] = Field(
94
+ None, description='Degree the work was submitted for, when it is a thesis.'
95
+ )
96
+ school: Optional[str] = Field(None, description='Awarding institution of a thesis.')
97
+ publisher: Optional[str] = None
98
+ volume: Optional[str] = None
99
+ issue: Optional[str] = None
100
+ pages: Optional[str] = None
101
+ article_number: Optional[str] = None
102
+ doi: Optional[str] = None
103
+ isbn: Optional[str] = None
104
+ url: Optional[str] = None
105
+ notes: Optional[str] = None
106
+
107
+
108
+ class Dispute(BaseModel):
109
+ summary: str
110
+
111
+
112
+ class Pronunciation(BaseModel):
113
+ ipa: Optional[str] = None
114
+ phonetic: Optional[str] = None
115
+
116
+
117
+ class Resolution(Enum):
118
+ unit = 'unit'
119
+ reworked = 'reworked'
120
+ horizon = 'horizon'
121
+
122
+
123
+ class PartOf(Enum):
124
+ group = 'group'
125
+ formation = 'formation'
126
+ member = 'member'
127
+ bed = 'bed'
128
+
129
+
130
+ class Rank(Enum):
131
+ supergroup = 'supergroup'
132
+ group = 'group'
133
+ subgroup = 'subgroup'
134
+ formation = 'formation'
135
+ member = 'member'
136
+ bed = 'bed'
137
+
138
+
139
+ class Paleocoordinates(BaseModel):
140
+ latitude: confloat(ge=-90.0, le=90.0) = Field(
141
+ ..., description='Reconstructed latitude in decimal degrees.'
142
+ )
143
+ longitude: confloat(ge=-180.0, le=180.0) = Field(
144
+ ..., description='Reconstructed longitude in decimal degrees.'
145
+ )
146
+ latitude_present: confloat(ge=-90.0, le=90.0) = Field(
147
+ ...,
148
+ description='Present-day latitude that was reconstructed: location.coordinates, or the center of the region or country when approximate.',
149
+ )
150
+ longitude_present: confloat(ge=-180.0, le=180.0) = Field(
151
+ ..., description='Present-day longitude that was reconstructed.'
152
+ )
153
+ age_ma: float = Field(
154
+ ...,
155
+ description="Age reconstructed at, in millions of years: the midpoint of the species' age range (period.from_ma/to_ma, else its stages, else its epochs).",
156
+ )
157
+ model: str = Field(
158
+ ..., description='The plate model, as named in _metadata.paleogeography.model.'
159
+ )
160
+ model_plate_id: int = Field(
161
+ ...,
162
+ description='The plate the model assigns the present-day point to. Meaningful only within model.',
163
+ )
164
+ approximate: bool = Field(
165
+ ...,
166
+ description="True when the present-day point is the center of the record's region or country rather than coordinates a source prints for the site.",
167
+ )
168
+
169
+
170
+ class SizeRange(BaseModel):
171
+ min: PositiveFloat
172
+ max: PositiveFloat
173
+
174
+
175
+ class Status(Enum):
176
+ valid = 'valid'
177
+ nomen_dubium = 'nomen dubium'
178
+ nomen_nudum = 'nomen nudum'
179
+ disputed = 'disputed'
180
+
181
+
182
+ class SynonymTypes(Enum):
183
+ junior_subjective = 'junior subjective'
184
+ junior_objective = 'junior objective'
185
+ possible_subjective = 'possible subjective'
186
+ preoccupied = 'preoccupied'
187
+ reassigned = 'reassigned'
188
+ emended_spelling = 'emended spelling'
189
+ nomen_oblitum = 'nomen oblitum'
190
+ nomen_rejectum = 'nomen rejectum'
191
+ nomen_nudum = 'nomen nudum'
192
+ nomen_ex_dissertatione = 'nomen ex dissertatione'
193
+ nomen_manuscriptum = 'nomen manuscriptum'
194
+ informal = 'informal'
195
+ boycotted = 'boycotted'
196
+
197
+
198
+ class Placement(Enum):
199
+ incertae_sedis = 'incertae sedis'
200
+
201
+
202
+ class Diet(Enum):
203
+ herbivore = 'herbivore'
204
+ carnivore = 'carnivore'
205
+ omnivore = 'omnivore'
206
+ insectivore = 'insectivore'
207
+ piscivore = 'piscivore'
208
+
209
+
210
+ class Locomotion(Enum):
211
+ bipedal = 'bipedal'
212
+ quadrupedal = 'quadrupedal'
213
+ facultative = 'facultative'
214
+
215
+
216
+ class Completeness(Enum):
217
+ complete = 'complete'
218
+ partial = 'partial'
219
+ fragmentary = 'fragmentary'
220
+
221
+
222
+ class HolotypeStatus(Enum):
223
+ destroyed = 'destroyed'
224
+ lost = 'lost'
225
+ uncataloged = 'uncataloged'
226
+ unknown = 'unknown'
227
+
228
+
229
+ class SpecimenTypes(Enum):
230
+ holotype = 'holotype'
231
+ syntype = 'syntype'
232
+ lectotype = 'lectotype'
233
+ neotype = 'neotype'
234
+ unknown = 'unknown'
235
+
236
+
237
+ class SpecimenCategories(Enum):
238
+ most_complete = 'most-complete'
239
+ largest_individual = 'largest-individual'
240
+ exceptional_preservation = 'exceptional-preservation'
241
+ gut_contents = 'gut-contents'
242
+ reproductive = 'reproductive'
243
+ pathology = 'pathology'
244
+ historic = 'historic'
245
+ iconic = 'iconic'
246
+ complementary = 'complementary'
247
+ ontogeny = 'ontogeny'
248
+ range_extension = 'range-extension'
249
+ sensory = 'sensory'
250
+ trace_association = 'trace-association'
251
+ physiology = 'physiology'
252
+ individual_variation = 'individual-variation'
253
+
254
+
255
+ class IcznCaseTypes(Enum):
256
+ type_species = 'type-species'
257
+ type_specimen = 'type-specimen'
258
+ name_conservation = 'name-conservation'
259
+ name_suppression = 'name-suppression'
260
+ priority_reversal = 'priority-reversal'
261
+ spelling_emendation = 'spelling-emendation'
262
+
263
+
264
+ class CladeRanks(Enum):
265
+ superfamily = 'superfamily'
266
+ family = 'family'
267
+ subfamily = 'subfamily'
268
+ tribe = 'tribe'
269
+ unranked = 'unranked'
270
+
271
+
272
+ class IcznCaseStatuses(Enum):
273
+ opinion = 'opinion'
274
+ open = 'open'
275
+ closed = 'closed'
276
+ withdrawn = 'withdrawn'
277
+
278
+
279
+ class Integument(Enum):
280
+ feathered = 'feathered'
281
+ scaled = 'scaled'
282
+ armored = 'armored'
283
+ unknown = 'unknown'
284
+
285
+
286
+ class IntegumentEvidence(Enum):
287
+ direct = 'direct'
288
+ inferred = 'inferred'
289
+
290
+
291
+ class Paleoenvironments(Enum):
292
+ fluvial = 'fluvial'
293
+ lacustrine = 'lacustrine'
294
+ coastal = 'coastal'
295
+ estuarine = 'estuarine'
296
+ deltaic = 'deltaic'
297
+ arid = 'arid'
298
+ semiarid = 'semiarid'
299
+ forested = 'forested'
300
+ wetland = 'wetland'
301
+ marine = 'marine'
302
+ polar = 'polar'
303
+
304
+
305
+ class IdentifierSources(Enum):
306
+ zoobank = 'zoobank'
307
+ wikidata = 'wikidata'
308
+ gbif = 'gbif'
309
+ pbdb = 'pbdb'
310
+ eol = 'eol'
311
+
312
+
313
+ class Periods(Enum):
314
+ Late_Triassic = 'Late Triassic'
315
+ Middle_Triassic = 'Middle Triassic'
316
+ Early_Triassic = 'Early Triassic'
317
+ Late_Jurassic = 'Late Jurassic'
318
+ Middle_Jurassic = 'Middle Jurassic'
319
+ Early_Jurassic = 'Early Jurassic'
320
+ Late_Cretaceous = 'Late Cretaceous'
321
+ Early_Cretaceous = 'Early Cretaceous'
322
+ Late_Permian = 'Late Permian'
323
+ Middle_Permian = 'Middle Permian'
324
+ Early_Permian = 'Early Permian'
325
+ Paleocene = 'Paleocene'
326
+ Eocene = 'Eocene'
327
+
328
+
329
+ class Stages(Enum):
330
+ Ypresian = 'Ypresian'
331
+ Thanetian = 'Thanetian'
332
+ Selandian = 'Selandian'
333
+ Danian = 'Danian'
334
+ Maastrichtian = 'Maastrichtian'
335
+ Campanian = 'Campanian'
336
+ Santonian = 'Santonian'
337
+ Coniacian = 'Coniacian'
338
+ Turonian = 'Turonian'
339
+ Cenomanian = 'Cenomanian'
340
+ Albian = 'Albian'
341
+ Aptian = 'Aptian'
342
+ Barremian = 'Barremian'
343
+ Hauterivian = 'Hauterivian'
344
+ Valanginian = 'Valanginian'
345
+ Berriasian = 'Berriasian'
346
+ Tithonian = 'Tithonian'
347
+ Kimmeridgian = 'Kimmeridgian'
348
+ Oxfordian = 'Oxfordian'
349
+ Callovian = 'Callovian'
350
+ Bathonian = 'Bathonian'
351
+ Bajocian = 'Bajocian'
352
+ Aalenian = 'Aalenian'
353
+ Toarcian = 'Toarcian'
354
+ Pliensbachian = 'Pliensbachian'
355
+ Sinemurian = 'Sinemurian'
356
+ Hettangian = 'Hettangian'
357
+ Rhaetian = 'Rhaetian'
358
+ Norian = 'Norian'
359
+ Carnian = 'Carnian'
360
+ Ladinian = 'Ladinian'
361
+ Anisian = 'Anisian'
362
+ Olenekian = 'Olenekian'
363
+ Induan = 'Induan'
364
+ Changhsingian = 'Changhsingian'
365
+ Wuchiapingian = 'Wuchiapingian'
366
+ Capitanian = 'Capitanian'
367
+ Wordian = 'Wordian'
368
+ Roadian = 'Roadian'
369
+ Kungurian = 'Kungurian'
370
+ Artinskian = 'Artinskian'
371
+ Sakmarian = 'Sakmarian'
372
+ Asselian = 'Asselian'
373
+
374
+
375
+ class AppearanceFeatures(Enum):
376
+ nasal_crest = 'nasal crest'
377
+ hollow_cranial_crest = 'hollow cranial crest'
378
+ solid_cranial_crest = 'solid cranial crest'
379
+ nasal_horn = 'nasal horn'
380
+ brow_horns = 'brow horns'
381
+ cranial_dome = 'cranial dome'
382
+ cranial_bosses = 'cranial bosses'
383
+ keratinous_beak = 'keratinous beak'
384
+ elongate_snout = 'elongate snout'
385
+ enlarged_caniniform_teeth = 'enlarged caniniform teeth'
386
+ neck_frill = 'neck frill'
387
+ frill_spikes = 'frill spikes'
388
+ epoccipitals = 'epoccipitals'
389
+ downturned_snout = 'downturned snout'
390
+ jugal_horns = 'jugal horns'
391
+ feather_crest = 'feather crest'
392
+ snout_hornlets = 'snout hornlets'
393
+ orbital_crest = 'orbital crest'
394
+ fleshy_cranial_crest = 'fleshy cranial crest'
395
+ square_snout = 'square snout'
396
+ frontal_horn = 'frontal horn'
397
+ procumbent_teeth = 'procumbent teeth'
398
+ squamosal_horns = 'squamosal horns'
399
+ elongate_neck = 'elongate neck'
400
+ bifurcated_cervical_spines = 'bifurcated cervical spines'
401
+ neck_spines = 'neck spines'
402
+ cervical_half_rings = 'cervical half rings'
403
+ dorsal_sail = 'dorsal sail'
404
+ tall_neural_spines = 'tall neural spines'
405
+ dorsal_spines = 'dorsal spines'
406
+ midline_spike_row = 'midline spike row'
407
+ dermal_plates = 'dermal plates'
408
+ shoulder_spikes = 'shoulder spikes'
409
+ osteoderms = 'osteoderms'
410
+ body_armor = 'body armor'
411
+ enlarged_manual_claws = 'enlarged manual claws'
412
+ sickle_claw = 'sickle claw'
413
+ reduced_forelimbs = 'reduced forelimbs'
414
+ elongate_forelimbs = 'elongate forelimbs'
415
+ quill_knobs = 'quill knobs'
416
+ membranous_wing = 'membranous wing'
417
+ feathered_wings = 'feathered wings'
418
+ hindlimb_feathers = 'hindlimb feathers'
419
+ enlarged_pedal_claws = 'enlarged pedal claws'
420
+ multiple_pedal_claws = 'multiple pedal claws'
421
+ thumb_spike = 'thumb spike'
422
+ reduced_outer_digit = 'reduced outer digit'
423
+ hooves = 'hooves'
424
+ tail_club = 'tail club'
425
+ tail_spikes = 'tail spikes'
426
+ whiplash_tail = 'whiplash tail'
427
+ tail_bristles = 'tail bristles'
428
+ feathered_tail = 'feathered tail'
429
+
430
+
431
+ class StagesModel(BaseModel):
432
+ period: Periods = Field(
433
+ ...,
434
+ description='The epoch the stage belongs to, in the same form as species[].period.name.',
435
+ )
436
+ from_ma: float = Field(
437
+ ..., description="Age of the stage's base, in millions of years."
438
+ )
439
+ to_ma: float = Field(
440
+ ..., description="Age of the stage's top, in millions of years."
441
+ )
442
+
443
+
444
+ class Timescale(BaseModel):
445
+ chart: str = Field(
446
+ ..., description='The published chart the stage boundaries follow.'
447
+ )
448
+ stages: Dict[str, StagesModel] = Field(
449
+ ..., description='Stages keyed by name, youngest first.'
450
+ )
451
+
452
+
453
+ class TypeSpecimen(BaseModel):
454
+ specimen_id: Optional[List[str]] = Field(
455
+ None, description='Catalogue number(s), one per element.'
456
+ )
457
+ nickname: Optional[str] = Field(
458
+ None,
459
+ description='Informal name the type specimen is known by (e.g. "Happy"). A type specimen is never also listed in notable_specimens.',
460
+ )
461
+ specimen_type: Optional[SpecimenTypes] = None
462
+ institution: Optional[str] = Field(
463
+ None, description='Resolved institution display name.'
464
+ )
465
+ material: Optional[str] = None
466
+ status: Optional[HolotypeStatus] = None
467
+ completeness: Optional[Completeness] = None
468
+ former_ids: Optional[List[FormerId]] = Field(
469
+ None,
470
+ description='Identifier history: numbers this specimen was catalogued under before its current one.',
471
+ )
472
+ notes: Optional[str] = None
473
+
474
+
475
+ class NotableSpecimen(BaseModel):
476
+ nickname: Optional[str] = None
477
+ specimen_id: Optional[List[str]] = None
478
+ institution: Optional[str] = Field(
479
+ None, description='Resolved institution display name.'
480
+ )
481
+ status: Optional[HolotypeStatus] = None
482
+ species: Optional[str] = None
483
+ category: Optional[SpecimenCategories] = None
484
+ significance: str
485
+ discovered: Optional[Discovered] = None
486
+ former_ids: Optional[List[FormerId]] = Field(
487
+ None,
488
+ description='Identifier history: numbers this specimen was catalogued under before its current one.',
489
+ )
490
+ references: Optional[List[str]] = Field(
491
+ None, description="Reference ids resolving within this genus's references."
492
+ )
493
+
494
+
495
+ class Identifier(BaseModel):
496
+ source: Optional[IdentifierSources] = None
497
+ id: Optional[str] = None
498
+
499
+
500
+ class Synonym(BaseModel):
501
+ name: str
502
+ type: SynonymTypes
503
+ reason: Optional[str] = None
504
+
505
+
506
+ class IcznCase(BaseModel):
507
+ type: IcznCaseTypes
508
+ status: IcznCaseStatuses
509
+ case: Optional[str] = Field(None, description="The Commission's case number.")
510
+ ruling: Optional[str] = Field(
511
+ None,
512
+ description='Reference id of the published Opinion; present only when status is opinion.',
513
+ )
514
+ petition: Optional[str] = Field(
515
+ None, description='Reference id of the Case/application.'
516
+ )
517
+ notices: Optional[List[str]] = Field(
518
+ None,
519
+ description="Reference ids of the Commission's published notices about the case (receipt, closure).",
520
+ )
521
+ notes: Optional[str] = None
522
+
523
+
524
+ class Appearance(BaseModel):
525
+ integument: Optional[Integument] = None
526
+ evidence: Optional[IntegumentEvidence] = None
527
+ features: Optional[List[AppearanceFeatures]] = None
528
+
529
+
530
+ class Period(BaseModel):
531
+ name: Optional[List[Periods]] = None
532
+ stage: Optional[List[Stages]] = None
533
+ from_ma: Optional[float] = None
534
+ to_ma: Optional[float] = None
535
+ resolution: Optional[Resolution] = Field(
536
+ None,
537
+ description='How `stage` relates to the record\'s stratigraphic unit. "unit": no age finer than the containing lithostratigraphic unit has been published, so `stage` is that unit\'s range rather than a determination for this taxon. "reworked": the type specimen was reworked from older beds, so `stage` is the age of those beds and falls outside the unit it was found in. "horizon": which bed yielded the type specimen is uncertain, so `stage` covers every candidate bed and reaches outside the named unit. Absent means the age is finer than the unit, or has not been checked.',
538
+ )
539
+
540
+
541
+ class Location(BaseModel):
542
+ country: Optional[constr(pattern=r'^[A-Z]{2}$')] = Field(
543
+ None, description='ISO 3166-1 alpha-2 code (see schema.yml countries).'
544
+ )
545
+ region: Optional[str] = Field(
546
+ None,
547
+ description='English name of the ISO 3166-2 subdivision, resolved from region_code.',
548
+ )
549
+ region_code: Optional[constr(pattern=r'^[A-Z]{2}-[A-Z0-9]{1,3}$')] = Field(
550
+ None,
551
+ description='ISO 3166-2 subdivision code (see regions.yaml). Absent where a country has no subdivisions.',
552
+ )
553
+ locality: Optional[str] = None
554
+ group: Optional[str] = Field(
555
+ None,
556
+ description='Lithostratigraphic group containing the occurrence; populated when the group is the finest published unit, in which case formation is absent. No rank word in the value.',
557
+ )
558
+ formation: Optional[str] = None
559
+ member: Optional[str] = Field(
560
+ None,
561
+ description='Member NAME only; an informal upper/lower division goes in part.',
562
+ )
563
+ bed: Optional[str] = Field(
564
+ None,
565
+ description='Named bed, the finest lithostratigraphic rank. Published names only.',
566
+ )
567
+ part: Optional[str] = Field(
568
+ None,
569
+ description='Informal position within the unit named by part_of. Lowercase, because informal divisions are not formally erected names: upper, middle, lower, or an ordinal.',
570
+ )
571
+ part_of: Optional[PartOf] = Field(
572
+ None,
573
+ description='Which unit `part` qualifies. Build-derived; always the finest of bed, member, formation and group that is populated.',
574
+ )
575
+ coordinates: Optional[List[float]] = Field(
576
+ None,
577
+ description='[latitude, longitude] in decimal degrees.',
578
+ max_length=2,
579
+ min_length=2,
580
+ )
581
+ paleocoordinates: Optional[Paleocoordinates] = None
582
+ notes: Optional[str] = Field(
583
+ None,
584
+ description='Provenance caveat qualifying the fields above: material not collected in situ, a locality reconstructed after the fact, a horizon never recorded. Not a general comment field.',
585
+ )
586
+
587
+
588
+ class StratigraphicUnit(BaseModel):
589
+ rank: Optional[Rank] = Field(
590
+ None, description="The unit's rank. Absent for an informal label that has none."
591
+ )
592
+ informal: Optional[bool] = Field(
593
+ None,
594
+ description='True for a unit that was never formally erected but is widely used.',
595
+ )
596
+ parent: Optional[str] = Field(
597
+ None,
598
+ description="Name of the unit this one lies within (a member's formation, a bed's unit); a key of stratigraphy.",
599
+ )
600
+ variants: Optional[List[str]] = Field(
601
+ None, description='Other names the literature gives the unit.'
602
+ )
603
+ lithology: Optional[str] = Field(
604
+ None,
605
+ description='What the unit is made of, as a short phrase ("red mudstone and fine-grained sandstone"), taken from a cited paper.',
606
+ )
607
+ description: str = Field(
608
+ ...,
609
+ description='A few-sentence summary of the unit for a general reader, written by the build from the record (rank, parent, age, places, members, variants, dinosaurs recorded from it), followed after a blank line by a narrative in our own words where the record has one.',
610
+ )
611
+ period: Period
612
+ dispute: Optional[Dispute] = None
613
+ references: List[Reference]
614
+
615
+
616
+ class Size(BaseModel):
617
+ length_m: Optional[SizeRange] = None
618
+ weight_kg: Optional[SizeRange] = None
619
+ hip_height_m: Optional[SizeRange] = None
620
+ skull_length_m: Optional[SizeRange] = None
621
+
622
+
623
+ class Clade(BaseModel):
624
+ rank: CladeRanks
625
+ description: str = Field(
626
+ ...,
627
+ description='A summary the build writes from the record (what the clade is and who named it, when and where its members lived, its subgroups and best-known genera, their way of life, and who revised it), followed after a blank line by a narrative in our own words where the record has one.',
628
+ )
629
+ dispute: Optional[Dispute] = None
630
+ taxonomy: List[str] = Field(
631
+ ...,
632
+ description="Ordered ancestor clade names from root to the record's placement.",
633
+ )
634
+ type_genus: Optional[str] = Field(
635
+ None, description='Type genus of a rank-based name; absent for unranked clades.'
636
+ )
637
+ identifiers: Optional[List[Identifier]] = Field(
638
+ None,
639
+ description="The clade's identifiers in other databases, in the same form as a genus's.",
640
+ )
641
+ described: Optional[int] = Field(
642
+ None, description='Year the clade was erected (derived from erected_in).'
643
+ )
644
+ authors: Optional[str] = Field(
645
+ None, description='Author(s) who erected the clade (derived from erected_in).'
646
+ )
647
+ erected_in: Optional[str] = Field(
648
+ None,
649
+ description='Reference id of the paper that erected the clade name; the authors and year above derive from it.',
650
+ )
651
+ described_in: Optional[str] = Field(
652
+ None,
653
+ description='Reference id of the authoritative descriptive source, such as a later definition or diagnosis; falls back to erected_in.',
654
+ )
655
+ diagnostic_features: Optional[List[str]] = None
656
+ synonyms: Optional[List[Synonym]] = None
657
+ references: Optional[List[Reference]] = None
658
+
659
+
660
+ class Species(BaseModel):
661
+ name: str = Field(..., description='Binomial (e.g. "Tyrannosaurus rex").')
662
+ status: Status
663
+ type_species: Optional[bool] = None
664
+ completeness: Optional[Completeness] = None
665
+ etymology: Optional[str] = None
666
+ pronunciation: Optional[Pronunciation] = None
667
+ type_specimen: Optional[TypeSpecimen] = None
668
+ period: Period
669
+ location: Optional[Location] = None
670
+ size: Optional[Size] = None
671
+ described: Optional[int] = Field(
672
+ None, description='Year the species was described (derived from erected_in).'
673
+ )
674
+ authors: Optional[str] = Field(
675
+ None, description='Species author(s) (derived from erected_in).'
676
+ )
677
+ description: Optional[str] = None
678
+ synonyms: Optional[List[Synonym]] = None
679
+ diagnostic_features: Optional[List[str]] = None
680
+ erected_in: str = Field(
681
+ ...,
682
+ description='Reference id of the paper that named the species, its ICZN authority; the authors and year above derive from it.',
683
+ )
684
+ erected_as: Optional[str] = Field(
685
+ None,
686
+ description='The binomial as first published, present when the species was named in another genus; the species authority is then cited in parentheses.',
687
+ )
688
+ described_in: Optional[str] = Field(
689
+ None,
690
+ description='Reference id of the authoritative descriptive source; falls back to erected_in.',
691
+ )
692
+
693
+
694
+ class Genus(BaseModel):
695
+ genus: str
696
+ parent: str = Field(..., description='Parent clade name (a node in tree).')
697
+ placement: Optional[Placement] = None
698
+ taxonomy: List[str] = Field(
699
+ ...,
700
+ description="Ordered ancestor clade names from root to the record's placement.",
701
+ )
702
+ etymology: Optional[str] = None
703
+ pronunciation: Optional[Pronunciation] = None
704
+ description: str = Field(
705
+ ...,
706
+ description='A summary the build writes from the record (what the genus is and who named it, when and where it lived, its species, type material and naming history, size and way of life, well-known specimens), followed after a blank line by a narrative in our own words where the record has one.',
707
+ )
708
+ dispute: Optional[Dispute] = None
709
+ diet: Optional[Diet] = None
710
+ locomotion: Optional[Locomotion] = None
711
+ paleoenvironment: Optional[List[Paleoenvironments]] = None
712
+ appearance: Optional[Appearance] = None
713
+ diagnostic_features: Optional[List[str]] = None
714
+ identifiers: Optional[List[Identifier]] = None
715
+ synonyms: Optional[List[Synonym]] = None
716
+ species: List[Species] = Field(..., min_length=1)
717
+ notable_specimens: Optional[List[NotableSpecimen]] = None
718
+ references: Optional[List[Reference]] = None
719
+ iczn_cases: Optional[List[IcznCase]] = None
720
+ described: Optional[int] = Field(
721
+ None, description='Year the genus was erected (derived from its authority).'
722
+ )
723
+ authors: Optional[str] = Field(
724
+ None,
725
+ description='Author(s) who erected the genus (derived from its authority).',
726
+ )
727
+ erected_in: Optional[str] = Field(
728
+ None,
729
+ description="Reference id of the paper that erected the genus, present only when it differs from the type species's erected_in (the type species was named in another genus, or an ICZN ruling replaced it).",
730
+ )
731
+
732
+
733
+ class OpenPaleoDataset(BaseModel):
734
+ field_metadata: Metadata = Field(..., alias='_metadata')
735
+ timescale: Optional[Timescale] = None
736
+ tree: Dict[str, Dict]
737
+ clades: Dict[str, Clade] = Field(
738
+ ..., description='Processed clade records keyed by clade name.'
739
+ )
740
+ genera: Dict[str, Genus] = Field(
741
+ ..., description='Processed genus records keyed by genus name.'
742
+ )
743
+ stratigraphy: Optional[Dict[str, StratigraphicUnit]] = Field(
744
+ None,
745
+ description="Stratigraphic units keyed by name, beds included as entries of their own. Every group, formation, member and bed named in a species' location is a key here.",
746
+ )
open_paleo/py.typed ADDED
File without changes
open_paleo/schema.json ADDED
@@ -0,0 +1,397 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://raw.githubusercontent.com/open-paleo/data/main/schemas/open-paleo.schema.json",
4
+ "title": "Open Paleo dataset",
5
+ "description": "Schema for the built Open Paleo dataset (dist/open-paleo.json and dist/open-paleo.yml). This describes the STABLE output contract, versioned by _metadata.schema_version. The source YAML under genera/, clades/, and references/ is an editing format and is NOT covered by this schema. Objects intentionally allow additional properties so that future additive (minor-version) fields validate against an earlier schema of the same major version (before 1.0.0, additive changes are patch versions and the same holds within one 0.MINOR line). Controlled-vocabulary enums under $defs mirror schema.yml, which remains the authoritative source (a validator check keeps them in sync).",
6
+ "type": "object",
7
+ "required": ["_metadata", "tree", "clades", "genera"],
8
+ "properties": {
9
+ "_metadata": { "$ref": "#/$defs/metadata" },
10
+ "timescale": { "$ref": "#/$defs/timescale" },
11
+ "tree": { "$ref": "#/$defs/treeNode" },
12
+ "clades": {
13
+ "type": "object",
14
+ "description": "Processed clade records keyed by clade name.",
15
+ "additionalProperties": { "$ref": "#/$defs/clade" }
16
+ },
17
+ "genera": {
18
+ "type": "object",
19
+ "description": "Processed genus records keyed by genus name.",
20
+ "additionalProperties": { "$ref": "#/$defs/genus" }
21
+ },
22
+ "stratigraphy": {
23
+ "type": "object",
24
+ "description": "Stratigraphic units keyed by name, beds included as entries of their own. Every group, formation, member and bed named in a species' location is a key here.",
25
+ "additionalProperties": { "$ref": "#/$defs/stratigraphicUnit" }
26
+ }
27
+ },
28
+ "$defs": {
29
+ "metadata": {
30
+ "type": "object",
31
+ "required": ["version", "schema_version", "built_at", "license", "attribution", "genus_count", "clade_count"],
32
+ "properties": {
33
+ "version": { "type": "string", "description": "Calendar version of the data release (YYYY.MM)." },
34
+ "schema_version": { "type": "string", "description": "Semantic version of this output schema (see docs/VERSIONING.md)." },
35
+ "built_at": { "type": "string", "format": "date-time" },
36
+ "license": { "type": "string" },
37
+ "attribution": { "type": "string" },
38
+ "genus_count": { "type": "integer", "minimum": 0 },
39
+ "clade_count": { "type": "integer", "minimum": 0 },
40
+ "paleogeography": {
41
+ "type": "object",
42
+ "description": "The plate model behind location.paleocoordinates, with the citation and license to credit it by. Absent when the build attached no paleocoordinates.",
43
+ "required": ["model", "citation", "license"],
44
+ "properties": {
45
+ "model": { "type": "string", "description": "The model's name, as recorded in each paleocoordinates.model." },
46
+ "citation": { "type": "string" },
47
+ "license": { "type": "string", "description": "License of the model's data." }
48
+ }
49
+ }
50
+ }
51
+ },
52
+ "timescale": {
53
+ "type": "object",
54
+ "description": "The chronostratigraphic timescale the dataset's ages are read against: every stage in schema.yml with its boundary ages and the epoch it belongs to. Covers only the stages and epochs the dataset's records use, so an epoch's span derived from its stages here can be shorter than the epoch's full span.",
55
+ "required": ["chart", "stages"],
56
+ "properties": {
57
+ "chart": { "type": "string", "description": "The published chart the stage boundaries follow." },
58
+ "stages": {
59
+ "type": "object",
60
+ "description": "Stages keyed by name, youngest first.",
61
+ "propertyNames": { "$ref": "#/$defs/stages" },
62
+ "additionalProperties": {
63
+ "type": "object",
64
+ "required": ["period", "from_ma", "to_ma"],
65
+ "properties": {
66
+ "period": { "$ref": "#/$defs/periods", "description": "The epoch the stage belongs to, in the same form as species[].period.name." },
67
+ "from_ma": { "type": "number", "description": "Age of the stage's base, in millions of years." },
68
+ "to_ma": { "type": "number", "description": "Age of the stage's top, in millions of years." }
69
+ }
70
+ }
71
+ }
72
+ }
73
+ },
74
+ "treeNode": {
75
+ "type": "object",
76
+ "description": "Recursive clade hierarchy: each key is a clade name whose value is its subtree (an empty object for a leaf).",
77
+ "additionalProperties": { "$ref": "#/$defs/treeNode" }
78
+ },
79
+ "clade": {
80
+ "type": "object",
81
+ "required": ["rank", "description", "taxonomy"],
82
+ "properties": {
83
+ "rank": { "$ref": "#/$defs/clade_ranks" },
84
+ "description": { "type": "string", "description": "A summary the build writes from the record (what the clade is and who named it, when and where its members lived, its subgroups and best-known genera, their way of life, and who revised it), followed after a blank line by a narrative in our own words where the record has one." },
85
+ "dispute": { "$ref": "#/$defs/dispute" },
86
+ "taxonomy": { "$ref": "#/$defs/taxonomy" },
87
+ "type_genus": { "type": "string", "description": "Type genus of a rank-based name; absent for unranked clades." },
88
+ "identifiers": { "type": "array", "items": { "$ref": "#/$defs/identifier" }, "description": "The clade's identifiers in other databases, in the same form as a genus's." },
89
+ "described": { "type": "integer", "description": "Year the clade was erected (derived from erected_in)." },
90
+ "authors": { "type": "string", "description": "Author(s) who erected the clade (derived from erected_in)." },
91
+ "erected_in": { "type": "string", "description": "Reference id of the paper that erected the clade name; the authors and year above derive from it." },
92
+ "described_in": { "type": "string", "description": "Reference id of the authoritative descriptive source, such as a later definition or diagnosis; falls back to erected_in." },
93
+ "diagnostic_features": { "type": "array", "items": { "type": "string" } },
94
+ "synonyms": { "type": "array", "items": { "$ref": "#/$defs/synonym" } },
95
+ "references": { "type": "array", "items": { "$ref": "#/$defs/reference" } }
96
+ }
97
+ },
98
+ "genus": {
99
+ "type": "object",
100
+ "required": ["genus", "parent", "description", "species", "taxonomy"],
101
+ "properties": {
102
+ "genus": { "type": "string" },
103
+ "parent": { "type": "string", "description": "Parent clade name (a node in tree)." },
104
+ "placement": { "$ref": "#/$defs/placement" },
105
+ "taxonomy": { "$ref": "#/$defs/taxonomy" },
106
+ "etymology": { "type": "string" },
107
+ "pronunciation": { "$ref": "#/$defs/pronunciation" },
108
+ "description": { "type": "string", "description": "A summary the build writes from the record (what the genus is and who named it, when and where it lived, its species, type material and naming history, size and way of life, well-known specimens), followed after a blank line by a narrative in our own words where the record has one." },
109
+ "dispute": { "$ref": "#/$defs/dispute" },
110
+ "diet": { "$ref": "#/$defs/diet" },
111
+ "locomotion": { "$ref": "#/$defs/locomotion" },
112
+ "paleoenvironment": { "type": "array", "items": { "$ref": "#/$defs/paleoenvironments" } },
113
+ "appearance": { "$ref": "#/$defs/appearance" },
114
+ "diagnostic_features": { "type": "array", "items": { "type": "string" } },
115
+ "identifiers": { "type": "array", "items": { "$ref": "#/$defs/identifier" } },
116
+ "synonyms": { "type": "array", "items": { "$ref": "#/$defs/synonym" } },
117
+ "species": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/species" } },
118
+ "notable_specimens": { "type": "array", "items": { "$ref": "#/$defs/notableSpecimen" } },
119
+ "references": { "type": "array", "items": { "$ref": "#/$defs/reference" } },
120
+ "iczn_cases": { "type": "array", "items": { "$ref": "#/$defs/icznCase" } },
121
+ "described": { "type": "integer", "description": "Year the genus was erected (derived from its authority)." },
122
+ "authors": { "type": "string", "description": "Author(s) who erected the genus (derived from its authority)." },
123
+ "erected_in": { "type": "string", "description": "Reference id of the paper that erected the genus, present only when it differs from the type species's erected_in (the type species was named in another genus, or an ICZN ruling replaced it)." }
124
+ }
125
+ },
126
+ "species": {
127
+ "type": "object",
128
+ "required": ["name", "status", "period", "erected_in"],
129
+ "properties": {
130
+ "name": { "type": "string", "description": "Binomial (e.g. \"Tyrannosaurus rex\")." },
131
+ "status": { "$ref": "#/$defs/status" },
132
+ "type_species": { "type": "boolean" },
133
+ "completeness": { "$ref": "#/$defs/completeness" },
134
+ "etymology": { "type": "string" },
135
+ "pronunciation": { "$ref": "#/$defs/pronunciation" },
136
+ "type_specimen": { "$ref": "#/$defs/typeSpecimen" },
137
+ "period": { "$ref": "#/$defs/period" },
138
+ "location": { "$ref": "#/$defs/location" },
139
+ "size": { "$ref": "#/$defs/size" },
140
+ "described": { "type": "integer", "description": "Year the species was described (derived from erected_in)." },
141
+ "authors": { "type": "string", "description": "Species author(s) (derived from erected_in)." },
142
+ "description": { "type": "string" },
143
+ "synonyms": { "type": "array", "items": { "$ref": "#/$defs/synonym" } },
144
+ "diagnostic_features": { "type": "array", "items": { "type": "string" } },
145
+ "erected_in": { "type": "string", "description": "Reference id of the paper that named the species, its ICZN authority; the authors and year above derive from it." },
146
+ "erected_as": { "type": "string", "description": "The binomial as first published, present when the species was named in another genus; the species authority is then cited in parentheses." },
147
+ "described_in": { "type": "string", "description": "Reference id of the authoritative descriptive source; falls back to erected_in." }
148
+ }
149
+ },
150
+ "former_id_reasons": {
151
+ "type": "string",
152
+ "enum": ["renumbered", "rehoused"]
153
+ },
154
+ "thesis_types": {
155
+ "type": "string",
156
+ "enum": ["doctoral", "masters", "habilitation", "dissertation-abstract"]
157
+ },
158
+ "formerId": {
159
+ "type": "object",
160
+ "required": ["from_id", "to_id", "reason"],
161
+ "description": "One step in a specimen's identifier history. A specimen that moved twice is recorded as two entries (A to B, then B to C), so neither end is called \"current\". Prefix changes caused by an institution being recoded (BMNH to NHMUK) are NOT recorded here; those resolve through the append-only aliases in institutions.yaml.",
162
+ "properties": {
163
+ "from_id": { "type": "string", "description": "The catalogue number before the change." },
164
+ "to_id": { "type": "string", "description": "The catalogue number after the change." },
165
+ "from_institution": { "type": "string", "description": "Resolved display name of the institution before the change. Present only when reason is 'rehoused'." },
166
+ "to_institution": { "type": "string", "description": "Resolved display name of the institution after the change. Present only when reason is 'rehoused'." },
167
+ "reason": { "$ref": "#/$defs/former_id_reasons" },
168
+ "source": { "type": "string", "description": "Reference id of the work documenting the change -- not the works that merely used the old number. Absent when no publication documents it." },
169
+ "notes": { "type": "string", "description": "Why the change happened, when that is itself of interest." }
170
+ }
171
+ },
172
+ "typeSpecimen": {
173
+ "type": "object",
174
+ "description": "Type-specimen block: the holotype, or a syntype/lectotype/neotype series (see specimen_type).",
175
+ "properties": {
176
+ "specimen_id": { "type": "array", "items": { "type": "string" }, "description": "Catalogue number(s), one per element." },
177
+ "nickname": { "type": "string", "description": "Informal name the type specimen is known by (e.g. \"Happy\"). A type specimen is never also listed in notable_specimens." },
178
+ "specimen_type": { "$ref": "#/$defs/specimen_types" },
179
+ "institution": { "type": "string", "description": "Resolved institution display name." },
180
+ "material": { "type": "string" },
181
+ "status": { "$ref": "#/$defs/holotype_status" },
182
+ "completeness": { "$ref": "#/$defs/completeness" },
183
+ "former_ids": { "type": "array", "items": { "$ref": "#/$defs/formerId" }, "description": "Identifier history: numbers this specimen was catalogued under before its current one." },
184
+ "notes": { "type": "string" }
185
+ }
186
+ },
187
+ "notableSpecimen": {
188
+ "type": "object",
189
+ "required": ["significance"],
190
+ "properties": {
191
+ "nickname": { "type": "string" },
192
+ "specimen_id": { "type": "array", "items": { "type": "string" } },
193
+ "institution": { "type": "string", "description": "Resolved institution display name." },
194
+ "status": { "$ref": "#/$defs/holotype_status" },
195
+ "species": { "type": "string" },
196
+ "category": { "$ref": "#/$defs/specimen_categories" },
197
+ "significance": { "type": "string" },
198
+ "discovered": {
199
+ "type": "object",
200
+ "properties": {
201
+ "year": { "type": "integer" },
202
+ "by": { "type": "string" }
203
+ }
204
+ },
205
+ "former_ids": { "type": "array", "items": { "$ref": "#/$defs/formerId" }, "description": "Identifier history: numbers this specimen was catalogued under before its current one." },
206
+ "references": { "type": "array", "items": { "type": "string" }, "description": "Reference ids resolving within this genus's references." }
207
+ }
208
+ },
209
+ "reference": {
210
+ "type": "object",
211
+ "required": ["id"],
212
+ "description": "Inflated bibliographic record (store fields merged with the citing pointer's local notes).",
213
+ "properties": {
214
+ "id": { "type": "string" },
215
+ "authors": { "type": "string" },
216
+ "year": { "type": "integer" },
217
+ "title": { "type": "string" },
218
+ "journal": { "type": "string" },
219
+ "book": { "type": "string" },
220
+ "series": { "type": "string" },
221
+ "thesis": { "$ref": "#/$defs/thesis_types", "description": "Degree the work was submitted for, when it is a thesis." },
222
+ "school": { "type": "string", "description": "Awarding institution of a thesis." },
223
+ "publisher": { "type": "string" },
224
+ "volume": { "type": "string" },
225
+ "issue": { "type": "string" },
226
+ "pages": { "type": "string" },
227
+ "article_number": { "type": "string" },
228
+ "doi": { "type": "string" },
229
+ "isbn": { "type": "string" },
230
+ "url": { "type": "string" },
231
+ "notes": { "type": "string" }
232
+ }
233
+ },
234
+ "identifier": {
235
+ "type": "object",
236
+ "properties": {
237
+ "source": { "$ref": "#/$defs/identifier_sources" },
238
+ "id": { "type": "string" }
239
+ }
240
+ },
241
+ "synonym": {
242
+ "type": "object",
243
+ "required": ["name", "type"],
244
+ "properties": {
245
+ "name": { "type": "string" },
246
+ "type": { "$ref": "#/$defs/synonym_types" },
247
+ "reason": { "type": "string" }
248
+ }
249
+ },
250
+ "icznCase": {
251
+ "type": "object",
252
+ "required": ["type", "status"],
253
+ "properties": {
254
+ "type": { "$ref": "#/$defs/iczn_case_types" },
255
+ "status": { "$ref": "#/$defs/iczn_case_statuses" },
256
+ "case": { "type": "string", "description": "The Commission's case number." },
257
+ "ruling": { "type": "string", "description": "Reference id of the published Opinion; present only when status is opinion." },
258
+ "petition": { "type": "string", "description": "Reference id of the Case/application." },
259
+ "notices": { "type": "array", "items": { "type": "string" }, "description": "Reference ids of the Commission's published notices about the case (receipt, closure)." },
260
+ "notes": { "type": "string" }
261
+ }
262
+ },
263
+ "dispute": {
264
+ "type": "object",
265
+ "required": ["summary"],
266
+ "properties": {
267
+ "summary": { "type": "string" }
268
+ }
269
+ },
270
+ "pronunciation": {
271
+ "type": "object",
272
+ "description": "How a name is pronounced. On a genus it covers the genus name; on a species, the specific epithet alone.",
273
+ "properties": {
274
+ "ipa": { "type": "string" },
275
+ "phonetic": { "type": "string" }
276
+ }
277
+ },
278
+ "appearance": {
279
+ "type": "object",
280
+ "properties": {
281
+ "integument": { "$ref": "#/$defs/integument" },
282
+ "evidence": { "$ref": "#/$defs/integument_evidence" },
283
+ "features": { "type": "array", "items": { "$ref": "#/$defs/appearance_features" } }
284
+ }
285
+ },
286
+ "period": {
287
+ "type": "object",
288
+ "properties": {
289
+ "name": { "type": "array", "items": { "$ref": "#/$defs/periods" } },
290
+ "stage": { "type": "array", "items": { "$ref": "#/$defs/stages" } },
291
+ "from_ma": { "type": "number" },
292
+ "to_ma": { "type": "number" },
293
+ "resolution": { "type": "string", "enum": ["unit", "reworked", "horizon"], "description": "How `stage` relates to the record's stratigraphic unit. \"unit\": no age finer than the containing lithostratigraphic unit has been published, so `stage` is that unit's range rather than a determination for this taxon. \"reworked\": the type specimen was reworked from older beds, so `stage` is the age of those beds and falls outside the unit it was found in. \"horizon\": which bed yielded the type specimen is uncertain, so `stage` covers every candidate bed and reaches outside the named unit. Absent means the age is finer than the unit, or has not been checked." }
294
+ }
295
+ },
296
+ "location": {
297
+ "type": "object",
298
+ "properties": {
299
+ "country": { "type": "string", "pattern": "^[A-Z]{2}$", "description": "ISO 3166-1 alpha-2 code (see schema.yml countries)." },
300
+ "region": { "type": "string", "description": "English name of the ISO 3166-2 subdivision, resolved from region_code." },
301
+ "region_code": { "type": "string", "pattern": "^[A-Z]{2}-[A-Z0-9]{1,3}$", "description": "ISO 3166-2 subdivision code (see regions.yaml). Absent where a country has no subdivisions." },
302
+ "locality": { "type": "string" },
303
+ "group": { "type": "string", "description": "Lithostratigraphic group containing the occurrence; populated when the group is the finest published unit, in which case formation is absent. No rank word in the value." },
304
+ "formation": { "type": "string" },
305
+ "member": { "type": "string", "description": "Member NAME only; an informal upper/lower division goes in part." },
306
+ "bed": { "type": "string", "description": "Named bed, the finest lithostratigraphic rank. Published names only." },
307
+ "part": { "type": "string", "description": "Informal position within the unit named by part_of. Lowercase, because informal divisions are not formally erected names: upper, middle, lower, or an ordinal." },
308
+ "part_of": { "type": "string", "enum": ["group", "formation", "member", "bed"], "description": "Which unit `part` qualifies. Build-derived; always the finest of bed, member, formation and group that is populated." },
309
+ "coordinates": {
310
+ "type": "array",
311
+ "description": "[latitude, longitude] in decimal degrees.",
312
+ "minItems": 2,
313
+ "maxItems": 2,
314
+ "items": { "type": "number" }
315
+ },
316
+ "paleocoordinates": { "$ref": "#/$defs/paleocoordinates" },
317
+ "notes": { "type": "string", "description": "Provenance caveat qualifying the fields above: material not collected in situ, a locality reconstructed after the fact, a horizon never recorded. Not a general comment field." }
318
+ }
319
+ },
320
+ "stratigraphicUnit": {
321
+ "type": "object",
322
+ "description": "A stratigraphic unit or bed. Its period has the same shape as a species' period: its epochs, its stages, and from_ma/to_ma spanning those stages.",
323
+ "required": ["period", "description", "references"],
324
+ "properties": {
325
+ "rank": { "type": "string", "enum": ["supergroup", "group", "subgroup", "formation", "member", "bed"], "description": "The unit's rank. Absent for an informal label that has none." },
326
+ "informal": { "type": "boolean", "description": "True for a unit that was never formally erected but is widely used." },
327
+ "parent": { "type": "string", "description": "Name of the unit this one lies within (a member's formation, a bed's unit); a key of stratigraphy." },
328
+ "variants": { "type": "array", "items": { "type": "string" }, "description": "Other names the literature gives the unit." },
329
+ "lithology": { "type": "string", "description": "What the unit is made of, as a short phrase (\"red mudstone and fine-grained sandstone\"), taken from a cited paper." },
330
+ "description": { "type": "string", "description": "A few-sentence summary of the unit for a general reader, written by the build from the record (rank, parent, age, places, members, variants, dinosaurs recorded from it), followed after a blank line by a narrative in our own words where the record has one." },
331
+ "period": { "$ref": "#/$defs/period" },
332
+ "dispute": { "$ref": "#/$defs/dispute" },
333
+ "references": { "type": "array", "items": { "$ref": "#/$defs/reference" } }
334
+ }
335
+ },
336
+ "paleocoordinates": {
337
+ "type": "object",
338
+ "description": "Where the locality lay at the species' age, reconstructed from its present-day position with the plate model in _metadata.paleogeography. Build-derived. Absent when the record has no age or location, or the model places no plate there. To reconstruct at another age, rotate latitude_present/longitude_present with model_plate_id in the same model.",
339
+ "required": ["latitude", "longitude", "latitude_present", "longitude_present", "age_ma", "model", "model_plate_id", "approximate"],
340
+ "properties": {
341
+ "latitude": { "type": "number", "minimum": -90, "maximum": 90, "description": "Reconstructed latitude in decimal degrees." },
342
+ "longitude": { "type": "number", "minimum": -180, "maximum": 180, "description": "Reconstructed longitude in decimal degrees." },
343
+ "latitude_present": { "type": "number", "minimum": -90, "maximum": 90, "description": "Present-day latitude that was reconstructed: location.coordinates, or the center of the region or country when approximate." },
344
+ "longitude_present": { "type": "number", "minimum": -180, "maximum": 180, "description": "Present-day longitude that was reconstructed." },
345
+ "age_ma": { "type": "number", "description": "Age reconstructed at, in millions of years: the midpoint of the species' age range (period.from_ma/to_ma, else its stages, else its epochs)." },
346
+ "model": { "type": "string", "description": "The plate model, as named in _metadata.paleogeography.model." },
347
+ "model_plate_id": { "type": "integer", "description": "The plate the model assigns the present-day point to. Meaningful only within model." },
348
+ "approximate": { "type": "boolean", "description": "True when the present-day point is the center of the record's region or country rather than coordinates a source prints for the site." }
349
+ }
350
+ },
351
+ "size": {
352
+ "type": "object",
353
+ "properties": {
354
+ "length_m": { "$ref": "#/$defs/sizeRange" },
355
+ "weight_kg": { "$ref": "#/$defs/sizeRange" },
356
+ "hip_height_m": { "$ref": "#/$defs/sizeRange" },
357
+ "skull_length_m": { "$ref": "#/$defs/sizeRange" }
358
+ }
359
+ },
360
+ "sizeRange": {
361
+ "type": "object",
362
+ "required": ["min", "max"],
363
+ "properties": {
364
+ "min": { "type": "number", "exclusiveMinimum": 0 },
365
+ "max": { "type": "number", "exclusiveMinimum": 0 }
366
+ }
367
+ },
368
+ "taxonomy": {
369
+ "type": "array",
370
+ "description": "Ordered ancestor clade names from root to the record's placement.",
371
+ "items": { "type": "string" }
372
+ },
373
+ "status": { "type": "string", "enum": ["valid", "nomen dubium", "nomen nudum", "disputed"] },
374
+ "synonym_types": { "type": "string", "enum": ["junior subjective", "junior objective", "possible subjective", "preoccupied", "reassigned", "emended spelling", "nomen oblitum", "nomen rejectum", "nomen nudum", "nomen ex dissertatione", "nomen manuscriptum", "informal", "boycotted"] },
375
+ "placement": { "type": "string", "enum": ["incertae sedis"], "description": "Genus-level qualifier on the parent placement; set when the genus cannot be assigned below its parent clade." },
376
+ "diet": { "type": "string", "enum": ["herbivore", "carnivore", "omnivore", "insectivore", "piscivore"] },
377
+ "locomotion": { "type": "string", "enum": ["bipedal", "quadrupedal", "facultative"] },
378
+ "completeness": { "type": "string", "enum": ["complete", "partial", "fragmentary"] },
379
+ "holotype_status": { "type": "string", "enum": ["destroyed", "lost", "uncataloged", "unknown"] },
380
+ "specimen_types": { "type": "string", "enum": ["holotype", "syntype", "lectotype", "neotype", "unknown"] },
381
+ "specimen_categories": { "type": "string", "enum": ["most-complete", "largest-individual", "exceptional-preservation", "gut-contents", "reproductive", "pathology", "historic", "iconic", "complementary", "ontogeny", "range-extension", "sensory", "trace-association", "physiology", "individual-variation"] },
382
+ "iczn_case_types": { "type": "string", "enum": ["type-species", "type-specimen", "name-conservation", "name-suppression", "priority-reversal", "spelling-emendation"] },
383
+ "clade_ranks": {
384
+ "type": "string",
385
+ "enum": ["superfamily", "family", "subfamily", "tribe", "unranked"],
386
+ "description": "A clade's rank. A family-group name's rank is fixed by its ending (ICZN Article 29.2); a phylogenetic name in the tree has none and is 'unranked'."
387
+ },
388
+ "iczn_case_statuses": { "type": "string", "enum": ["opinion", "open", "closed", "withdrawn"] },
389
+ "integument": { "type": "string", "enum": ["feathered", "scaled", "armored", "unknown"] },
390
+ "integument_evidence": { "type": "string", "enum": ["direct", "inferred"] },
391
+ "paleoenvironments": { "type": "string", "enum": ["fluvial", "lacustrine", "coastal", "estuarine", "deltaic", "arid", "semiarid", "forested", "wetland", "marine", "polar"] },
392
+ "identifier_sources": { "type": "string", "enum": ["zoobank", "wikidata", "gbif", "pbdb", "eol"] },
393
+ "periods": { "type": "string", "enum": ["Late Triassic", "Middle Triassic", "Early Triassic", "Late Jurassic", "Middle Jurassic", "Early Jurassic", "Late Cretaceous", "Early Cretaceous", "Late Permian", "Middle Permian", "Early Permian", "Paleocene", "Eocene"] },
394
+ "stages": { "type": "string", "enum": ["Ypresian", "Thanetian", "Selandian", "Danian", "Maastrichtian", "Campanian", "Santonian", "Coniacian", "Turonian", "Cenomanian", "Albian", "Aptian", "Barremian", "Hauterivian", "Valanginian", "Berriasian", "Tithonian", "Kimmeridgian", "Oxfordian", "Callovian", "Bathonian", "Bajocian", "Aalenian", "Toarcian", "Pliensbachian", "Sinemurian", "Hettangian", "Rhaetian", "Norian", "Carnian", "Ladinian", "Anisian", "Olenekian", "Induan", "Changhsingian", "Wuchiapingian", "Capitanian", "Wordian", "Roadian", "Kungurian", "Artinskian", "Sakmarian", "Asselian"] },
395
+ "appearance_features": { "type": "string", "enum": ["nasal crest", "hollow cranial crest", "solid cranial crest", "nasal horn", "brow horns", "cranial dome", "cranial bosses", "keratinous beak", "elongate snout", "enlarged caniniform teeth", "neck frill", "frill spikes", "epoccipitals", "downturned snout", "jugal horns", "feather crest", "snout hornlets", "orbital crest", "fleshy cranial crest", "square snout", "frontal horn", "procumbent teeth", "squamosal horns", "elongate neck", "bifurcated cervical spines", "neck spines", "cervical half rings", "dorsal sail", "tall neural spines", "dorsal spines", "midline spike row", "dermal plates", "shoulder spikes", "osteoderms", "body armor", "enlarged manual claws", "sickle claw", "reduced forelimbs", "elongate forelimbs", "quill knobs", "membranous wing", "feathered wings", "hindlimb feathers", "enlarged pedal claws", "multiple pedal claws", "thumb spike", "reduced outer digit", "hooves", "tail club", "tail spikes", "whiplash tail", "tail bristles", "feathered tail"] }
396
+ }
397
+ }
@@ -0,0 +1,71 @@
1
+ Metadata-Version: 2.5
2
+ Name: open-paleo
3
+ Version: 0.4.7
4
+ Summary: Pydantic models and JSON Schema for the Open Paleo dataset
5
+ Project-URL: Homepage, https://github.com/open-paleo/data
6
+ Project-URL: Repository, https://github.com/open-paleo/data
7
+ Project-URL: Issues, https://github.com/open-paleo/data/issues
8
+ Project-URL: Changelog, https://github.com/open-paleo/data/blob/main/CHANGELOG.md
9
+ Author: Open Paleo contributors
10
+ License-Expression: CC-BY-4.0
11
+ License-File: LICENSE
12
+ Keywords: dataset,dinosaurs,json-schema,paleontology,phylogeny,pydantic
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Framework :: Pydantic :: 2
15
+ Classifier: Intended Audience :: Science/Research
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
18
+ Classifier: Typing :: Typed
19
+ Requires-Python: >=3.9
20
+ Requires-Dist: pydantic<3,>=2.10
21
+ Description-Content-Type: text/markdown
22
+
23
+ # open-paleo
24
+
25
+ Pydantic v2 models and the JSON Schema for the built [Open Paleo](https://github.com/open-paleo/data) dataset (`open-paleo.json` / `open-paleo.yml`).
26
+
27
+ ## Install
28
+
29
+ ```bash
30
+ pip install open-paleo
31
+ ```
32
+
33
+ Only pre-1.0 versions are published so far. Until 1.0.0 the output format can change in incompatible ways between minor versions (see [Versioning](#versioning)), so pin to one minor line: `open-paleo~=0.4.7` accepts 0.4.7 and later 0.4 releases, but not 0.5.
34
+
35
+ ## Models
36
+
37
+ ```python
38
+ from pathlib import Path
39
+
40
+ from open_paleo import OpenPaleoDataset
41
+
42
+ dataset = OpenPaleoDataset.model_validate_json(Path("open-paleo.json").read_bytes())
43
+
44
+ for name, genus in dataset.genera.items():
45
+ print(name, genus.parent)
46
+
47
+ tyrannosaurus = dataset.genera["Tyrannosaurus"]
48
+ ```
49
+
50
+ `OpenPaleoDataset` is the whole file. `genera`, `clades` and `stratigraphy` are dictionaries keyed by name. Every object in the file has a model of its own (`Genus`, `Species`, `Clade`, `Reference`, `StratigraphicUnit`, …). The models are generated from the JSON Schema with [datamodel-code-generator](https://github.com/koxudaxi/datamodel-code-generator). The recursive `tree` is typed as a nested dictionary; its full recursive structure is in the schema.
51
+
52
+ ## JSON Schema
53
+
54
+ The package also carries the JSON Schema (draft 2020-12) the models are generated from:
55
+
56
+ ```python
57
+ import json
58
+ from importlib.resources import files
59
+
60
+ schema = json.loads(files("open_paleo").joinpath("schema.json").read_text(encoding="utf-8"))
61
+ ```
62
+
63
+ ## Versioning
64
+
65
+ The package version is the dataset's output schema version, `_metadata.schema_version` in `open-paleo.json`. Install the version that matches the dataset you read. A data release that leaves the output format unchanged publishes no new package version.
66
+
67
+ The rules for when the schema version changes are in [docs/VERSIONING.md](https://github.com/open-paleo/data/blob/main/docs/VERSIONING.md), and each change is listed in the [CHANGELOG](https://github.com/open-paleo/data/blob/main/CHANGELOG.md).
68
+
69
+ ## License
70
+
71
+ [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), like the dataset. Credit "Open Paleo contributors".
@@ -0,0 +1,7 @@
1
+ open_paleo/__init__.py,sha256=TgbqgptX2APbfnNSEhpypGO3YT7VFQDKjL8L9CkrC_E,25283
2
+ open_paleo/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ open_paleo/schema.json,sha256=V0IMf-97DbNlvsTFY-cLtcn4cAJklrGtXJOBeVea0dM,28582
4
+ open_paleo-0.4.7.dist-info/METADATA,sha256=MLxA8Xsi4hH0ofp46Pr1yZwL8UcRwk16skIXa6c7uoI,3047
5
+ open_paleo-0.4.7.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
6
+ open_paleo-0.4.7.dist-info/licenses/LICENSE,sha256=5s8au0nMHrGNWnlK_QsMZCmjsxs1uCwlkocdi1bRkvk,1478
7
+ open_paleo-0.4.7.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.33.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,41 @@
1
+ Creative Commons Attribution 4.0 International
2
+
3
+ Copyright (c) Open Paleo contributors
4
+
5
+ This work is licensed under the Creative Commons Attribution 4.0
6
+ International License. To view a copy of this license, visit
7
+ https://creativecommons.org/licenses/by/4.0/ or send a letter to
8
+ Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
9
+
10
+ You are free to:
11
+
12
+ Share - copy and redistribute the material in any medium or format
13
+ for any purpose, even commercially.
14
+
15
+ Adapt - remix, transform, and build upon the material for any
16
+ purpose, even commercially.
17
+
18
+ Under the following terms:
19
+
20
+ Attribution - You must give appropriate credit, provide a link to
21
+ the license, and indicate if changes were made. You may do so in
22
+ any reasonable manner, but not in any way that suggests the
23
+ licensor endorses you or your use.
24
+
25
+ No additional restrictions - You may not apply legal terms or
26
+ technological measures that legally restrict others from doing
27
+ anything the license permits.
28
+
29
+ Notices:
30
+
31
+ You do not have to comply with the license for elements of the
32
+ material in the public domain or where your use is permitted by
33
+ an applicable exception or limitation.
34
+
35
+ No warranties are given. The license may not give you all of the
36
+ permissions necessary for your intended use. For example, other
37
+ rights such as publicity, privacy, or moral rights may limit how
38
+ you use the material.
39
+
40
+ For the full legal code, see:
41
+ https://creativecommons.org/licenses/by/4.0/legalcode