esgvoc 0.1.2__py3-none-any.whl → 0.3.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.

Potentially problematic release.


This version of esgvoc might be problematic. Click here for more details.

Files changed (78) hide show
  1. esgvoc/__init__.py +3 -1
  2. esgvoc/api/__init__.py +30 -30
  3. esgvoc/api/_utils.py +28 -14
  4. esgvoc/api/data_descriptors/__init__.py +19 -10
  5. esgvoc/api/data_descriptors/activity.py +8 -45
  6. esgvoc/api/data_descriptors/area_label.py +6 -0
  7. esgvoc/api/data_descriptors/branded_suffix.py +5 -0
  8. esgvoc/api/data_descriptors/branded_variable.py +5 -0
  9. esgvoc/api/data_descriptors/consortium.py +16 -56
  10. esgvoc/api/data_descriptors/data_descriptor.py +106 -0
  11. esgvoc/api/data_descriptors/date.py +3 -46
  12. esgvoc/api/data_descriptors/directory_date.py +5 -0
  13. esgvoc/api/data_descriptors/experiment.py +19 -54
  14. esgvoc/api/data_descriptors/forcing_index.py +3 -45
  15. esgvoc/api/data_descriptors/frequency.py +6 -43
  16. esgvoc/api/data_descriptors/grid_label.py +6 -44
  17. esgvoc/api/data_descriptors/horizontal_label.py +6 -0
  18. esgvoc/api/data_descriptors/initialisation_index.py +3 -44
  19. esgvoc/api/data_descriptors/institution.py +11 -54
  20. esgvoc/api/data_descriptors/license.py +4 -44
  21. esgvoc/api/data_descriptors/mip_era.py +6 -44
  22. esgvoc/api/data_descriptors/model_component.py +7 -45
  23. esgvoc/api/data_descriptors/organisation.py +3 -40
  24. esgvoc/api/data_descriptors/physic_index.py +3 -45
  25. esgvoc/api/data_descriptors/product.py +4 -43
  26. esgvoc/api/data_descriptors/realisation_index.py +3 -44
  27. esgvoc/api/data_descriptors/realm.py +4 -42
  28. esgvoc/api/data_descriptors/resolution.py +6 -44
  29. esgvoc/api/data_descriptors/source.py +18 -53
  30. esgvoc/api/data_descriptors/source_type.py +3 -41
  31. esgvoc/api/data_descriptors/sub_experiment.py +3 -41
  32. esgvoc/api/data_descriptors/table.py +6 -48
  33. esgvoc/api/data_descriptors/temporal_label.py +6 -0
  34. esgvoc/api/data_descriptors/time_range.py +3 -27
  35. esgvoc/api/data_descriptors/variable.py +13 -71
  36. esgvoc/api/data_descriptors/variant_label.py +3 -47
  37. esgvoc/api/data_descriptors/vertical_label.py +5 -0
  38. esgvoc/api/project_specs.py +82 -0
  39. esgvoc/api/projects.py +284 -238
  40. esgvoc/api/report.py +89 -52
  41. esgvoc/api/search.py +31 -11
  42. esgvoc/api/universe.py +57 -48
  43. esgvoc/apps/__init__.py +6 -0
  44. esgvoc/apps/drs/__init__.py +0 -16
  45. esgvoc/apps/drs/constants.py +2 -0
  46. esgvoc/apps/drs/generator.py +429 -0
  47. esgvoc/apps/drs/report.py +492 -0
  48. esgvoc/apps/drs/validator.py +330 -0
  49. esgvoc/cli/drs.py +248 -0
  50. esgvoc/cli/get.py +26 -25
  51. esgvoc/cli/install.py +11 -8
  52. esgvoc/cli/main.py +4 -5
  53. esgvoc/cli/status.py +14 -2
  54. esgvoc/cli/valid.py +41 -45
  55. esgvoc/core/db/models/mixins.py +7 -0
  56. esgvoc/core/db/models/project.py +3 -8
  57. esgvoc/core/db/models/universe.py +3 -3
  58. esgvoc/core/db/project_ingestion.py +4 -1
  59. esgvoc/core/db/universe_ingestion.py +8 -7
  60. esgvoc/core/logging_handler.py +1 -1
  61. esgvoc/core/repo_fetcher.py +4 -3
  62. esgvoc/core/service/__init__.py +37 -5
  63. esgvoc/core/service/configuration/config_manager.py +188 -0
  64. esgvoc/core/service/configuration/setting.py +88 -0
  65. esgvoc/core/service/state.py +66 -42
  66. esgvoc-0.3.0.dist-info/METADATA +89 -0
  67. esgvoc-0.3.0.dist-info/RECORD +78 -0
  68. esgvoc-0.3.0.dist-info/licenses/LICENSE.txt +519 -0
  69. esgvoc/apps/drs/models.py +0 -43
  70. esgvoc/apps/drs/parser.py +0 -27
  71. esgvoc/cli/config.py +0 -79
  72. esgvoc/core/service/settings.py +0 -64
  73. esgvoc/core/service/settings.toml +0 -12
  74. esgvoc/core/service/settings_default.toml +0 -20
  75. esgvoc-0.1.2.dist-info/METADATA +0 -54
  76. esgvoc-0.1.2.dist-info/RECORD +0 -66
  77. {esgvoc-0.1.2.dist-info → esgvoc-0.3.0.dist-info}/WHEEL +0 -0
  78. {esgvoc-0.1.2.dist-info → esgvoc-0.3.0.dist-info}/entry_points.txt +0 -0
