-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merging 0.3.5 changes to main See merge request osti/elink2/elink2python!4
- Loading branch information
Showing
15 changed files
with
662 additions
and
268 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,32 @@ | ||
# Changelog | ||
|
||
## 0.3.1 | ||
- updated package name to elinkapi (from ostiapi) | ||
- numerous README updates | ||
- fix bad request vs. validation exception errors | ||
|
||
## 0.3.2 | ||
- fix issues with media API return issues | ||
- allow optional URL and TITLE parameters for POST and PUT on media | ||
- update usage license to BSD-3 | ||
- add public github URL locations | ||
|
||
## 0.3.3 | ||
- fix reserve DOI to properly return a single record response | ||
- dependency updates | ||
|
||
## 0.3.4 | ||
- changed other_information default typing to list | ||
- update number of dependencies for CVEs | ||
- fix issues with license classifier references | ||
|
||
## 0.3.5 - 05/22/2024 | ||
- added support for ROR ID to affiliations and organizations, with regular-expression-based validation rules | ||
- added new Person Affiliation class to support ROR ID | ||
- deprecated ValidationException in favor of more general support for BadRequestException consolidation | ||
- cleaned up various error messages and conditions | ||
- removed URL from media upload API, migrating to site_url submission via Record endpoints | ||
- fix bug in POST media uploads for files not opening properly | ||
- added Query support for pagination in response to API query_records endpoint | ||
- add documentation README for new Query pagination | ||
- fix various test cases |
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
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
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
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
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
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
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,26 @@ | ||
from pydantic import BaseModel, ConfigDict, field_validator, model_validator | ||
from .utils import Validation | ||
|
||
class Affiliation(BaseModel): | ||
""" | ||
Data model for Person affiliations. | ||
may contain one or both of "name" or "ror_id" values. | ||
"ror_id" is validated against a given pattern for proper format according to ror.org specifications. | ||
""" | ||
model_config = ConfigDict(validate_assignment=True) | ||
|
||
name:str = None | ||
ror_id:str = None | ||
|
||
@model_validator(mode = 'after') | ||
def name_or_ror(self): | ||
if not self.name and not self.ror_id: | ||
raise ValueError("Either name and/or ROR ID value is required.") | ||
return self | ||
|
||
@field_validator("ror_id") | ||
@classmethod | ||
def validate_ror_id(cls, value: str) -> str: | ||
Validation.find_ror_value(value) | ||
return value |
Oops, something went wrong.