dapla-toolbelt-metadata 0.2.0__tar.gz → 0.2.1__tar.gz

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.

Files changed (22) hide show
  1. {dapla_toolbelt_metadata-0.2.0 → dapla_toolbelt_metadata-0.2.1}/PKG-INFO +2 -2
  2. {dapla_toolbelt_metadata-0.2.0 → dapla_toolbelt_metadata-0.2.1}/pyproject.toml +34 -33
  3. {dapla_toolbelt_metadata-0.2.0 → dapla_toolbelt_metadata-0.2.1}/src/dapla_metadata/__init__.py +2 -0
  4. {dapla_toolbelt_metadata-0.2.0 → dapla_toolbelt_metadata-0.2.1}/src/dapla_metadata/datasets/config.py +0 -2
  5. {dapla_toolbelt_metadata-0.2.0 → dapla_toolbelt_metadata-0.2.1}/src/dapla_metadata/datasets/core.py +7 -4
  6. {dapla_toolbelt_metadata-0.2.0 → dapla_toolbelt_metadata-0.2.1}/LICENSE +0 -0
  7. {dapla_toolbelt_metadata-0.2.0 → dapla_toolbelt_metadata-0.2.1}/README.md +0 -0
  8. {dapla_toolbelt_metadata-0.2.0 → dapla_toolbelt_metadata-0.2.1}/src/dapla_metadata/datasets/__init__.py +0 -0
  9. {dapla_toolbelt_metadata-0.2.0 → dapla_toolbelt_metadata-0.2.1}/src/dapla_metadata/datasets/code_list.py +0 -0
  10. {dapla_toolbelt_metadata-0.2.0 → dapla_toolbelt_metadata-0.2.1}/src/dapla_metadata/datasets/dapla_dataset_path_info.py +0 -0
  11. {dapla_toolbelt_metadata-0.2.0 → dapla_toolbelt_metadata-0.2.1}/src/dapla_metadata/datasets/dataset_parser.py +0 -0
  12. {dapla_toolbelt_metadata-0.2.0 → dapla_toolbelt_metadata-0.2.1}/src/dapla_metadata/datasets/external_sources/__init__.py +0 -0
  13. {dapla_toolbelt_metadata-0.2.0 → dapla_toolbelt_metadata-0.2.1}/src/dapla_metadata/datasets/external_sources/external_sources.py +0 -0
  14. {dapla_toolbelt_metadata-0.2.0 → dapla_toolbelt_metadata-0.2.1}/src/dapla_metadata/datasets/model_backwards_compatibility.py +0 -0
  15. {dapla_toolbelt_metadata-0.2.0 → dapla_toolbelt_metadata-0.2.1}/src/dapla_metadata/datasets/model_validation.py +0 -0
  16. {dapla_toolbelt_metadata-0.2.0 → dapla_toolbelt_metadata-0.2.1}/src/dapla_metadata/datasets/py.typed +0 -0
  17. {dapla_toolbelt_metadata-0.2.0 → dapla_toolbelt_metadata-0.2.1}/src/dapla_metadata/datasets/statistic_subject_mapping.py +0 -0
  18. {dapla_toolbelt_metadata-0.2.0 → dapla_toolbelt_metadata-0.2.1}/src/dapla_metadata/datasets/user_info.py +0 -0
  19. {dapla_toolbelt_metadata-0.2.0 → dapla_toolbelt_metadata-0.2.1}/src/dapla_metadata/datasets/utility/__init__.py +0 -0
  20. {dapla_toolbelt_metadata-0.2.0 → dapla_toolbelt_metadata-0.2.1}/src/dapla_metadata/datasets/utility/constants.py +0 -0
  21. {dapla_toolbelt_metadata-0.2.0 → dapla_toolbelt_metadata-0.2.1}/src/dapla_metadata/datasets/utility/enums.py +0 -0
  22. {dapla_toolbelt_metadata-0.2.0 → dapla_toolbelt_metadata-0.2.1}/src/dapla_metadata/datasets/utility/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dapla-toolbelt-metadata
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: Dapla Toolbelt Metadata
5
5
  Home-page: https://github.com/statisticsnorway/dapla-toolbelt-metadata
6
6
  License: MIT
@@ -15,7 +15,6 @@ Classifier: Programming Language :: Python :: 3.11
15
15
  Classifier: Programming Language :: Python :: 3.12
16
16
  Requires-Dist: arrow (>=1.3.0)
17
17
  Requires-Dist: beautifulsoup4 (>=4.12.3)
