-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstitution.py
More file actions
64 lines (53 loc) · 2.05 KB
/
Copy pathinstitution.py
File metadata and controls
64 lines (53 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
"""
Copyright (c) 2025 ADernild
Licensed under the MIT License. See LICENSE file in the project root for full license information.
Author: ADernild
Email: alex@dernild.dk
Project: RORClient
Description: Pydantic models for institutions in the ROR API.
"""
from typing import List, Optional
from pydantic import BaseModel, HttpUrl
from .admin import Admin
from .external_id import ExternalId
from .link import Link
from .location import Location
from .name import Name
from .relationship import Relationship
class Institution(BaseModel):
"""
A model representing an institution in the ROR API.
Attributes:
admin (Admin): Administrative information about the record.
domains (List[str]): The domains registered to the institution.
established (Optional[int]): The year the institution was established.
external_ids (List[ExternalId]): Other identifiers for the institution.
id (HttpUrl): The unique ROR ID of the institution.
links (List[Link]): The institution's website and Wikipedia page.
locations (List[Location]): The locations of the institution.
names (List[Name]): The names the institution goes by.
relationships (List[Relationship]): Related organizations in ROR.
status (str): The status of the institution (e.g., active, inactive, withdrawn).
types (List[str]): The types of the institution (e.g., education, funder, healthcare, company, archive, nonprofit, government, facility, other).
"""
admin: Admin
domains: List[str]
established: Optional[int]
external_ids: List[ExternalId]
id: HttpUrl
links: List[Link]
locations: List[Location]
names: List[Name]
relationships: List[Relationship]
status: str
types: List[str]
@property
def id_without_prefix(self) -> str:
"""
Returns the ID without the 'https://ror.org/' prefix.
Returns:
str: The ID without the prefix.
"""
if self.id is not None:
return str(self.id).replace("https://ror.org/", "")
return ""