@@ -1,45 +1,8 @@
1
+ from esgvoc.api.data_descriptors.data_descriptor import PlainTermDataDescriptor
1
2
 
2
- from __future__ import annotations
3
- from pydantic.version import VERSION as PYDANTIC_VERSION
4
- if int(PYDANTIC_VERSION[0])>=2:
5
- from pydantic import (
6
- BaseModel,
7
- ConfigDict
8
- )
9
- else:
10
- from pydantic import (
11
- BaseModel
12
- )
13
3
 
14
- metamodel_version = "None"
15
- version = "None"
16
-
17
-
18
- class ConfiguredBaseModel(BaseModel):
19
- model_config = ConfigDict(
20
- validate_assignment = True,
21
- validate_default = True,
22
- extra = "allow",
23
- arbitrary_types_allowed = True,
24
- use_enum_values = True,
25
- strict = False,
26
- )
27
- pass
28
-
29
-
30
-
31
-
32
-
33
- class Frequency(ConfiguredBaseModel):
34
-
35
-
36
-
37
- id: str
38
- description :str
39
- long_name :str
40
- name : str
41
- unit : str
42
- type : str
43
- # Model rebuild
44
- # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
45
- Frequency.model_rebuild()
4
+ class Frequency(PlainTermDataDescriptor):
5
+ description: str
6
+ long_name: str
7
+ name: str
8
+ unit: str
@@ -1,46 +1,8 @@
1
+ from esgvoc.api.data_descriptors.data_descriptor import PlainTermDataDescriptor
1
2
 
2
3
 
3
- from __future__ import annotations
4
- from pydantic.version import VERSION as PYDANTIC_VERSION
5
- if int(PYDANTIC_VERSION[0])>=2:
6
- from pydantic import (
7
- BaseModel,
8
- ConfigDict
9
- )
10
- else:
11
- from pydantic import (
12
- BaseModel
13
- )
14
-
15
- metamodel_version = "None"
16
- version = "None"
17
-
18
-
19
- class ConfiguredBaseModel(BaseModel):
20
- model_config = ConfigDict(
21
- validate_assignment = True,
22
- validate_default = True,
23
- extra = "allow",
24
- arbitrary_types_allowed = True,
25
- use_enum_values = True,
26
- strict = False,
27
- )
28
- pass
29
-
30
-
31
-
32
-
33
-
34
- class GridLabel(ConfiguredBaseModel):
35
-
36
-
37
-
38
- id: str
39
- description :str
40
- short_name :str
41
- name : str
42
- region : str
43
- type : str
44
- # Model rebuild
45
- # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
46
- GridLabel.model_rebuild()
4
+ class GridLabel(PlainTermDataDescriptor):
5
+ description: str
6
+ short_name: str
7
+ name: str
8
+ region: str
@@ -0,0 +1,6 @@
1
+ from esgvoc.api.data_descriptors.data_descriptor import PlainTermDataDescriptor
2
+
3
+
4
+ class HorizontalLabel(PlainTermDataDescriptor):
5
+ description: str
6
+ label: str
@@ -1,46 +1,5 @@
1
+ from esgvoc.api.data_descriptors.data_descriptor import PatternTermDataDescriptor
1
2
 