18
- Requires-Dist: bs4 (>=0.0.2,<0.0.3)
19
18
  Requires-Dist: cloudpathlib[gs] (>=0.17.0)
20
19
  Requires-Dist: dapla-toolbelt (>=1.3.3)
21
20
  Requires-Dist: pandas (>=1.4.2)
@@ -26,6 +25,7 @@ Requires-Dist: python-dotenv (>=1.0.1)
26
25
  Requires-Dist: requests (>=2.31.0)
27
26
  Requires-Dist: ssb-datadoc-model (>=6.0.0,<7.0.0)
28
27
  Requires-Dist: ssb-klass-python (>=0.0.9)
28
+ Requires-Dist: typing-extensions (>=4.12.2)
29
29
  Project-URL: Changelog, https://github.com/statisticsnorway/dapla-toolbelt-metadata/releases
30
30
  Project-URL: Documentation, https://statisticsnorway.github.io/dapla-toolbelt-metadata
31
31
  Project-URL: Repository, https://github.com/statisticsnorway/dapla-toolbelt-metadata
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "dapla-toolbelt-metadata"
3
- version = "0.2.0"
3
+ version = "0.2.1"
4
4
  description = "Dapla Toolbelt Metadata"
5
5
  authors = ["Team Metadata <metadata@ssb.no>"]
6
6
  license = "MIT"
@@ -10,7 +10,7 @@ repository = "https://github.com/statisticsnorway/dapla-toolbelt-metadata"
10
10
  documentation = "https://statisticsnorway.github.io/dapla-toolbelt-metadata"
11
11
  classifiers = ["Development Status :: 4 - Beta"]
12
12
 
13
- packages = [{ include = "dapla_metadata", from = "src"}]
13
+ packages = [{ include = "dapla_metadata", from = "src" }]
14
14
 
15
15
  [tool.poetry.urls]
16
16
  Changelog = "https://github.com/statisticsnorway/dapla-toolbelt-metadata/releases"
@@ -29,17 +29,17 @@ cloudpathlib = { extras = ["gs"], version = ">=0.17.0" }
29
29
  pyjwt = ">=2.8.0"
30
30
  ssb-klass-python = ">=0.0.9"
31
31
  ssb-datadoc-model = "^6.0.0"
32
- bs4 = "^0.0.2"
32
+ typing-extensions = ">=4.12.2"
33
33
 
34
34
  [tool.poetry.group.dev.dependencies]
35
- black = "^24.8.0"
36
- pygments = "^2.18.0"
35
+ black = ">=24.8.0"
36
+ pygments = ">=2.18.0"
37
37
  coverage = { extras = ["toml"], version = ">=6.2" }
38
- faker = "^26.1.0"
39
- furo = "^2024.7.18"
40
- pre-commit = "^3.8.0"
41
- ruff = "^0.5.6"
42
- pytest = "^8.3.2"
38
+ faker = ">=26.1.0"
39
+ furo = ">=2024.7.18"
40
+ pre-commit = ">=3.8.0"
41
+ ruff = ">=0.5.6"
42
+ pytest = ">=8.3.2"
43
43
  sphinx = ">=6.2.1"
44
44
  sphinx-autobuild = ">=2021.3.14"
45
45
  sphinx-autodoc-typehints = ">=1.24.0"
@@ -51,15 +51,16 @@ mypy = ">=0.950"
51
51
  pytest-cov = ">=3.0.0"
52
52
  nbstripout = ">=0.5.0"
53
53
  python-kacl = "*"
54
- pytest-mock = "^3.14.0"
54
+ pytest-mock = ">=3.14.0"
55
55
  deptry = ">=0.12.0"
56
56
  pandas-stubs = "*"
57
57
  pyarrow-stubs = ">=10.0.1.9"
58
- requests-mock = "^1.12.1"
58
+ requests-mock = ">=1.12.1"
59
59
  types-Pygments = "*"
60
60
  types-colorama = "*"
61
61
  types-setuptools = "*"
62
- types-beautifulsoup4 = "^4.12.0.20240511"
62
+ types-beautifulsoup4 = ">=4.12.0.20240511"
63
+ ipykernel = "^6.29.5"
63
64
 
64
65
  [tool.pytest.ini_options]
65
66
  pythonpath = ["src"]
@@ -72,10 +73,7 @@ tests = ["tests", "*/tests"]
72
73
  [tool.coverage.run]
73
74
  branch = true
74
75
  source = ["dapla_metadata"]
75
- omit = [
76
- "tests/*",
77
- "__init__.py",
78
- ]
76
+ omit = ["tests/*", "__init__.py"]
79
77
  relative_files = true
