sdmxlib 0.41.1__tar.gz → 0.41.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.
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/PKG-INFO +1 -1
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/pyproject.toml +1 -1
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/formats/sdmx_json/_data_common.py +21 -13
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/README.md +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/__init__.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/_duckdb.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/api/__init__.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/api/client.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/api/federated.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/api/filters.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/api/policy.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/api/providers.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/api/query.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/api/registry.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/api/session.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/builders/__init__.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/builders/contentconstraint.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/catalog.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/data_store.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/formats/__init__.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/formats/sdmx_csv/__init__.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/formats/sdmx_csv/reader.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/formats/sdmx_csv/writer.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/formats/sdmx_json/__init__.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/formats/sdmx_json/data_v1.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/formats/sdmx_json/data_v2.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/formats/sdmx_json/metadata.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/formats/sdmx_json/reader.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/formats/sdmx_json/structure_values.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/formats/sdmx_json/writer.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/formats/sdmx_json_1_0/__init__.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/formats/sdmx_json_1_0/writer.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/formats/sdmx_ml/__init__.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/formats/sdmx_ml/_common.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/formats/sdmx_ml21/__init__.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/formats/sdmx_ml21/namespaces.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/formats/sdmx_ml21/reader.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/formats/sdmx_ml21/writer.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/formats/sdmx_ml30/__init__.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/formats/sdmx_ml30/metadata.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/formats/sdmx_ml30/namespaces.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/formats/sdmx_ml30/reader.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/formats/sdmx_ml30/writer.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/formats/sdmx_ml31/__init__.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/formats/sdmx_ml31/namespaces.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/formats/sdmx_ml31/reader.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/formats/sdmx_ml31/writer.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/local/__init__.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/local/data_store.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/local/registry.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/model/__init__.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/model/annotations.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/model/base.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/model/binding.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/model/category.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/model/code_query.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/model/codelist.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/model/collections.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/model/concept.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/model/constraint.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/model/convert.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/model/dataflow.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/model/dataset.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/model/datastructure.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/model/expr.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/model/hierarchy.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/model/hierarchy_query.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/model/in_memory_registry.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/model/istring.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/model/mapping.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/model/message.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/model/metadataflow.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/model/metadataset.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/model/metadatastructure.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/model/organisation.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/model/provision.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/model/ref.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/model/registry.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/model/representation.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/model/urn.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/model/validation.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/polars.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/py.typed +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/rest.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/sql.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/storage/__init__.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/storage/_kinds.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/storage/lazy.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/storage/readers.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/storage/schema.py +0 -0
- {sdmxlib-0.41.1 → sdmxlib-0.41.2}/src/sdmxlib/storage/writers.py +0 -0
|
@@ -294,11 +294,14 @@ class ComponentTable:
|
|
|
294
294
|
# so position N maps to the Nth-inserted entry. ``to_json``
|
|
295
295
|
# walks this directly.
|
|
296
296
|
self._codes: dict[str, dict[str, dict[str, object]]] = {cid: {} for cid in component_ids}
|
|
297
|
-
#
|
|
298
|
-
#
|
|
299
|
-
#
|
|
300
|
-
#
|
|
301
|
-
|
|
297
|
+
# Per-component resolved codelists, stored by reference. Labels are
|
|
298
|
+
# resolved on-demand in ``position()`` via ``ItemList.get`` (O(1));
|
|
299
|
+
# we deliberately do NOT walk the full codelist here. For census-scale
|
|
300
|
+
# codelists (CL_GEOGRAPHY: 579k codes) the eager walk dominated wall
|
|
301
|
+
# time on small data responses — a single-row /data query spent
|
|
302
|
+
# multiple seconds populating a label cache it would never read more
|
|
303
|
+
# than once from.
|
|
304
|
+
self._codelists: dict[str, Any] = {}
|
|
302
305
|
|
|
303
306
|
for cid in component_ids:
|
|
304
307
|
comp = components.get(cid)
|
|
@@ -312,12 +315,10 @@ class ComponentTable:
|
|
|
312
315
|
self._names[cid] = name
|
|
313
316
|
# TimeDimension carries a Facet representation, not a codelist
|
|
314
317
|
# ref, so it has no ``resolved_codelist`` property — skip the
|
|
315
|
-
#
|
|
318
|
+
# codelist registration for components without one.
|
|
316
319
|
cl = getattr(comp, "resolved_codelist", None)
|
|
317
|
-
if cl is None:
|
|
318
|
-
|
|
319
|
-
for code in cl.codes:
|
|
320
|
-
self._code_labels[cid][code.id] = code.name.get(lang) or code.id
|
|
320
|
+
if cl is not None:
|
|
321
|
+
self._codelists[cid] = cl
|
|
321
322
|
|
|
322
323
|
def position(self, component_id: str, code_id: str) -> int:
|
|
323
324
|
"""Look up ``code_id`` under ``component_id``, assigning on first sight."""
|
|
@@ -329,9 +330,16 @@ class ComponentTable:
|
|
|
329
330
|
table[code_id] = pos
|
|
330
331
|
self._position_str[component_id][code_id] = str(pos)
|
|
331
332
|
# Both SDMX-JSON 1.0 and 2.0 schemas require every value entry
|
|
332
|
-
# to carry id + name.
|
|
333
|
-
#
|
|
334
|
-
|
|
333
|
+
# to carry id + name. Look the localized name up on-demand from
|
|
334
|
+
# the resolved codelist's id-indexed ItemList (O(1)); fall back
|
|
335
|
+
# to the id when no codelist is registered or the code is
|
|
336
|
+
# unknown to it (e.g. observed values outside the enumerated set).
|
|
337
|
+
label = code_id
|
|
338
|
+
cl = self._codelists.get(component_id)
|
|
339
|
+
if cl is not None:
|
|
340
|
+
code = cl.codes.get(code_id)
|
|
341
|
+
if code is not None:
|
|
342
|
+
label = code.name.get(self._lang) or code_id
|
|
335
343
|
entry: dict[str, object] = {"id": code_id, "name": label}
|
|
336
344
|
# TIME_PERIOD start/end is resolved in to_json() once the full set of
|
|
337
345
|
# co-occurring FREQ values is known (see _resolve_time_bounds).
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|