2
3
 
3
-
4
-
5
-
6
- from __future__ import annotations
7
- from pydantic.version import VERSION as PYDANTIC_VERSION
8
- if int(PYDANTIC_VERSION[0])>=2:
9
- from pydantic import (
10
- BaseModel,
11
- ConfigDict
12
- )
13
- else:
14
- from pydantic import (
15
- BaseModel
16
- )
17
-
18
- metamodel_version = "None"
19
- version = "None"
20
-
21
-
22
- class ConfiguredBaseModel(BaseModel):
23
- model_config = ConfigDict(
24
- validate_assignment = True,
25
- validate_default = True,
26
- extra = "allow",
27
- arbitrary_types_allowed = True,
28
- use_enum_values = True,
29
- strict = False,
30
- )
31
- pass
32
-
33
-
34
-
35
-
36
-
37
- class InitialisationIndex(ConfiguredBaseModel):
38
-
39
-
40
-
41
- id: str
42
- type : str
43
- regex : str
44
- # Model rebuild
45
- # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
46
- InitialisationIndex.model_rebuild()
4
+ class InitialisationIndex(PatternTermDataDescriptor):
5
+ pass
@@ -1,58 +1,15 @@
1
+ from pydantic import Field
2
+ from esgvoc.api.data_descriptors.data_descriptor import PlainTermDataDescriptor
1
3
 
2
-
3
- from __future__ import annotations
4
- from typing import (
5
- List,
6
- Dict,
7
- Optional
8
- )
9
- from pydantic.version import VERSION as PYDANTIC_VERSION
10
- if int(PYDANTIC_VERSION[0])>=2:
11
- from pydantic import (
12
- BaseModel,
13
- ConfigDict,
14
- Field
15
- )
16
- else:
17
- from pydantic import (
18
- BaseModel,
19
- Field
20
- )
21
-
22
- metamodel_version = "None"
23
- version = "None"
24
-
25
-
26
- class ConfiguredBaseModel(BaseModel):
27
- model_config = ConfigDict(
28
- validate_assignment = True,
29
- validate_default = True,
30
- extra = "allow",
31
- arbitrary_types_allowed = True,
32
- use_enum_values = True,
33
- strict = False,
34
- )
35
- pass
36
-
37
-
38
- class Institution(ConfiguredBaseModel):
39
-
4
+ class Institution(PlainTermDataDescriptor):
40
5
  """
41
- an registered institution for WCRP modelisation MIP
6
+ An registered institution for WCRP modelisation MIP.
42
7
  """
43
-
44
-
45
- id: str
46
- acronyms: List[str] = Field(default_factory=list)
47
- aliases: Optional[List[str]] = Field(default_factory=list)
48
- established: Optional[int]
49
- type: Optional[str]
50
- labels: Optional[List[str]] = Field(default_factory=list)
51
- location: Optional[Dict] = Field(default_factory=dict)
8
+ acronyms: list[str] = Field(default_factory=list)
9
+ aliases: list[str] = Field(default_factory=list)
10
+ established: int|None
11
+ labels: list[str] = Field(default_factory=list)
12
+ location: dict = Field(default_factory=dict)
52
13
  name: str
53
- ror: Optional[str]
54
- url: Optional[List[str]] = Field(default_factory=list)
55
-
56
- # Model rebuild
57
- # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
58
- Institution.model_rebuild()
14
+ ror: str|None
15
+ url: list[str] = Field(default_factory=list)
@@ -1,47 +1,7 @@
1
+ from esgvoc.api.data_descriptors.data_descriptor import PlainTermDataDescriptor
1
2
 
