Problem
set_provider() currently accepts a custom base URL for non-preset providers, but only allows four fields: base_url, agency_id, rate_limit, language.
All the richer feature flags defined in portals.json — constraints_supported, data_format_param, user_agent, data_key_format, unsupported_params, etc. — are silently ignored for custom URLs. This makes it impossible to configure a private or enterprise SDMX endpoint correctly without modifying the package source.
Use cases
- Internal statistical offices running a private SDMX server (e.g. .Stat Suite, SDMX-RI)
- Enterprise data platforms with SDMX APIs that have non-standard behaviour (no constraints, custom auth headers, specific data format)
- Organizations that want to point opensdmx at a staging or test endpoint without forking the package
Proposed solution
Two complementary changes:
1. Extend set_provider() to accept arbitrary keyword arguments
Allow passing any flag supported by portals.json:
opensdmx.set_provider(
"https://my-internal-sdmx.example.com/rest",
agency_id="MYORG",
constraints_supported=False,
data_format_param="SDMX-CSV",
user_agent="MyApp/1.0",
)
2. Support a user-level portals.json override file
Load additional (or overriding) provider definitions from a user config file, e.g.:
~/.config/opensdmx/portals.json
- Path set via
OPENSDMX_PORTALS environment variable
Entries in the user file would be merged with the bundled ones, allowing both adding new providers and overriding defaults of existing ones — without touching the package source.
Notes
- sdmx1 (
khaeru/sdmx) has a similar mechanism via add_source() and a source registry pattern.
- The bundled
portals.json already defines the full schema — the gap is only in the runtime API and the user-level loading path.
Problem
set_provider()currently accepts a custom base URL for non-preset providers, but only allows four fields:base_url,agency_id,rate_limit,language.All the richer feature flags defined in
portals.json—constraints_supported,data_format_param,user_agent,data_key_format,unsupported_params, etc. — are silently ignored for custom URLs. This makes it impossible to configure a private or enterprise SDMX endpoint correctly without modifying the package source.Use cases
Proposed solution
Two complementary changes:
1. Extend
set_provider()to accept arbitrary keyword argumentsAllow passing any flag supported by
portals.json:2. Support a user-level
portals.jsonoverride fileLoad additional (or overriding) provider definitions from a user config file, e.g.:
~/.config/opensdmx/portals.jsonOPENSDMX_PORTALSenvironment variableEntries in the user file would be merged with the bundled ones, allowing both adding new providers and overriding defaults of existing ones — without touching the package source.
Notes
khaeru/sdmx) has a similar mechanism viaadd_source()and a source registry pattern.portals.jsonalready defines the full schema — the gap is only in the runtime API and the user-level loading path.