80
78
 
81
79
  [tool.coverage.report]
@@ -83,9 +81,7 @@ show_missing = true
83
81
  fail_under = 80
84
82
 
85
83
  [tool.mypy]
86
- plugins = [
87
- "pydantic.mypy"
88
- ]
84
+ plugins = ["pydantic.mypy"]
89
85
  strict = false
90
86
  warn_unreachable = true
91
87
  pretty = true
@@ -117,10 +113,10 @@ disable_error_code = [
117
113
  ]
118
114
 
119
115
  [tool.ruff]
120
- force-exclude = true # Apply excludes to pre-commit
116
+ force-exclude = true # Apply excludes to pre-commit
121
117
  show-fixes = true
122
118
  src = ["src", "tests"]
123
- target-version = "py310" # Minimum Python version supported
119
+ target-version = "py310" # Minimum Python version supported
124
120
  include = ["*.py", "*.pyi", "**/pyproject.toml", "*.ipynb"]
125
121
  extend-exclude = [
126
122
  "__pycache__",
@@ -150,26 +146,31 @@ force-single-line = true
150
146
  max-complexity = 15
151
147
 
152
148
  [tool.ruff.lint.pydocstyle]
153
- convention = "google" # You can also use "numpy".
149
+ convention = "google" # You can also use "numpy".
154
150
 
155
151
  [tool.ruff.lint.pep8-naming]
156
- classmethod-decorators = ["classmethod", "validator", "root_validator", "pydantic.validator"]
152
+ classmethod-decorators = [
153
+ "classmethod",
154
+ "validator",
155
+ "root_validator",
156
+ "pydantic.validator",
157
+ ]
157
158
 
158
159
  [tool.ruff.lint.per-file-ignores]
159
160
  "*/__init__.py" = ["F401"]
160
161
  "**/tests/*" = [
161
- "ANN001", # type annotations don't add value for test functions
162
- "ANN002", # type annotations don't add value for test functions
163
- "ANN003", # type annotations don't add value for test functions
164
- "ANN201", # type annotations don't add value for test functions
165
- "ANN204", # type annotations don't add value for test functions
166
- "ANN205", # type annotations don't add value for test functions
167
- "ANN206", # type annotations don't add value for test functions
168
- "D100", # docstrings are overkill for test functions
162
+ "ANN001", # type annotations don't add value for test functions
163
+ "ANN002", # type annotations don't add value for test functions
164
+ "ANN003", # type annotations don't add value for test functions
165
+ "ANN201", # type annotations don't add value for test functions
166
+ "ANN204", # type annotations don't add value for test functions
167
+ "ANN205", # type annotations don't add value for test functions
168
+ "ANN206", # type annotations don't add value for test functions
169
+ "D100", # docstrings are overkill for test functions
169
170
  "D101",
170
171
  "D102",
171
172
  "D103",
172
- "S101", # asserts are encouraged in pytest
173
+ "S101", # asserts are encouraged in pytest
173
174
  ]
174
175
 
175
176
  [build-system]
@@ -1,3 +1,5 @@
1
1
  """Tools and clients for working with the Dapla Metadata system."""
2
2
 
3
+ import datadoc_model.model as datadoc_model
4
+
3
5
  from . import datasets
@@ -16,8 +16,6 @@ from dapla_metadata.datasets.utility.constants import (
16
16
  from dapla_metadata.datasets.utility.enums import DaplaRegion
17
17
  from dapla_metadata.datasets.utility.enums import DaplaService
18
18
 
19
- logging.basicConfig(level=logging.DEBUG, force=True)
20
-
21
19
  logger = logging.getLogger(__name__)
22
20
 
23
21
  DOT_ENV_FILE_PATH = Path(__file__).parent.joinpath(".env")
@@ -321,14 +321,17 @@ class Datadoc:
321
321
  variables=[],
322
322
  )
323
323
 
324
- override_dataset_fields(merged_metadata, extracted_metadata)
324
+ override_dataset_fields(
325
+ merged_metadata=merged_metadata,
326
+ existing_metadata=existing_metadata,
327
+ )
325
328
 
326
329
  # Merge variables.
327
330
  # For each extracted variable, copy existing metadata into the merged metadata
328
331
  return merge_variables(
329
- existing_metadata,
330
- extracted_metadata,
331
- merged_metadata,
332
+ existing_metadata=existing_metadata,
333
+ extracted_metadata=extracted_metadata,
334
+ merged_metadata=merged_metadata,
332
335
  )
333
336
 
334
337
  def _extract_metadata_from_existing_document(