2
3
 
3
- from __future__ import annotations
4
- from typing import (
5
- Optional
6
- )
7
- from pydantic.version import VERSION as PYDANTIC_VERSION
8
- if int(PYDANTIC_VERSION[0])>=2:
9
- from pydantic import (
10
- BaseModel,
11
- ConfigDict,
12
- Field
13
- )
14
- else:
15
- from pydantic import (
16
- BaseModel,
17
- Field
18
- )
19
-
20
- metamodel_version = "None"
21
- version = "None"
22
-
23
-
24
- class ConfiguredBaseModel(BaseModel):
25
- model_config = ConfigDict(
26
- validate_assignment = True,
27
- validate_default = True,
28
- extra = "allow",
29
- arbitrary_types_allowed = True,
30
- use_enum_values = True,
31
- strict = False,
32
- )
33
- pass
34
-
35
-
36
-
37
- class License(ConfiguredBaseModel):
38
-
39
- id: str
40
- validation_method: str = Field(default = "list")
4
+ class License(PlainTermDataDescriptor):
41
5
  kind: str
42
- license: Optional[str]
43
- url: Optional[str]
44
-
45
- # Model rebuild
46
- # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
47
- License.model_rebuild()
6
+ license: str|None
7
+ url: str|None
@@ -1,46 +1,8 @@
1
+ from esgvoc.api.data_descriptors.data_descriptor import PlainTermDataDescriptor
1
2
 
2
3
 
3
- from __future__ import annotations
4
- from pydantic.version import VERSION as PYDANTIC_VERSION
5
- if int(PYDANTIC_VERSION[0])>=2:
6
- from pydantic import (
7
- BaseModel,
8
- ConfigDict
9
- )
10
- else:
11
- from pydantic import (
12
- BaseModel
13
- )
14
-
15
- metamodel_version = "None"
16
- version = "None"
17
-
18
-
19
- class ConfiguredBaseModel(BaseModel):
20
- model_config = ConfigDict(
21
- validate_assignment = True,
22
- validate_default = True,
23
- extra = "allow",
24
- arbitrary_types_allowed = True,
25
- use_enum_values = True,
26
- strict = False,
27
- )
28
- pass
29
-
30
-
31
-
32
-
33
-
34
- class MipEra(ConfiguredBaseModel):
35
-
36
-
37
-
38
- id: str
39
- start : int
40
- end : int
41
- name : str
42
- type : str
43
- url : str
44
- # Model rebuild
45
- # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
46
- MipEra.model_rebuild()
4
+ class MipEra(PlainTermDataDescriptor):
5
+ start: int
6
+ end: int
7
+ name: str
8
+ url: str
@@ -1,47 +1,9 @@
1
+ from esgvoc.api.data_descriptors.data_descriptor import PlainTermDataDescriptor
1
2
 
2
3
 
3
-
4
- from __future__ import annotations
5
- from pydantic.version import VERSION as PYDANTIC_VERSION
6
- if int(PYDANTIC_VERSION[0])>=2:
7
- from pydantic import (
8
- BaseModel,
9
- ConfigDict
10
- )
11
- else:
12
- from pydantic import (
13
- BaseModel
14
- )
15
-
16
- metamodel_version = "None"
17
- version = "None"
18
-
19
-
20
- class ConfiguredBaseModel(BaseModel):
21
- model_config = ConfigDict(
22
- validate_assignment = True,
23
- validate_default = True,
24
- extra = "allow",
25
- arbitrary_types_allowed = True,
26
- use_enum_values = True,
27
- strict = False,
28
- )
29
- pass
30
-
31
-
32
-
33
-
34
-
35
- class ModelComponent(ConfiguredBaseModel):
36
-
37
-
38
-
39
- id: str
40
- description :str
41
- name : str
42
- type : str
43
- realm : dict
44
- nominal_resolution : dict
45
- # Model rebuild
46
- # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
47
- ModelComponent.model_rebuild()
4
+ class ModelComponent(PlainTermDataDescriptor):
5
+ description: str
6
+ name: str
7
+ realm: dict
8
+ nominal_resolution: dict
9
+ version: int
@@ -1,42 +1,5 @@
1
+ from esgvoc.api.data_descriptors.data_descriptor import PlainTermDataDescriptor
1
2
 
