ncbi-datasets-pyclient 18.14.0__py3-none-any.whl → 18.16.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. ncbi/datasets/openapi/__init__.py +23 -1
  2. ncbi/datasets/openapi/api/organelle_api.py +24 -24
  3. ncbi/datasets/openapi/api/virus_api.py +132 -132
  4. ncbi/datasets/openapi/api_client.py +1 -1
  5. ncbi/datasets/openapi/configuration.py +1 -1
  6. ncbi/datasets/openapi/models/__init__.py +11 -0
  7. ncbi/datasets/openapi/models/ncbigsupgcolv2_assembly_accessions_reply.py +87 -0
  8. ncbi/datasets/openapi/models/ncbigsupgcolv2_assembly_check_m_histogram_request.py +87 -0
  9. ncbi/datasets/openapi/models/ncbigsupgcolv2_assembly_data_report_draft_request.py +89 -0
  10. ncbi/datasets/openapi/models/ncbigsupgcolv2_assembly_data_reports_request.py +87 -0
  11. ncbi/datasets/openapi/models/ncbigsupgcolv2_chromosome_location.py +54 -0
  12. ncbi/datasets/openapi/models/ncbigsupgcolv2_chromosome_type.py +42 -0
  13. ncbi/datasets/openapi/models/ncbigsupgcolv2_sequence_accession_request.py +87 -0
  14. ncbi/datasets/openapi/models/ncbiprotddv2_parsed_abstract.py +107 -0
  15. ncbi/datasets/openapi/models/ncbiprotddv2_parsed_abstract_author.py +89 -0
  16. ncbi/datasets/openapi/models/ncbiprotddv2_parsed_abstract_epub.py +93 -0
  17. ncbi/datasets/openapi/models/ncbiprotddv2_pubmed_abstract_request.py +87 -0
  18. ncbi/datasets/openapi/models/ncbiprotddv2_redundancy_level.py +1 -0
  19. ncbi/datasets/openapi/models/ncbiprotddv2_similar_structure_request.py +2 -2
  20. {ncbi_datasets_pyclient-18.14.0.dist-info → ncbi_datasets_pyclient-18.16.0.dist-info}/METADATA +14 -3
  21. {ncbi_datasets_pyclient-18.14.0.dist-info → ncbi_datasets_pyclient-18.16.0.dist-info}/RECORD +24 -13
  22. {ncbi_datasets_pyclient-18.14.0.dist-info → ncbi_datasets_pyclient-18.16.0.dist-info}/WHEEL +1 -1
  23. {ncbi_datasets_pyclient-18.14.0.dist-info → ncbi_datasets_pyclient-18.16.0.dist-info}/licenses/LICENSE +0 -0
  24. {ncbi_datasets_pyclient-18.14.0.dist-info → ncbi_datasets_pyclient-18.16.0.dist-info}/top_level.txt +0 -0
@@ -91,7 +91,7 @@ class ApiClient:
91
91
  self.default_headers[header_name] = header_value
92
92
  self.cookie = cookie
93
93
  # Set default User-Agent.
94
- self.user_agent = 'OpenAPI-Generator/v18.14.0/python'
94
+ self.user_agent = 'OpenAPI-Generator/v18.16.0/python'
95
95
  self.client_side_validation = configuration.client_side_validation
96
96
 
97
97
  def __enter__(self):
