Organizations
Models
Pydantic models for representing OpenAIRE Organization entities.
This module defines the Pydantic model for an OpenAIRE Organization, including nested models for country and persistent identifiers (PIDs), based on the OpenAIRE data model documentation. Reference: https://graph.openaire.eu/docs/data-model/entities/organization
OrganizationResponse = ApiResponse[Organization]
module-attribute
Type alias for an API response containing a list of Organization
entities.
Country
Bases: BaseModel
Represents the country associated with an organization.
Attributes:
Name | Type | Description |
---|---|---|
code |
str | None
|
The ISO 3166-1 alpha-2 country code (e.g., "GR", "US"). |
label |
str | None
|
The human-readable name of the country (e.g., "Greece"). |
Source code in src/aireloom/models/organization.py
16 17 18 19 20 21 22 23 24 25 26 27 |
|
Organization
Bases: BaseEntity
Model representing an OpenAIRE Organization entity.
Captures details about an organization, including its names, website,
country, and various persistent identifiers. Inherits the id
field
from BaseEntity
.
Attributes:
Name | Type | Description |
---|---|---|
legalShortName |
str | None
|
The official short name or acronym of the organization. |
legalName |
str | None
|
The full official legal name of the organization. |
alternativeNames |
list[str] | None
|
A list of other known names for the organization. |
websiteUrl |
str | None
|
The URL of the organization's official website. |
country |
Country | None
|
A |
pids |
list[OrganizationPid] | None
|
A list of |
Source code in src/aireloom/models/organization.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
|
OrganizationPid
Bases: BaseModel
Represents a persistent identifier (PID) for an organization.
Attributes:
Name | Type | Description |
---|---|---|
scheme |
str | None
|
The scheme of the PID (e.g., "ror", "grid", "isni"). |
value |
str | None
|
The value of the PID. |
Source code in src/aireloom/models/organization.py
30 31 32 33 34 35 36 37 38 39 40 41 |
|
Filters
Bases: BaseModel
Filter model for Organizations API endpoint.
Attributes:
Name | Type | Description |
---|---|---|
search |
str | None
|
Search term for the organization. |
legalName |
str | None
|
Legal name of the organization. |
legalShortName |
str | None
|
Legal short name of the organization. |
id |
str | None
|
OpenAIRE id for the organization. |
pid |
str | None
|
Persistent identifier for the organization. |
countryCode |
str | None
|
Country code of the organization. |
relCommunityId |
str | None
|
Related community ID. |
relCollectedFromDatasourceId |
str | None
|
ID of the datasource from which this was collected. |
Source code in src/aireloom/endpoints.py
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
|
Client
Client for interacting with the OpenAIRE Organizations API endpoint.
This module provides the OrganizationsClient
for accessing OpenAIRE's
organization data. Unlike some other resource clients in aireloom
that
fully leverage bibliofabric
mixins for CRUD operations, this client currently
maintains its own implementations for get
, search
, and iterate
, though
they are based on similar patterns.
OrganizationsClient
Bases: BaseResourceClient
Client for the OpenAIRE Organizations API endpoint.
This client provides methods to retrieve individual organizations (get
),
search for organizations based on filters (search
), and iterate through
all organizations (iterate
). It currently uses custom implementations for these
methods rather than directly using the generic mixins from bibliofabric.resources
.
Attributes:
Name | Type | Description |
---|---|---|
_entity_path |
str
|
The API path for organizations. |
_entity_model |
type[Organization]
|
Pydantic model for a single organization. |
_response_model |
type[OrganizationResponse]
|
Pydantic model for the search response envelope. |
_endpoint_def |
dict
|
Configuration for this endpoint from |
_valid_sort_fields |
set[str]
|
Valid sort fields for this endpoint. |
Source code in src/aireloom/resources/organizations_client.py
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 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 |
|
__init__(api_client)
Initializes the OrganizationsClient.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
api_client
|
AireloomClient
|
An instance of AireloomClient. |
required |
Source code in src/aireloom/resources/organizations_client.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
|
get(org_id)
async
Retrieves a single Organization by its ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
org_id
|
str
|
The ID of the organization. |
required |
Returns:
Type | Description |
---|---|
Organization
|
An Organization object. |
Source code in src/aireloom/resources/organizations_client.py
216 217 218 219 220 221 222 223 224 225 226 |
|
iterate(page_size=100, sort_by=None, filters=None)
async
Iterates through all Organization results.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
page_size
|
int
|
Number of results per page during iteration. |
100
|
sort_by
|
str | None
|
Field to sort by. |
None
|
filters
|
OrganizationsFilters | None
|
An instance of OrganizationsFilters with filter criteria. |
None
|
Yields:
Type | Description |
---|---|
AsyncIterator[Organization]
|
Organization objects. |
Source code in src/aireloom/resources/organizations_client.py
260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 |
|
search(page=1, page_size=DEFAULT_PAGE_SIZE, sort_by=None, filters=None)
async
Searches for Organizations.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
page
|
int
|
Page number (1-indexed). |
1
|
page_size
|
int
|
Number of results per page. |
DEFAULT_PAGE_SIZE
|
sort_by
|
str | None
|
Field to sort by. |
None
|
filters
|
OrganizationsFilters | None
|
An instance of OrganizationsFilters with filter criteria. |
None
|
Returns:
Type | Description |
---|---|
OrganizationResponse
|
An OrganizationResponse object. |
Source code in src/aireloom/resources/organizations_client.py
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 |
|