2
3
 
3
-
4
- from __future__ import annotations
5
- from pydantic.version import VERSION as PYDANTIC_VERSION
6
- if int(PYDANTIC_VERSION[0])>=2:
7
- from pydantic import (
8
- BaseModel,
9
- ConfigDict,
10
- Field
11
- )
12
- else:
13
- from pydantic import (
14
- BaseModel,
15
- Field
16
- )
17
-
18
- metamodel_version = "None"
19
- version = "None"
20
-
21
-
22
- class ConfiguredBaseModel(BaseModel):
23
- model_config = ConfigDict(
24
- validate_assignment = True,
25
- validate_default = True,
26
- extra = "allow",
27
- arbitrary_types_allowed = True,
28
- use_enum_values = True,
29
- strict = False,
30
- )
31
- pass
32
-
33
-
34
-
35
- class Organisation(ConfiguredBaseModel):
36
-
37
- id: str
38
- validation_method: str = Field(default = "list")
39
- type : str
40
- # Model rebuild
41
- # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
42
- Organisation.model_rebuild()
4
+ class Organisation(PlainTermDataDescriptor):
5
+ pass
@@ -1,47 +1,5 @@
1
+ from esgvoc.api.data_descriptors.data_descriptor import PatternTermDataDescriptor
1
2
 
2
3
 
3
-
4
-
5
-
6
-
7
- from __future__ import annotations
8
- from pydantic.version import VERSION as PYDANTIC_VERSION
9
- if int(PYDANTIC_VERSION[0])>=2:
10
- from pydantic import (
11
- BaseModel,
12
- ConfigDict
13
- )
14
- else:
15
- from pydantic import (
16
- BaseModel
17
- )
18
-
19
- metamodel_version = "None"
20
- version = "None"
21
-
22
-
23
- class ConfiguredBaseModel(BaseModel):
24
- model_config = ConfigDict(
25
- validate_assignment = True,
26
- validate_default = True,
27
- extra = "allow",
28
- arbitrary_types_allowed = True,
29
- use_enum_values = True,
30
- strict = False,
31
- )
32
- pass
33
-
34
-
35
-
36
-
37
-
38
- class PhysicIndex(ConfiguredBaseModel):
39
-
40
-
41
-
42
- id: str
43
- type : str
44
- regex : str
45
- # Model rebuild
46
- # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
47
- PhysicIndex.model_rebuild()
4
+ class PhysicIndex(PatternTermDataDescriptor):
5
+ pass
@@ -1,45 +1,6 @@
1
+ from esgvoc.api.data_descriptors.data_descriptor import PlainTermDataDescriptor
1
2
 
2
3
 
3
-
4
- from __future__ import annotations
5
- from pydantic.version import VERSION as PYDANTIC_VERSION
6
- if int(PYDANTIC_VERSION[0])>=2:
7
- from pydantic import (
8
- BaseModel,
9
- ConfigDict
10
- )
11
- else:
12
- from pydantic import (
13
- BaseModel
14
- )
15
-
16
- metamodel_version = "None"
17
- version = "None"
18
-
19
-
20
- class ConfiguredBaseModel(BaseModel):
21
- model_config = ConfigDict(
22
- validate_assignment = True,
23
- validate_default = True,
24
- extra = "allow",
25
- arbitrary_types_allowed = True,
26
- use_enum_values = True,
27
- strict = False,
28
- )
29
- pass
30
-
31
-
32
-
33
-
34
-
35
- class Product(ConfiguredBaseModel):
36
-
37
-
38
-
39
- id: str
40
- description : str
41
- type : str
42
- kind : str
43
- # Model rebuild
44
- # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
45
- Product.model_rebuild()
4
+ class Product(PlainTermDataDescriptor):
5
+ description: str
6
+ kind: str
@@ -1,46 +1,5 @@
1
+ from esgvoc.api.data_descriptors.data_descriptor import PatternTermDataDescriptor
1
2
 
