dapla-toolbelt-metadata 0.1.1__py3-none-any.whl → 0.1.2__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 dapla-toolbelt-metadata might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dapla-toolbelt-metadata
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: Dapla Toolbelt Metadata
5
5
  Home-page: https://github.com/statisticsnorway/dapla-toolbelt-metadata
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
- dataset/__init__.py,sha256=aa6dF2ddfeljw1SElaVqAF6YewuZ0Fxk3q7iebtWR2E,378
1
+ dataset/__init__.py,sha256=TvzskpdFC6hGcC9_55URT5jr5wNAPzXuISd2UjJWM_8,280
2
2
  dataset/code_list.py,sha256=SqzassTXL-Gr4TqomXStJFiI5gSN0lXjbmZLDJadMrQ,9050
3
- dataset/config.py,sha256=EWTmrkLWYKSHVrzEWQO16_CaWrxiUllAnRJFbvEoono,4239
3
+ dataset/config.py,sha256=Yu6AyeJdXsPLJzoxyhsjfj3CUMM6eDb5bNYen3i-omg,2015
4
4
  dataset/core.py,sha256=E7OmFM1iTKlKuvQXuwhucO3z5pKg8fTkE2TmOYFi7_M,22654
5
5
  dataset/dapla_dataset_path_info.py,sha256=7wwVwykJUaRbqCZrAMsZsOd1p_xO8bHe5LhNOLE8j6k,21600
6
6
  dataset/dataset_parser.py,sha256=AvN4cKaDvP4VwplNR5uvXJdiZh4ippNcFTBll-HhH-4,7949
@@ -15,7 +15,7 @@ dataset/utility/__init__.py,sha256=pp6tUcgUbo8iq9OPtFKQrTbLuI3uY7NHptwWSTpasOU,3
15
15
  dataset/utility/constants.py,sha256=Wv1LIqq2P7ow6sToNdrTOAIMqvyPxNS2j6ArIB-GMds,2301
16
16
  dataset/utility/enums.py,sha256=C-qlB9ZI4Oy3q1ehbuF0GD7lqJJbuaspY_e8BDFu5DU,727
17
17
  dataset/utility/utils.py,sha256=j2A6DOgb4MmKaEGd5qW8DHxUsTZrZFLLAsvPW1BQIc0,14269
18
- dapla_toolbelt_metadata-0.1.1.dist-info/LICENSE,sha256=np3IfD5m0ZUofn_kVzDZqliozuiO6wrktw3LRPjyEiI,1073
19
- dapla_toolbelt_metadata-0.1.1.dist-info/METADATA,sha256=nmA0eQkasfLsUfoRtwKJBd9vD9m8mR9fC9z-AjZj-lM,5158
20
- dapla_toolbelt_metadata-0.1.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
21
- dapla_toolbelt_metadata-0.1.1.dist-info/RECORD,,
18
+ dapla_toolbelt_metadata-0.1.2.dist-info/LICENSE,sha256=np3IfD5m0ZUofn_kVzDZqliozuiO6wrktw3LRPjyEiI,1073
19
+ dapla_toolbelt_metadata-0.1.2.dist-info/METADATA,sha256=0L1tZ6_9p6ZMvFI-Zdc5fvClf_eRISrdWVrDzGXGemU,5158
20
+ dapla_toolbelt_metadata-0.1.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
21
+ dapla_toolbelt_metadata-0.1.2.dist-info/RECORD,,
dataset/__init__.py CHANGED
@@ -6,6 +6,4 @@ from .core import Datadoc
6
6
  from .dapla_dataset_path_info import DaplaDatasetPathInfo
7
7
  from .model_validation import ObligatoryDatasetWarning
8
8
  from .model_validation import ObligatoryVariableWarning
9
- from .utility.enums import DaplaRegion
10
- from .utility.enums import DaplaService
11
- from .utility.enums import SupportedLanguages
9
+ from .utility import enums
dataset/config.py CHANGED
@@ -6,7 +6,6 @@ import logging
6
6
  import os
