generated models for EU projects horizon 2020 programm indexes

This commit is contained in:
2026-06-22 23:56:39 +02:00
parent f894a48c31
commit ee7bd7ba05
11 changed files with 1318 additions and 0 deletions
@@ -0,0 +1,103 @@
# coding: utf-8
"""
CORDIS Horizon 2020 Multi-Index API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
The version of the OpenAPI document: 1.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from datetime import datetime
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self
from pydantic_core import to_jsonable_python
class H2020Deliverable(BaseModel):
"""
H2020Deliverable
""" # noqa: E501
collection: Optional[StrictStr] = None
content_update_date: Optional[datetime] = Field(default=None, alias="contentUpdateDate")
deliverable_type: Optional[StrictStr] = Field(default=None, alias="deliverableType")
description: Optional[StrictStr] = None
project_acronym: Optional[StrictStr] = Field(default=None, alias="projectAcronym")
project_id: Optional[StrictStr] = Field(default=None, alias="projectID")
rcn: Optional[StrictStr] = None
url: Optional[StrictStr] = None
__properties: ClassVar[List[str]] = ["collection", "contentUpdateDate", "deliverableType", "description", "projectAcronym", "projectID", "rcn", "url"]
model_config = ConfigDict(
validate_by_name=True,
validate_by_alias=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
return json.dumps(to_jsonable_python(self.to_dict()))
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of H2020Deliverable from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of H2020Deliverable from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"collection": obj.get("collection"),
"contentUpdateDate": obj.get("contentUpdateDate"),
"deliverableType": obj.get("deliverableType"),
"description": obj.get("description"),
"projectAcronym": obj.get("projectAcronym"),
"projectID": obj.get("projectID"),
"rcn": obj.get("rcn"),
"url": obj.get("url")
})
return _obj
@@ -0,0 +1,102 @@
# coding: utf-8
"""
CORDIS Horizon 2020 Multi-Index API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
The version of the OpenAPI document: 1.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self
from pydantic_core import to_jsonable_python
class H2020ErcPI(BaseModel):
"""
H2020ErcPI
""" # noqa: E501
first_name: Optional[StrictStr] = Field(default=None, alias="firstName")
funding_scheme: Optional[StrictStr] = Field(default=None, alias="fundingScheme")
id: Optional[StrictStr] = None
last_name: Optional[StrictStr] = Field(default=None, alias="lastName")
organisation_id: Optional[StrictStr] = Field(default=None, alias="organisationID")
project_acronym: Optional[StrictStr] = Field(default=None, alias="projectAcronym")
project_id: Optional[StrictStr] = Field(default=None, alias="projectID")
title: Optional[StrictStr] = None
__properties: ClassVar[List[str]] = ["firstName", "fundingScheme", "id", "lastName", "organisationID", "projectAcronym", "projectID", "title"]
model_config = ConfigDict(
validate_by_name=True,
validate_by_alias=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
return json.dumps(to_jsonable_python(self.to_dict()))
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of H2020ErcPI from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of H2020ErcPI from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"firstName": obj.get("firstName"),
"fundingScheme": obj.get("fundingScheme"),
"id": obj.get("id"),
"lastName": obj.get("lastName"),
"organisationID": obj.get("organisationID"),
"projectAcronym": obj.get("projectAcronym"),
"projectID": obj.get("projectID"),
"title": obj.get("title")
})
return _obj
@@ -0,0 +1,98 @@
# coding: utf-8
"""
CORDIS Horizon 2020 Multi-Index API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
The version of the OpenAPI document: 1.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self
from pydantic_core import to_jsonable_python
class H2020EurosciVoc(BaseModel):
"""
H2020EurosciVoc
""" # noqa: E501
code: Optional[StrictStr] = None
description: Optional[StrictStr] = None
id: Optional[StrictStr] = None
path: Optional[StrictStr] = None
project_id: Optional[StrictStr] = Field(default=None, alias="projectID")
title: Optional[StrictStr] = None
__properties: ClassVar[List[str]] = ["code", "description", "id", "path", "projectID", "title"]
model_config = ConfigDict(
validate_by_name=True,
validate_by_alias=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
return json.dumps(to_jsonable_python(self.to_dict()))
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of H2020EurosciVoc from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of H2020EurosciVoc from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"code": obj.get("code"),
"description": obj.get("description"),
"id": obj.get("id"),
"path": obj.get("path"),
"projectID": obj.get("projectID"),
"title": obj.get("title")
})
return _obj
@@ -0,0 +1,96 @@
# coding: utf-8
"""
CORDIS Horizon 2020 Multi-Index API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
The version of the OpenAPI document: 1.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self
from pydantic_core import to_jsonable_python
class H2020LegalBasis(BaseModel):
"""
H2020LegalBasis
""" # noqa: E501
id: Optional[StrictStr] = None
legal_basis: Optional[StrictStr] = Field(default=None, alias="legalBasis")
project_id: Optional[StrictStr] = Field(default=None, alias="projectID")
title: Optional[StrictStr] = None
unique_programme_part: Optional[StrictStr] = Field(default=None, alias="uniqueProgrammePart")
__properties: ClassVar[List[str]] = ["id", "legalBasis", "projectID", "title", "uniqueProgrammePart"]
model_config = ConfigDict(
validate_by_name=True,
validate_by_alias=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
return json.dumps(to_jsonable_python(self.to_dict()))
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of H2020LegalBasis from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of H2020LegalBasis from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"id": obj.get("id"),
"legalBasis": obj.get("legalBasis"),
"projectID": obj.get("projectID"),
"title": obj.get("title"),
"uniqueProgrammePart": obj.get("uniqueProgrammePart")
})
return _obj
@@ -0,0 +1,139 @@
# coding: utf-8
"""
CORDIS Horizon 2020 Multi-Index API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
The version of the OpenAPI document: 1.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from datetime import datetime
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional, Union
from typing import Optional, Set
from typing_extensions import Self
from pydantic_core import to_jsonable_python
class H2020Organization(BaseModel):
"""
H2020Organization
""" # noqa: E501
sme: Optional[StrictBool] = Field(default=None, alias="SME")
active: Optional[StrictBool] = None
activity_type: Optional[StrictStr] = Field(default=None, alias="activityType")
city: Optional[StrictStr] = None
contact_form: Optional[StrictStr] = Field(default=None, alias="contactForm")
content_update_date: Optional[datetime] = Field(default=None, alias="contentUpdateDate")
country: Optional[StrictStr] = None
ec_contribution: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="ecContribution")
end_of_participation: Optional[StrictBool] = Field(default=None, alias="endOfParticipation")
geolocation: Optional[StrictStr] = None
id: Optional[StrictStr] = None
name: Optional[StrictStr] = None
net_ec_contribution: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="netEcContribution")
nuts_code: Optional[StrictStr] = Field(default=None, alias="nutsCode")
order: Optional[StrictInt] = None
organisation_id: Optional[StrictStr] = Field(default=None, alias="organisationID")
organization_url: Optional[StrictStr] = Field(default=None, alias="organizationURL")
post_code: Optional[StrictStr] = Field(default=None, alias="postCode")
project_acronym: Optional[StrictStr] = Field(default=None, alias="projectAcronym")
project_id: Optional[StrictStr] = Field(default=None, alias="projectID")
rcn: Optional[StrictStr] = None
role: Optional[StrictStr] = None
short_name: Optional[StrictStr] = Field(default=None, alias="shortName")
street: Optional[StrictStr] = None
total_cost: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="totalCost")
vat_number: Optional[StrictStr] = Field(default=None, alias="vatNumber")
__properties: ClassVar[List[str]] = ["SME", "active", "activityType", "city", "contactForm", "contentUpdateDate", "country", "ecContribution", "endOfParticipation", "geolocation", "id", "name", "netEcContribution", "nutsCode", "order", "organisationID", "organizationURL", "postCode", "projectAcronym", "projectID", "rcn", "role", "shortName", "street", "totalCost", "vatNumber"]
model_config = ConfigDict(
validate_by_name=True,
validate_by_alias=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
return json.dumps(to_jsonable_python(self.to_dict()))
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of H2020Organization from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of H2020Organization from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"SME": obj.get("SME"),
"active": obj.get("active"),
"activityType": obj.get("activityType"),
"city": obj.get("city"),
"contactForm": obj.get("contactForm"),
"contentUpdateDate": obj.get("contentUpdateDate"),
"country": obj.get("country"),
"ecContribution": obj.get("ecContribution"),
"endOfParticipation": obj.get("endOfParticipation"),
"geolocation": obj.get("geolocation"),
"id": obj.get("id"),
"name": obj.get("name"),
"netEcContribution": obj.get("netEcContribution"),
"nutsCode": obj.get("nutsCode"),
"order": obj.get("order"),
"organisationID": obj.get("organisationID"),
"organizationURL": obj.get("organizationURL"),
"postCode": obj.get("postCode"),
"projectAcronym": obj.get("projectAcronym"),
"projectID": obj.get("projectID"),
"rcn": obj.get("rcn"),
"role": obj.get("role"),
"shortName": obj.get("shortName"),
"street": obj.get("street"),
"totalCost": obj.get("totalCost"),
"vatNumber": obj.get("vatNumber")
})
return _obj
@@ -0,0 +1,131 @@
# coding: utf-8
"""
CORDIS Horizon 2020 Multi-Index API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
The version of the OpenAPI document: 1.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from datetime import date, datetime
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional, Union
from typing import Optional, Set
from typing_extensions import Self
from pydantic_core import to_jsonable_python
class H2020Project(BaseModel):
"""
H2020Project
""" # noqa: E501
acronym: Optional[StrictStr] = None
content_update_date: Optional[datetime] = Field(default=None, alias="contentUpdateDate")
ec_max_contribution: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="ecMaxContribution")
ec_signature_date: Optional[date] = Field(default=None, alias="ecSignatureDate")
end_date: Optional[date] = Field(default=None, alias="endDate")
framework_programme: Optional[StrictStr] = Field(default=None, alias="frameworkProgramme")
funding_scheme: Optional[StrictStr] = Field(default=None, alias="fundingScheme")
grant_doi: Optional[StrictStr] = Field(default=None, alias="grantDoi")
human_validated: Optional[StrictBool] = Field(default=None, alias="humanValidated")
id: Optional[StrictStr] = None
keywords: Optional[StrictStr] = None
legal_basis: Optional[StrictStr] = Field(default=None, alias="legalBasis")
master_call: Optional[StrictStr] = Field(default=None, alias="masterCall")
nature: Optional[StrictStr] = None
objective: Optional[StrictStr] = None
rcn: Optional[StrictStr] = None
start_date: Optional[date] = Field(default=None, alias="startDate")
status: Optional[StrictStr] = None
sub_call: Optional[StrictStr] = Field(default=None, alias="subCall")
title: Optional[StrictStr] = None
topics: Optional[StrictStr] = None
total_cost: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="totalCost")
__properties: ClassVar[List[str]] = ["acronym", "contentUpdateDate", "ecMaxContribution", "ecSignatureDate", "endDate", "frameworkProgramme", "fundingScheme", "grantDoi", "humanValidated", "id", "keywords", "legalBasis", "masterCall", "nature", "objective", "rcn", "startDate", "status", "subCall", "title", "topics", "totalCost"]
model_config = ConfigDict(
validate_by_name=True,
validate_by_alias=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
return json.dumps(to_jsonable_python(self.to_dict()))
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of H2020Project from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of H2020Project from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"acronym": obj.get("acronym"),
"contentUpdateDate": obj.get("contentUpdateDate"),
"ecMaxContribution": obj.get("ecMaxContribution"),
"ecSignatureDate": obj.get("ecSignatureDate"),
"endDate": obj.get("endDate"),
"frameworkProgramme": obj.get("frameworkProgramme"),
"fundingScheme": obj.get("fundingScheme"),
"grantDoi": obj.get("grantDoi"),
"humanValidated": obj.get("humanValidated"),
"id": obj.get("id"),
"keywords": obj.get("keywords"),
"legalBasis": obj.get("legalBasis"),
"masterCall": obj.get("masterCall"),
"nature": obj.get("nature"),
"objective": obj.get("objective"),
"rcn": obj.get("rcn"),
"startDate": obj.get("startDate"),
"status": obj.get("status"),
"subCall": obj.get("subCall"),
"title": obj.get("title"),
"topics": obj.get("topics"),
"totalCost": obj.get("totalCost")
})
return _obj
@@ -0,0 +1,224 @@
# coding: utf-8
"""
CORDIS Horizon 2020 Multi-Index API - Extended Models
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from datetime import date, datetime
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional, Union
from typing import Optional, Set
from typing_extensions import Self
from pydantic_core import to_jsonable_python
# Import all the base models
from inse.models.projects_eu_cordis.horizon2020.h2020_project import H2020Project
from inse.models.projects_eu_cordis.horizon2020.h2020_organization import H2020Organization
from inse.models.projects_eu_cordis.horizon2020.h2020_publication import H2020Publication
from inse.models.projects_eu_cordis.horizon2020.h2020_deliverable import H2020Deliverable
from inse.models.projects_eu_cordis.horizon2020.h2020_report_summary import H2020ReportSummary
from inse.models.projects_eu_cordis.horizon2020.h2020_topic import H2020Topic
from inse.models.projects_eu_cordis.horizon2020.h2020_web_link import H2020WebLink
from inse.models.projects_eu_cordis.horizon2020.h2020_eurosci_voc import H2020EurosciVoc
from inse.models.projects_eu_cordis.horizon2020.h2020_legal_basis import H2020LegalBasis
from inse.models.projects_eu_cordis.horizon2020.h2020_erc_pi import H2020ErcPI
class H2020ProjectDetails(BaseModel):
"""
Comprehensive Horizon 2020 Project model combining all related entities.
This model extends the base H2020Project with all associated data.
"""
# Project core information (flattened from H2020Project)
acronym: Optional[StrictStr] = None
content_update_date: Optional[datetime] = Field(default=None, alias="contentUpdateDate")
ec_max_contribution: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="ecMaxContribution")
ec_signature_date: Optional[date] = Field(default=None, alias="ecSignatureDate")
end_date: Optional[date] = Field(default=None, alias="endDate")
framework_programme: Optional[StrictStr] = Field(default=None, alias="frameworkProgramme")
funding_scheme: Optional[StrictStr] = Field(default=None, alias="fundingScheme")
grant_doi: Optional[StrictStr] = Field(default=None, alias="grantDoi")
human_validated: Optional[StrictBool] = Field(default=None, alias="humanValidated")
id: Optional[StrictStr] = None
keywords: Optional[StrictStr] = None
legal_basis: Optional[StrictStr] = Field(default=None, alias="legalBasis")
master_call: Optional[StrictStr] = Field(default=None, alias="masterCall")
nature: Optional[StrictStr] = None
objective: Optional[StrictStr] = None
rcn: Optional[StrictStr] = None
start_date: Optional[date] = Field(default=None, alias="startDate")
status: Optional[StrictStr] = None
sub_call: Optional[StrictStr] = Field(default=None, alias="subCall")
title: Optional[StrictStr] = None
topics: Optional[StrictStr] = None
total_cost: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="totalCost")
# Related entities (collections)
organizations: Optional[List[H2020Organization]] = Field(default=None, description="Organizations participating in the project")
publications: Optional[List[H2020Publication]] = Field(default=None, description="Publications related to the project")
deliverables: Optional[List[H2020Deliverable]] = Field(default=None, description="Deliverables of the project")
report_summaries: Optional[List[H2020ReportSummary]] = Field(default=None, alias="reportSummaries", description="Report summaries for the project")
topics_list: Optional[List[H2020Topic]] = Field(default=None, alias="topicsList", description="Topics associated with the project")
web_links: Optional[List[H2020WebLink]] = Field(default=None, alias="webLinks", description="Web links related to the project")
eurosci_voc: Optional[List[H2020EurosciVoc]] = Field(default=None, alias="eurosciVoc", description="EuroSciVoc classifications")
legal_basis_list: Optional[List[H2020LegalBasis]] = Field(default=None, alias="legalBasisList", description="Legal basis information")
erc_principal_investigators: Optional[List[H2020ErcPI]] = Field(default=None, alias="ercPrincipalInvestigators", description="ERC Principal Investigators (specific to H2020)")
# Project statistics (aggregated)
organization_count: Optional[int] = Field(default=None, alias="organizationCount")
publication_count: Optional[int] = Field(default=None, alias="publicationCount")
deliverable_count: Optional[int] = Field(default=None, alias="deliverableCount")
erc_pi_count: Optional[int] = Field(default=None, alias="ercPiCount")
__properties: ClassVar[List[str]] = [
"acronym", "contentUpdateDate", "ecMaxContribution", "ecSignatureDate",
"endDate", "frameworkProgramme", "fundingScheme", "grantDoi",
"humanValidated", "id", "keywords", "legalBasis", "masterCall",
"nature", "objective", "rcn", "startDate", "status", "subCall",
"title", "topics", "totalCost",
"organizations", "publications", "deliverables", "reportSummaries",
"topicsList", "webLinks", "eurosciVoc", "legalBasisList",
"ercPrincipalInvestigators",
"organizationCount", "publicationCount", "deliverableCount", "ercPiCount"
]
model_config = ConfigDict(
validate_by_name=True,
validate_by_alias=True,
validate_assignment=True,
protected_namespaces=(),
populate_by_name=True,
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
return json.dumps(to_jsonable_python(self.to_dict()))
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of H2020ProjectDetailed from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias."""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of H2020ProjectDetailed from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
# Project core fields
"acronym": obj.get("acronym"),
"contentUpdateDate": obj.get("contentUpdateDate"),
"ecMaxContribution": obj.get("ecMaxContribution"),
"ecSignatureDate": obj.get("ecSignatureDate"),
"endDate": obj.get("endDate"),
"frameworkProgramme": obj.get("frameworkProgramme"),
"fundingScheme": obj.get("fundingScheme"),
"grantDoi": obj.get("grantDoi"),
"humanValidated": obj.get("humanValidated"),
"id": obj.get("id"),
"keywords": obj.get("keywords"),
"legalBasis": obj.get("legalBasis"),
"masterCall": obj.get("masterCall"),
"nature": obj.get("nature"),
"objective": obj.get("objective"),
"rcn": obj.get("rcn"),
"startDate": obj.get("startDate"),
"status": obj.get("status"),
"subCall": obj.get("subCall"),
"title": obj.get("title"),
"topics": obj.get("topics"),
"totalCost": obj.get("totalCost"),
# Related entities
"organizations": [H2020Organization.from_dict(org) for org in obj.get("organizations", [])] if obj.get("organizations") else None,
"publications": [H2020Publication.from_dict(pub) for pub in obj.get("publications", [])] if obj.get("publications") else None,
"deliverables": [H2020Deliverable.from_dict(deliv) for deliv in obj.get("deliverables", [])] if obj.get("deliverables") else None,
"reportSummaries": [H2020ReportSummary.from_dict(report) for report in obj.get("reportSummaries", [])] if obj.get("reportSummaries") else None,
"topicsList": [H2020Topic.from_dict(topic) for topic in obj.get("topicsList", [])] if obj.get("topicsList") else None,
"webLinks": [H2020WebLink.from_dict(link) for link in obj.get("webLinks", [])] if obj.get("webLinks") else None,
"eurosciVoc": [H2020EurosciVoc.from_dict(voc) for voc in obj.get("eurosciVoc", [])] if obj.get("eurosciVoc") else None,
"legalBasisList": [H2020LegalBasis.from_dict(lb) for lb in obj.get("legalBasisList", [])] if obj.get("legalBasisList") else None,
"ercPrincipalInvestigators": [H2020ErcPI.from_dict(pi) for pi in obj.get("ercPrincipalInvestigators", [])] if obj.get("ercPrincipalInvestigators") else None,
# Statistics
"organizationCount": len(obj.get("organizations", [])) if obj.get("organizations") else 0,
"publicationCount": len(obj.get("publications", [])) if obj.get("publications") else 0,
"deliverableCount": len(obj.get("deliverables", [])) if obj.get("deliverables") else 0,
"ercPiCount": len(obj.get("ercPrincipalInvestigators", [])) if obj.get("ercPrincipalInvestigators") else 0,
})
return _obj
@classmethod
def from_project_with_relations(
cls,
project: H2020Project,
organizations: Optional[List[H2020Organization]] = None,
publications: Optional[List[H2020Publication]] = None,
deliverables: Optional[List[H2020Deliverable]] = None,
report_summaries: Optional[List[H2020ReportSummary]] = None,
topics_list: Optional[List[H2020Topic]] = None,
web_links: Optional[List[H2020WebLink]] = None,
eurosci_voc: Optional[List[H2020EurosciVoc]] = None,
legal_basis_list: Optional[List[H2020LegalBasis]] = None,
erc_principal_investigators: Optional[List[H2020ErcPI]] = None,
) -> Self:
"""
Factory method to create a detailed project from a base project and its relations.
Args:
project: The base H2020Project object
organizations: List of organizations participating in the project
publications: List of publications related to the project
deliverables: List of deliverables of the project
report_summaries: List of report summaries
topics_list: List of topics associated with the project
web_links: List of web links
eurosci_voc: List of EuroSciVoc classifications
legal_basis_list: List of legal basis information
erc_principal_investigators: List of ERC Principal Investigators
Returns:
H2020ProjectDetailed instance
"""
project_dict = project.to_dict() if project else {}
return cls(
**project_dict,
organizations=organizations or [],
publications=publications or [],
deliverables=deliverables or [],
reportSummaries=report_summaries or [],
topicsList=topics_list or [],
webLinks=web_links or [],
eurosciVoc=eurosci_voc or [],
legalBasisList=legal_basis_list or [],
ercPrincipalInvestigators=erc_principal_investigators or [],
organizationCount=len(organizations) if organizations else 0,
publicationCount=len(publications) if publications else 0,
deliverableCount=len(deliverables) if deliverables else 0,
ercPiCount=len(erc_principal_investigators) if erc_principal_investigators else 0,
)
@@ -0,0 +1,123 @@
# coding: utf-8
"""
CORDIS Horizon 2020 Multi-Index API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
The version of the OpenAPI document: 1.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from datetime import datetime
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self
from pydantic_core import to_jsonable_python
class H2020Publication(BaseModel):
"""
H2020Publication
""" # noqa: E501
authors: Optional[StrictStr] = None
collection: Optional[StrictStr] = None
content_update_date: Optional[datetime] = Field(default=None, alias="contentUpdateDate")
doi: Optional[StrictStr] = None
id: Optional[StrictStr] = None
is_published_as: Optional[StrictStr] = Field(default=None, alias="isPublishedAs")
journal_number: Optional[StrictStr] = Field(default=None, alias="journalNumber")
journal_title: Optional[StrictStr] = Field(default=None, alias="journalTitle")
project_acronym: Optional[StrictStr] = Field(default=None, alias="projectAcronym")
project_id: Optional[StrictStr] = Field(default=None, alias="projectID")
published_pages: Optional[StrictStr] = Field(default=None, alias="publishedPages")
published_year: Optional[StrictInt] = Field(default=None, alias="publishedYear")
publisher: Optional[StrictStr] = None
qa_processed_doi: Optional[StrictStr] = Field(default=None, alias="qaProcessedDoi")
rcn: Optional[StrictStr] = None
repository_url: Optional[StrictStr] = Field(default=None, alias="repositoryUrl")
title: Optional[StrictStr] = None
volume: Optional[StrictStr] = None
__properties: ClassVar[List[str]] = ["authors", "collection", "contentUpdateDate", "doi", "id", "isPublishedAs", "journalNumber", "journalTitle", "projectAcronym", "projectID", "publishedPages", "publishedYear", "publisher", "qaProcessedDoi", "rcn", "repositoryUrl", "title", "volume"]
model_config = ConfigDict(
validate_by_name=True,
validate_by_alias=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
return json.dumps(to_jsonable_python(self.to_dict()))
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of H2020Publication from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of H2020Publication from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"authors": obj.get("authors"),
"collection": obj.get("collection"),
"contentUpdateDate": obj.get("contentUpdateDate"),
"doi": obj.get("doi"),
"id": obj.get("id"),
"isPublishedAs": obj.get("isPublishedAs"),
"journalNumber": obj.get("journalNumber"),
"journalTitle": obj.get("journalTitle"),
"projectAcronym": obj.get("projectAcronym"),
"projectID": obj.get("projectID"),
"publishedPages": obj.get("publishedPages"),
"publishedYear": obj.get("publishedYear"),
"publisher": obj.get("publisher"),
"qaProcessedDoi": obj.get("qaProcessedDoi"),
"rcn": obj.get("rcn"),
"repositoryUrl": obj.get("repositoryUrl"),
"title": obj.get("title"),
"volume": obj.get("volume")
})
return _obj
@@ -0,0 +1,101 @@
# coding: utf-8
"""
CORDIS Horizon 2020 Multi-Index API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
The version of the OpenAPI document: 1.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from datetime import datetime
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self
from pydantic_core import to_jsonable_python
class H2020ReportSummary(BaseModel):
"""
H2020ReportSummary
""" # noqa: E501
attachments: Optional[StrictStr] = None
content_update_date: Optional[datetime] = Field(default=None, alias="contentUpdateDate")
id: Optional[StrictStr] = None
project_acronym: Optional[StrictStr] = Field(default=None, alias="projectAcronym")
project_id: Optional[StrictStr] = Field(default=None, alias="projectID")
rcn: Optional[StrictStr] = None
title: Optional[StrictStr] = None
__properties: ClassVar[List[str]] = ["attachments", "contentUpdateDate", "id", "projectAcronym", "projectID", "rcn", "title"]
model_config = ConfigDict(
validate_by_name=True,
validate_by_alias=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
return json.dumps(to_jsonable_python(self.to_dict()))
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of H2020ReportSummary from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of H2020ReportSummary from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"attachments": obj.get("attachments"),
"contentUpdateDate": obj.get("contentUpdateDate"),
"id": obj.get("id"),
"projectAcronym": obj.get("projectAcronym"),
"projectID": obj.get("projectID"),
"rcn": obj.get("rcn"),
"title": obj.get("title")
})
return _obj
@@ -0,0 +1,94 @@
# coding: utf-8
"""
CORDIS Horizon 2020 Multi-Index API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
The version of the OpenAPI document: 1.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self
from pydantic_core import to_jsonable_python
class H2020Topic(BaseModel):
"""
H2020Topic
""" # noqa: E501
id: Optional[StrictStr] = None
project_id: Optional[StrictStr] = Field(default=None, alias="projectID")
title: Optional[StrictStr] = None
topic: Optional[StrictStr] = None
__properties: ClassVar[List[str]] = ["id", "projectID", "title", "topic"]
model_config = ConfigDict(
validate_by_name=True,
validate_by_alias=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
return json.dumps(to_jsonable_python(self.to_dict()))
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of H2020Topic from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of H2020Topic from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"id": obj.get("id"),
"projectID": obj.get("projectID"),
"title": obj.get("title"),
"topic": obj.get("topic")
})
return _obj
@@ -0,0 +1,107 @@
# coding: utf-8
"""
CORDIS Horizon 2020 Multi-Index API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
The version of the OpenAPI document: 1.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from datetime import datetime
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self
from pydantic_core import to_jsonable_python
class H2020WebLink(BaseModel):
"""
H2020WebLink
""" # noqa: E501
archived_date: Optional[datetime] = Field(default=None, alias="archivedDate")
available_languages: Optional[StrictStr] = Field(default=None, alias="availableLanguages")
id: Optional[StrictStr] = None
link_id: Optional[StrictStr] = Field(default=None, alias="linkId")
project_id: Optional[StrictStr] = Field(default=None, alias="projectID")
represents: Optional[StrictStr] = None
source: Optional[StrictStr] = None
status: Optional[StrictStr] = None
type: Optional[StrictStr] = None
url: Optional[StrictStr] = None
__properties: ClassVar[List[str]] = ["archivedDate", "availableLanguages", "id", "linkId", "projectID", "represents", "source", "status", "type", "url"]
model_config = ConfigDict(
validate_by_name=True,
validate_by_alias=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
return json.dumps(to_jsonable_python(self.to_dict()))
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of H2020WebLink from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of H2020WebLink from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"archivedDate": obj.get("archivedDate"),
"availableLanguages": obj.get("availableLanguages"),
"id": obj.get("id"),
"linkId": obj.get("linkId"),
"projectID": obj.get("projectID"),
"represents": obj.get("represents"),
"source": obj.get("source"),
"status": obj.get("status"),
"type": obj.get("type"),
"url": obj.get("url")
})
return _obj