-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: put back missing pid_names file
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
"""Module for pidname definitions""" | ||
|
||
from typing import Optional | ||
|
||
from pydantic import BaseModel, ConfigDict, Field | ||
|
||
|
||
class BaseName(BaseModel): | ||
"""A simple model associating a name with an abbreviation""" | ||
|
||
model_config = ConfigDict(extra="forbid", use_enum_values=True) | ||
|
||
name: str = Field(..., title="Name") | ||
abbreviation: Optional[str] = Field(default=None, title="Abbreviation") | ||
|
||
|
||
class PIDName(BaseName): | ||
""" | ||
Model for associate a name with a persistent identifier (PID), | ||
the registry for that PID, and abbreviation for that registry | ||
""" | ||
|
||
registry: Optional[BaseName] = Field(default=None, title="Registry") | ||
registry_identifier: Optional[str] = Field(default=None, title="Registry identifier") |