7
7
  from pathlib import Path
8
8
  from pprint import pformat
9
- from typing import Literal
10
9
 
11
10
  from dotenv import dotenv_values
12
11
  from dotenv import load_dotenv
@@ -51,60 +50,6 @@ def get_jupyterhub_user() -> str | None:
51
50
  return _get_config_item(JUPYTERHUB_USER)
52
51
 
53
52
 
54
- def get_datadoc_dataset_path() -> str | None:
55
- """Get the path to the dataset."""
56
- return _get_config_item("DATADOC_DATASET_PATH")
57
-
58
-
59
- def get_log_level() -> int:
60
- """Get the log level."""
61
- # Magic numbers as defined in Python's stdlib logging
62
- log_levels: dict[str, int] = {
63
- "CRITICAL": 50,
64
- "ERROR": 40,
65
- "WARNING": 30,
66
- "INFO": 20,
67
- "DEBUG": 10,
68
- }
69
- if level_string := _get_config_item("DATADOC_LOG_LEVEL"):
70
- try:
71
- return log_levels[level_string.upper()]
72
- except KeyError:
73
- return log_levels["INFO"]
74
- else:
75
- return log_levels["INFO"]
76
-
77
-
78
- def get_log_formatter() -> Literal["simple", "json"]:
79
- """Get log formatter configuration."""
80
- if (
81
- _get_config_item("DATADOC_ENABLE_JSON_FORMATTING") == "True"
82
- or get_dapla_region() is not None
83
- ):
84
- return "json"
85
- return "simple"
86
-
87
-
88
- def get_jupyterhub_service_prefix() -> str | None:
89
- """Get the JupyterHub service prefix."""
90
- return _get_config_item("JUPYTERHUB_SERVICE_PREFIX")
91
-
92
-
93
- def get_app_name() -> str:
94
- """Get the name of the app. Defaults to 'Datadoc'."""
95
- return _get_config_item("DATADOC_APP_NAME") or "Datadoc"
96
-
97
-
98
- def get_jupyterhub_http_referrer() -> str | None:
99
- """Get the JupyterHub http referrer."""
100
- return _get_config_item("JUPYTERHUB_HTTP_REFERER")
101
-
102
-
103
- def get_port() -> int:
104
- """Get the port to run the app on."""
105
- return int(_get_config_item("DATADOC_PORT") or 7002)
106
-
107
-
108
53
  def get_statistical_subject_source_url() -> str | None:
109
54
  """Get the URL to the statistical subject source."""
110
55
  return _get_config_item("DATADOC_STATISTICAL_SUBJECT_SOURCE_URL")
@@ -129,23 +74,3 @@ def get_dapla_service() -> DaplaService | None:
129
74
  def get_oidc_token() -> str | None:
130
75
  """Get the JWT token from the environment."""
131
76
  return _get_config_item("OIDC_TOKEN")
132
-
133
-
134
- def get_unit_code() -> int | None:
135
- """The code for the Unit Type code list in Klass."""
136
- return int(_get_config_item("DATADOC_UNIT_CODE") or 702)
137
-
138
-
139
- def get_measurement_unit_code() -> int | None:
140
- """The code for the Measurement Unit code list in Klass."""
141
- return int(_get_config_item("DATADOC_MEASUREMENT_UNIT") or 303)
142
-
143
-
144
- def get_organisational_unit_code() -> int | None:
145
- """The code for the organisational units code list in Klass."""
146
- return int(_get_config_item("DATADOC_ORGANISATIONAL_UNIT_CODE") or 83)
147
-
148
-
149
- def get_data_source_code() -> int | None:
150
- """The code for the organisational units code list in Klass."""
151
- return int(_get_config_item("DATADOC_DATA_SOURCE_CODE") or 712)