@@ -546,7 +546,7 @@ conf = ncbi.datasets.openapi.Configuration(
546
546
  "OS: {env}\n"\
547
547
  "Python Version: {pyversion}\n"\
548
548
  "Version of the API: v2\n"\
549
- "SDK Package Version: v18.14.0".\
549
+ "SDK Package Version: v18.16.0".\
550
550
  format(env=sys.platform, pyversion=sys.version)
551
551
 
552
552
  def get_host_settings(self) -> List[HostSetting]:
@@ -13,7 +13,18 @@
13
13
  """ # noqa: E501
14
14
 
15
15
  # import models into model package
16
+ from ncbi.datasets.openapi.models.ncbigsupgcolv2_assembly_accessions_reply import Ncbigsupgcolv2AssemblyAccessionsReply
17
+ from ncbi.datasets.openapi.models.ncbigsupgcolv2_assembly_check_m_histogram_request import Ncbigsupgcolv2AssemblyCheckMHistogramRequest
18
+ from ncbi.datasets.openapi.models.ncbigsupgcolv2_assembly_data_report_draft_request import Ncbigsupgcolv2AssemblyDataReportDraftRequest
19
+ from ncbi.datasets.openapi.models.ncbigsupgcolv2_assembly_data_reports_request import Ncbigsupgcolv2AssemblyDataReportsRequest
20
+ from ncbi.datasets.openapi.models.ncbigsupgcolv2_chromosome_location import Ncbigsupgcolv2ChromosomeLocation
21
+ from ncbi.datasets.openapi.models.ncbigsupgcolv2_chromosome_type import Ncbigsupgcolv2ChromosomeType
22
+ from ncbi.datasets.openapi.models.ncbigsupgcolv2_sequence_accession_request import Ncbigsupgcolv2SequenceAccessionRequest
16
23
  from ncbi.datasets.openapi.models.ncbiprotddv2_chain_footprint import Ncbiprotddv2ChainFootprint
24
+ from ncbi.datasets.openapi.models.ncbiprotddv2_parsed_abstract import Ncbiprotddv2ParsedAbstract
25
+ from ncbi.datasets.openapi.models.ncbiprotddv2_parsed_abstract_author import Ncbiprotddv2ParsedAbstractAuthor
26
+ from ncbi.datasets.openapi.models.ncbiprotddv2_parsed_abstract_epub import Ncbiprotddv2ParsedAbstractEpub
27
+ from ncbi.datasets.openapi.models.ncbiprotddv2_pubmed_abstract_request import Ncbiprotddv2PubmedAbstractRequest
17
28
  from ncbi.datasets.openapi.models.ncbiprotddv2_query_structure_definition import Ncbiprotddv2QueryStructureDefinition
18
29
  from ncbi.datasets.openapi.models.ncbiprotddv2_redundancy_level import Ncbiprotddv2RedundancyLevel
19
30
  from ncbi.datasets.openapi.models.ncbiprotddv2_sdid_request import Ncbiprotddv2SdidRequest
@@ -0,0 +1,87 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ NCBI Datasets API
5
+
6
+ ### NCBI Datasets is a resource that lets you easily gather data from NCBI. The NCBI Datasets version 2 API is updated often to add new features, fix bugs, and enhance usability.
7
+
8
+ The version of the OpenAPI document: v2
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class Ncbigsupgcolv2AssemblyAccessionsReply(BaseModel):
26
+ """
27
+ Ncbigsupgcolv2AssemblyAccessionsReply
28
+ """ # noqa: E501
29
+ accession: Optional[List[StrictStr]] = None
30
+ __properties: ClassVar[List[str]] = ["accession"]
31
+
32
+ model_config = ConfigDict(
33
+ populate_by_name=True,
34
+ validate_assignment=True,
35
+ protected_namespaces=(),
36
+ )
37
+
38
+
39
+ def to_str(self) -> str:
40
+ """Returns the string representation of the model using alias"""
41
+ return pprint.pformat(self.model_dump(by_alias=True))
42
+
43
+ def to_json(self) -> str:
44
+ """Returns the JSON representation of the model using alias"""
45
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
46
+ return json.dumps(self.to_dict())
47
+
48
+ @classmethod
49
+ def from_json(cls, json_str: str) -> Optional[Self]:
50
+ """Create an instance of Ncbigsupgcolv2AssemblyAccessionsReply from a JSON string"""
51
+ return cls.from_dict(json.loads(json_str))
52
+
53
+ def to_dict(self) -> Dict[str, Any]:
54
+ """Return the dictionary representation of the model using alias.
55
+
56
+ This has the following differences from calling pydantic's
57
+ `self.model_dump(by_alias=True)`:
58
+
59
+ * `None` is only added to the output dict for nullable fields that
60
+ were set at model initialization. Other fields with value `None`
61
+ are ignored.
62
+ """
63
+ excluded_fields: Set[str] = set([
64
+ ])
65
+
66
+ _dict = self.model_dump(
67
+ by_alias=True,
68
+ exclude=excluded_fields,
69
+ exclude_none=True,
70
+ )
71
+ return _dict
72
+
73
+ @classmethod
74
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
75
+ """Create an instance of Ncbigsupgcolv2AssemblyAccessionsReply from a dict"""
76
+ if obj is None:
77
+ return None
78
+
79
+ if not isinstance(obj, dict):
80
+ return cls.model_validate(obj)
81
+
82
+ _obj = cls.model_validate({
83
+ "accession": obj.get("accession")
84
+ })
85
+ return _obj
86
+
87
+
@@ -0,0 +1,87 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ NCBI Datasets API
5
+
6
+ ### NCBI Datasets is a resource that lets you easily gather data from NCBI. The NCBI Datasets version 2 API is updated often to add new features, fix bugs, and enhance usability.
7
+
8
+ The version of the OpenAPI document: v2
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, StrictInt
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class Ncbigsupgcolv2AssemblyCheckMHistogramRequest(BaseModel):
26
+ """
27
+ Ncbigsupgcolv2AssemblyCheckMHistogramRequest
28
+ """ # noqa: E501
29
+ tax_id: Optional[StrictInt] = None
30
+ __properties: ClassVar[List[str]] = ["tax_id"]
31
+
32
+ model_config = ConfigDict(
33
+ populate_by_name=True,
34
+ validate_assignment=True,
35
+ protected_namespaces=(),
36
+ )
37
+
38
+
39
+ def to_str(self) -> str:
40
+ """Returns the string representation of the model using alias"""
41
+ return pprint.pformat(self.model_dump(by_alias=True))
42
+
43
+ def to_json(self) -> str:
44
+ """Returns the JSON representation of the model using alias"""
45
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
46
+ return json.dumps(self.to_dict())
47
+
48
+ @classmethod
49
+ def from_json(cls, json_str: str) -> Optional[Self]:
50
+ """Create an instance of Ncbigsupgcolv2AssemblyCheckMHistogramRequest from a JSON string"""
51
+ return cls.from_dict(json.loads(json_str))
52
+
53
+ def to_dict(self) -> Dict[str, Any]:
54
+ """Return the dictionary representation of the model using alias.
55
+
56
+ This has the following differences from calling pydantic's
57
+ `self.model_dump(by_alias=True)`:
58
+
59
+ * `None` is only added to the output dict for nullable fields that
60
+ were set at model initialization. Other fields with value `None`
61
+ are ignored.
62
+ """
63
+ excluded_fields: Set[str] = set([
64
+ ])
65
+
66
+ _dict = self.model_dump(
67
+ by_alias=True,
68
+ exclude=excluded_fields,
69
+ exclude_none=True,
70
+ )
71
+ return _dict
72
+
73
+ @classmethod
74
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
75
+ """Create an instance of Ncbigsupgcolv2AssemblyCheckMHistogramRequest from a dict"""
76
+ if obj is None:
77
+ return None
78
+
79
+ if not isinstance(obj, dict):
80
+ return cls.model_validate(obj)
81
+
82
+ _obj = cls.model_validate({
83
+ "tax_id": obj.get("tax_id")
84
+ })
85
+ return _obj
86
+
87
+
@@ -0,0 +1,89 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ NCBI Datasets API
5
+
6
+ ### NCBI Datasets is a resource that lets you easily gather data from NCBI. The NCBI Datasets version 2 API is updated often to add new features, fix bugs, and enhance usability.
7
+
8
+ The version of the OpenAPI document: v2
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class Ncbigsupgcolv2AssemblyDataReportDraftRequest(BaseModel):
26
+ """
27
+ Ncbigsupgcolv2AssemblyDataReportDraftRequest
28
+ """ # noqa: E501
29
+ accession: Optional[StrictStr] = None
30
+ bypass_cache: Optional[StrictStr] = Field(default=None, alias="_bypass_cache")
31
+ __properties: ClassVar[List[str]] = ["accession", "_bypass_cache"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of Ncbigsupgcolv2AssemblyDataReportDraftRequest from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([
65
+ ])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ return _dict
73
+
74
+ @classmethod
75
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
76
+ """Create an instance of Ncbigsupgcolv2AssemblyDataReportDraftRequest from a dict"""
77
+ if obj is None:
78
+ return None
79
+
80
+ if not isinstance(obj, dict):
81
+ return cls.model_validate(obj)
82
+
83
+ _obj = cls.model_validate({
84
+ "accession": obj.get("accession"),
85
+ "_bypass_cache": obj.get("_bypass_cache")
86
+ })
87
+ return _obj
88
+
89
+
@@ -0,0 +1,87 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ NCBI Datasets API
5
+
6
+ ### NCBI Datasets is a resource that lets you easily gather data from NCBI. The NCBI Datasets version 2 API is updated often to add new features, fix bugs, and enhance usability.
7
+
8
+ The version of the OpenAPI document: v2
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class Ncbigsupgcolv2AssemblyDataReportsRequest(BaseModel):
26
+ """
27
+ Ncbigsupgcolv2AssemblyDataReportsRequest
28
+ """ # noqa: E501
29
+ accessions: Optional[List[StrictStr]] = None
30
+ __properties: ClassVar[List[str]] = ["accessions"]
31
+
32
+ model_config = ConfigDict(
33
+ populate_by_name=True,
34
+ validate_assignment=True,
35
+ protected_namespaces=(),
36
+ )
37
+
38
+
39
+ def to_str(self) -> str:
40
+ """Returns the string representation of the model using alias"""
41
+ return pprint.pformat(self.model_dump(by_alias=True))
42
+
43
+ def to_json(self) -> str:
44
+ """Returns the JSON representation of the model using alias"""
45
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
46
+ return json.dumps(self.to_dict())
47
+
48
+ @classmethod
49
+ def from_json(cls, json_str: str) -> Optional[Self]:
50
+ """Create an instance of Ncbigsupgcolv2AssemblyDataReportsRequest from a JSON string"""
51
+ return cls.from_dict(json.loads(json_str))
52
+
53
+ def to_dict(self) -> Dict[str, Any]:
54
+ """Return the dictionary representation of the model using alias.
55
+
56
+ This has the following differences from calling pydantic's
57
+ `self.model_dump(by_alias=True)`:
58
+
59
+ * `None` is only added to the output dict for nullable fields that
60
+ were set at model initialization. Other fields with value `None`
61
+ are ignored.
62
+ """
63
+ excluded_fields: Set[str] = set([
64
+ ])
65
+
66
+ _dict = self.model_dump(
67
+ by_alias=True,
68
+ exclude=excluded_fields,
69
+ exclude_none=True,
70
+ )
71
+ return _dict
72
+
73
+ @classmethod
74
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
75
+ """Create an instance of Ncbigsupgcolv2AssemblyDataReportsRequest from a dict"""
76
+ if obj is None:
77
+ return None
78
+
79
+ if not isinstance(obj, dict):
80
+ return cls.model_validate(obj)
81
+
82
+ _obj = cls.model_validate({
83
+ "accessions": obj.get("accessions")
84
+ })
85
+ return _obj
86
+
87
+
@@ -0,0 +1,54 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ NCBI Datasets API
5
+
6
+ ### NCBI Datasets is a resource that lets you easily gather data from NCBI. The NCBI Datasets version 2 API is updated often to add new features, fix bugs, and enhance usability.
7
+
8
+ The version of the OpenAPI document: v2
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import json
17
+ from enum import Enum
18
+ from typing_extensions import Self
19
+
20
+
21
+ class Ncbigsupgcolv2ChromosomeLocation(str, Enum):
22
+ """
23
+ Ncbigsupgcolv2ChromosomeLocation
24
+ """
25
+
26
+ """
27
+ allowed enum values
28
+ """
29
+ LOCATION_UNKNOWN = 'LOCATION_UNKNOWN'
30
+ APICOPLAST = 'APICOPLAST'
31
+ CHLOROPLAST = 'CHLOROPLAST'
32
+ CHROMATOPHORE = 'CHROMATOPHORE'
33
+ CHROMOPLAST = 'CHROMOPLAST'
34
+ CYANELLE = 'CYANELLE'
35
+ HYDROGENOSOME = 'HYDROGENOSOME'
36
+ KINETOPLAST = 'KINETOPLAST'
37
+ LEUCOPLAST = 'LEUCOPLAST'
38
+ MACRONUCLEAR = 'MACRONUCLEAR'
39
+ MITOCHONDRION = 'MITOCHONDRION'
40
+ NUCLEARPROKARYOTE = 'NUCLEARPROKARYOTE'
41
+ NUCLEOMORPH = 'NUCLEOMORPH'
42
+ OTHER_LOCATION = 'OTHER_LOCATION'
43
+ PLASTID = 'PLASTID'
44
+ PROPLASTID = 'PROPLASTID'
45
+ PROVIRALPROPHAGE = 'PROVIRALPROPHAGE'
46
+ VIRIONPHAGE = 'VIRIONPHAGE'
47
+ VIROID = 'VIROID'
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Self:
51
+ """Create an instance of Ncbigsupgcolv2ChromosomeLocation from a JSON string"""
52
+ return cls(json.loads(json_str))
53
+
54
+
@@ -0,0 +1,42 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ NCBI Datasets API
5
+
6
+ ### NCBI Datasets is a resource that lets you easily gather data from NCBI. The NCBI Datasets version 2 API is updated often to add new features, fix bugs, and enhance usability.
7
+
8
+ The version of the OpenAPI document: v2
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import json
17
+ from enum import Enum
18
+ from typing_extensions import Self
19
+
20
+
21
+ class Ncbigsupgcolv2ChromosomeType(str, Enum):
22
+ """
23
+ Ncbigsupgcolv2ChromosomeType
24
+ """
25
+
26
+ """
27
+ allowed enum values
28
+ """
29
+ TYPE_UNKNOWN = 'TYPE_UNKNOWN'
30
+ CHROMOSOME = 'CHROMOSOME'
31
+ EXTRACHROM = 'EXTRACHROM'
32
+ LINKAGEGROUP = 'LINKAGEGROUP'
33
+ OTHER_TYPE = 'OTHER_TYPE'
34
+ PLASMID = 'PLASMID'
35
+ SEGMENT = 'SEGMENT'
36
+
37
+ @classmethod
38
+ def from_json(cls, json_str: str) -> Self:
39
+ """Create an instance of Ncbigsupgcolv2ChromosomeType from a JSON string"""
40
+ return cls(json.loads(json_str))
41
+
42
+
@@ -0,0 +1,87 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ NCBI Datasets API
5
+
6
+ ### NCBI Datasets is a resource that lets you easily gather data from NCBI. The NCBI Datasets version 2 API is updated often to add new features, fix bugs, and enhance usability.
7
+
8
+ The version of the OpenAPI document: v2
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class Ncbigsupgcolv2SequenceAccessionRequest(BaseModel):
26
+ """
27
+ Ncbigsupgcolv2SequenceAccessionRequest
28
+ """ # noqa: E501
29
+ accession: Optional[StrictStr] = None
30
+ __properties: ClassVar[List[str]] = ["accession"]
31
+
32
+ model_config = ConfigDict(
33
+ populate_by_name=True,
34
+ validate_assignment=True,
35
+ protected_namespaces=(),
36
+ )
37
+
38
+
39
+ def to_str(self) -> str:
40
+ """Returns the string representation of the model using alias"""
41
+ return pprint.pformat(self.model_dump(by_alias=True))
42
+
43
+ def to_json(self) -> str:
44
+ """Returns the JSON representation of the model using alias"""
45
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
46
+ return json.dumps(self.to_dict())
47
+
48
+ @classmethod
49
+ def from_json(cls, json_str: str) -> Optional[Self]:
50
+ """Create an instance of Ncbigsupgcolv2SequenceAccessionRequest from a JSON string"""
51
+ return cls.from_dict(json.loads(json_str))
52
+
53
+ def to_dict(self) -> Dict[str, Any]:
54
+ """Return the dictionary representation of the model using alias.
55
+
56
+ This has the following differences from calling pydantic's
57
+ `self.model_dump(by_alias=True)`:
58
+
59
+ * `None` is only added to the output dict for nullable fields that
60
+ were set at model initialization. Other fields with value `None`
61
+ are ignored.
62
+ """
63
+ excluded_fields: Set[str] = set([
64
+ ])
65
+
66
+ _dict = self.model_dump(
67
+ by_alias=True,
68
+ exclude=excluded_fields,
69
+ exclude_none=True,
70
+ )
71
+ return _dict
72
+
73
+ @classmethod
74
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
75
+ """Create an instance of Ncbigsupgcolv2SequenceAccessionRequest from a dict"""
76
+ if obj is None:
77
+ return None
78
+
79
+ if not isinstance(obj, dict):
80
+ return cls.model_validate(obj)
81
+
82
+ _obj = cls.model_validate({
83
+ "accession": obj.get("accession")
84
+ })
85
+ return _obj
86
+
87
+
@@ -0,0 +1,107 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ NCBI Datasets API
5
+
6
+ ### NCBI Datasets is a resource that lets you easily gather data from NCBI. The NCBI Datasets version 2 API is updated often to add new features, fix bugs, and enhance usability.
7
+
8
+ The version of the OpenAPI document: v2
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from ncbi.datasets.openapi.models.ncbiprotddv2_parsed_abstract_author import Ncbiprotddv2ParsedAbstractAuthor
23
+ from ncbi.datasets.openapi.models.ncbiprotddv2_parsed_abstract_epub import Ncbiprotddv2ParsedAbstractEpub
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class Ncbiprotddv2ParsedAbstract(BaseModel):
28
+ """
29
+ Ncbiprotddv2ParsedAbstract
30
+ """ # noqa: E501
31
+ pmid: Optional[StrictStr] = None
32
+ title: Optional[StrictStr] = None
33
+ authors: Optional[List[Ncbiprotddv2ParsedAbstractAuthor]] = None
34
+ epub: Optional[Ncbiprotddv2ParsedAbstractEpub] = None
35
+ abstract_text: Optional[StrictStr] = None
36
+ __properties: ClassVar[List[str]] = ["pmid", "title", "authors", "epub", "abstract_text"]
37
+
38
+ model_config = ConfigDict(
39
+ populate_by_name=True,
40
+ validate_assignment=True,
41
+ protected_namespaces=(),
42
+ )
43
+
44
+
45
+ def to_str(self) -> str:
46
+ """Returns the string representation of the model using alias"""
47
+ return pprint.pformat(self.model_dump(by_alias=True))
48
+
49
+ def to_json(self) -> str:
50
+ """Returns the JSON representation of the model using alias"""
51
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
52
+ return json.dumps(self.to_dict())
53
+
54
+ @classmethod
55
+ def from_json(cls, json_str: str) -> Optional[Self]:
56
+ """Create an instance of Ncbiprotddv2ParsedAbstract from a JSON string"""
57
+ return cls.from_dict(json.loads(json_str))
58
+
59
+ def to_dict(self) -> Dict[str, Any]:
60
+ """Return the dictionary representation of the model using alias.
61
+
62
+ This has the following differences from calling pydantic's
63
+ `self.model_dump(by_alias=True)`:
64
+
65
+ * `None` is only added to the output dict for nullable fields that
66
+ were set at model initialization. Other fields with value `None`
67
+ are ignored.
68
+ """
69
+ excluded_fields: Set[str] = set([
70
+ ])
71
+
72
+ _dict = self.model_dump(
73
+ by_alias=True,
74
+ exclude=excluded_fields,
75
+ exclude_none=True,
76
+ )
77
+ # override the default output from pydantic by calling `to_dict()` of each item in authors (list)
78
+ _items = []
79
+ if self.authors:
80
+ for _item_authors in self.authors:
81
+ if _item_authors:
82
+ _items.append(_item_authors.to_dict())
83
+ _dict['authors'] = _items
84
+ # override the default output from pydantic by calling `to_dict()` of epub
85
+ if self.epub:
86
+ _dict['epub'] = self.epub.to_dict()
87
+ return _dict
88
+
89
+ @classmethod
90
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
91
+ """Create an instance of Ncbiprotddv2ParsedAbstract from a dict"""
92
+ if obj is None:
93
+ return None
94
+
95
+ if not isinstance(obj, dict):
96
+ return cls.model_validate(obj)
97
+
98
+ _obj = cls.model_validate({
99
+ "pmid": obj.get("pmid"),
100
+ "title": obj.get("title"),
101
+ "authors": [Ncbiprotddv2ParsedAbstractAuthor.from_dict(_item) for _item in obj["authors"]] if obj.get("authors") is not None else None,
102
+ "epub": Ncbiprotddv2ParsedAbstractEpub.from_dict(obj["epub"]) if obj.get("epub") is not None else None,
103
+ "abstract_text": obj.get("abstract_text")
104
+ })
105
+ return _obj
106
+
107
+