opensdmx 0.26.0__tar.gz → 0.26.2__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.
- {opensdmx-0.26.0 → opensdmx-0.26.2}/PKG-INFO +1 -1
- {opensdmx-0.26.0 → opensdmx-0.26.2}/pyproject.toml +1 -1
- {opensdmx-0.26.0 → opensdmx-0.26.2}/src/opensdmx/cli.py +12 -0
- {opensdmx-0.26.0 → opensdmx-0.26.2}/src/opensdmx/discovery.py +14 -4
- {opensdmx-0.26.0 → opensdmx-0.26.2}/src/opensdmx/portals.json +1 -0
- {opensdmx-0.26.0 → opensdmx-0.26.2}/README.md +0 -0
- {opensdmx-0.26.0 → opensdmx-0.26.2}/src/opensdmx/__init__.py +0 -0
- {opensdmx-0.26.0 → opensdmx-0.26.2}/src/opensdmx/ai.py +0 -0
- {opensdmx-0.26.0 → opensdmx-0.26.2}/src/opensdmx/base.py +0 -0
- {opensdmx-0.26.0 → opensdmx-0.26.2}/src/opensdmx/cache_config.py +0 -0
- {opensdmx-0.26.0 → opensdmx-0.26.2}/src/opensdmx/categories.py +0 -0
- {opensdmx-0.26.0 → opensdmx-0.26.2}/src/opensdmx/data/descriptions/README.md +0 -0
- {opensdmx-0.26.0 → opensdmx-0.26.2}/src/opensdmx/data/descriptions/istat.parquet +0 -0
- {opensdmx-0.26.0 → opensdmx-0.26.2}/src/opensdmx/db_cache.py +0 -0
- {opensdmx-0.26.0 → opensdmx-0.26.2}/src/opensdmx/embed.py +0 -0
- {opensdmx-0.26.0 → opensdmx-0.26.2}/src/opensdmx/guide.py +0 -0
- {opensdmx-0.26.0 → opensdmx-0.26.2}/src/opensdmx/hub.py +0 -0
- {opensdmx-0.26.0 → opensdmx-0.26.2}/src/opensdmx/inps.py +0 -0
- {opensdmx-0.26.0 → opensdmx-0.26.2}/src/opensdmx/py.typed +0 -0
- {opensdmx-0.26.0 → opensdmx-0.26.2}/src/opensdmx/ranking.py +0 -0
- {opensdmx-0.26.0 → opensdmx-0.26.2}/src/opensdmx/retrieval.py +0 -0
- {opensdmx-0.26.0 → opensdmx-0.26.2}/src/opensdmx/utils.py +0 -0
- {opensdmx-0.26.0 → opensdmx-0.26.2}/src/opensdmx/which.py +0 -0
|
@@ -937,6 +937,18 @@ def constraints(
|
|
|
937
937
|
raise typer.Exit(1)
|
|
938
938
|
|
|
939
939
|
if actual_dim not in avail:
|
|
940
|
+
if _output_mode != "table":
|
|
941
|
+
# Same shape as a missing dim in summary mode, so stdout stays
|
|
942
|
+
# parseable instead of being empty on exit 0.
|
|
943
|
+
missing = {
|
|
944
|
+
"dimension_id": actual_dim,
|
|
945
|
+
"n_values": None,
|
|
946
|
+
"codes": [],
|
|
947
|
+
"source": "missing",
|
|
948
|
+
"hint": f"opensdmx values {dataset_id} {actual_dim}",
|
|
949
|
+
}
|
|
950
|
+
_emit(missing, pl.DataFrame([missing]).drop("codes"))
|
|
951
|
+
return
|
|
940
952
|
err_console.print(
|
|
941
953
|
f"[yellow]Dimension {actual_dim} is not exposed by {constraint_endpoint}.[/yellow]\n"
|
|
942
954
|
f"Fetch the full codelist instead: "
|
|
@@ -57,6 +57,16 @@ def _struct_path(endpoint: str) -> str:
|
|
|
57
57
|
return f"{prefix}/{endpoint}" if prefix else endpoint
|
|
58
58
|
|
|
59
59
|
|
|
60
|
+
def _codelist_path(codelist_id: str) -> str:
|
|
61
|
+
"""Build the SDMX-REST path for a codelist.
|
|
62
|
+
|
|
63
|
+
Most providers answer codelists from the catch-all agency `ALL`; a provider
|
|
64
|
+
whose server only answers for its own agency declares `codelist_agency`.
|
|
65
|
+
"""
|
|
66
|
+
agency = get_provider().get("codelist_agency", "ALL")
|
|
67
|
+
return _struct_path(f"codelist/{agency}/{codelist_id}")
|
|
68
|
+
|
|
69
|
+
|
|
60
70
|
def _dataflow_cache_path() -> Path:
|
|
61
71
|
path: Path = get_cache_dir() / "dataflows.parquet"
|
|
62
72
|
return path
|
|
@@ -584,10 +594,10 @@ def _get_dimension_description(codelist_id: str | None) -> str | None:
|
|
|
584
594
|
return None
|
|
585
595
|
from .db_cache import get_cached_codelist_info, is_codelist_info_cached, save_codelist_info
|
|
586
596
|
if is_codelist_info_cached(codelist_id):
|
|
587
|
-
explain_cached("GET",
|
|
597
|
+
explain_cached("GET", _codelist_path(codelist_id))
|
|
588
598
|
return get_cached_codelist_info(codelist_id)
|
|
589
599
|
try:
|
|
590
|
-
path =
|
|
600
|
+
path = _codelist_path(codelist_id)
|
|
591
601
|
content = sdmx_request_xml(path)
|
|
592
602
|
root, ns = xml_parse(content)
|
|
593
603
|
struct_ns = ns.get("structure", "")
|
|
@@ -915,10 +925,10 @@ def _load_codelist_records(dataset: dict[str, Any], dimension_id: str) -> list[d
|
|
|
915
925
|
from .db_cache import get_cached_codelist_values, save_codelist_values
|
|
916
926
|
cached = get_cached_codelist_values(cache_key)
|
|
917
927
|
if cached is not None:
|
|
918
|
-
explain_cached("GET",
|
|
928
|
+
explain_cached("GET", _codelist_path(codelist_id))
|
|
919
929
|
return cached
|
|
920
930
|
|
|
921
|
-
path =
|
|
931
|
+
path = _codelist_path(codelist_id)
|
|
922
932
|
content = sdmx_request_xml(path)
|
|
923
933
|
root, ns = xml_parse(content)
|
|
924
934
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|