2
3
 
3
-
4
-
5
- from __future__ import annotations
6
-
7
- from pydantic.version import VERSION as PYDANTIC_VERSION
8
- if int(PYDANTIC_VERSION[0])>=2:
9
- from pydantic import (
10
- BaseModel,
11
- ConfigDict,
12
- )
13
- else:
14
- from pydantic import (
15
- BaseModel,
16
- )
17
-
18
- metamodel_version = "None"
19
- version = "None"
20
-
21
-
22
- class ConfiguredBaseModel(BaseModel):
23
- model_config = ConfigDict(
24
- validate_assignment = True,
25
- validate_default = True,
26
- extra = "allow",
27
- arbitrary_types_allowed = True,
28
- use_enum_values = True,
29
- strict = False,
30
- )
31
- pass
32
-
33
-
34
-
35
-
36
-
37
- class RealisationIndex(ConfiguredBaseModel):
38
-
39
-
40
-
41
- id: str
42
- type : str
43
- regex : str
44
- # Model rebuild
45
- # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
46
- RealisationIndex.model_rebuild()
4
+ class RealisationIndex(PatternTermDataDescriptor):
5
+ pass
@@ -1,44 +1,6 @@
1
+ from esgvoc.api.data_descriptors.data_descriptor import PlainTermDataDescriptor
1
2
 
2
3
 
3
- from __future__ import annotations
4
- from pydantic.version import VERSION as PYDANTIC_VERSION
5
- if int(PYDANTIC_VERSION[0])>=2:
6
- from pydantic import (
7
- BaseModel,
8
- ConfigDict
9
- )
10
- else:
11
- from pydantic import (
12
- BaseModel
13
- )
14
-
15
- metamodel_version = "None"
16
- version = "None"
17
-
18
-
19
- class ConfiguredBaseModel(BaseModel):
20
- model_config = ConfigDict(
21
- validate_assignment = True,
22
- validate_default = True,
23
- extra = "allow",
24
- arbitrary_types_allowed = True,
25
- use_enum_values = True,
26
- strict = False,
27
- )
28
- pass
29
-
30
-
31
-
32
-
33
-
34
- class Realm(ConfiguredBaseModel):
35
-
36
-
37
-
38
- id: str
39
- description :str
40
- name : str
41
- type : str
42
- # Model rebuild
43
- # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
44
- Realm.model_rebuild()
4
+ class Realm(PlainTermDataDescriptor):
5
+ description: str
6
+ name: str
@@ -1,46 +1,8 @@
1
+ from esgvoc.api.data_descriptors.data_descriptor import PlainTermDataDescriptor
1
2
 
2
3
 
3
- from __future__ import annotations
4
- from pydantic.version import VERSION as PYDANTIC_VERSION
5
- if int(PYDANTIC_VERSION[0])>=2:
6
- from pydantic import (
7
- BaseModel,
8
- ConfigDict
9
- )
10
- else:
11
- from pydantic import (
12
- BaseModel
13
- )
14
-
15
- metamodel_version = "None"
16
- version = "None"
17
-
18
-
19
- class ConfiguredBaseModel(BaseModel):
20
- model_config = ConfigDict(
21
- validate_assignment = True,
22
- validate_default = True,
23
- extra = "allow",
24
- arbitrary_types_allowed = True,
25
- use_enum_values = True,
26
- strict = False,
27
- )
28
- pass
29
-
30
-
31
-
32
-
33
-
34
- class Resolution(ConfiguredBaseModel):
35
-
36
-
37
-
38
- id: str
39
- description :str
40
- value :str
41
- name : str
42
- unit : str
43
- type : str
44
- # Model rebuild
45
- # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
46
- Resolution.model_rebuild()
4
+ class Resolution(PlainTermDataDescriptor):
5
+ description: str
6
+ value: str
7
+ name: str
8
+ unit: str