Skip to content

Allow requesting codelists for an endpoint directly#231

Open
aboddie wants to merge 4 commits into
eblondel:masterfrom
aboddie:master
Open

Allow requesting codelists for an endpoint directly#231
aboddie wants to merge 4 commits into
eblondel:masterfrom
aboddie:master

Conversation

@aboddie

@aboddie aboddie commented Aug 1, 2025

Copy link
Copy Markdown
Contributor

The primary goal of this pull request is to allow requesting a codelist directly, as follows:

cl_responce <- readSDMX(providerId = 'IMF_DATA',
                        resource = 'codelist',
                        resourceId = 'CL_INDEX_TYPE',
                        agencyId = 'IMF',
                        version = '2.6.0')

cl_df <- as.data.frame(cl_responce)

to do this handlers and formatters were updated in R/SDMXREST21RequestBuilder-methods.R to allow for codelists and readSDMX was updated to use codelist handler and formatter.

In addition:

  • a codelist can now be converted to a dataframe, previously only selecting a codelist via the codelists object was allowed for conversion to a data frame.
response <- readSDMX(providerId = 'IMF_DATA',
                     resource = 'datastructure',
                     resourceId = 'DSD_QNEA')

CL_DIRECTLY_referenced <- as.data.frame(response@codelists@codelists[[4]])
  • a codelist can now be selected from a codelists object by codelistAgencyID and codelistVersion in addition to codelistId
CL_IMPROVED_SEARCH <- as.data.frame(response@codelists, 
                                    codelistId='CL_INDEX_TYPE', 
                                    codelistAgencyID='IMF',
                                    codelistVersion= '2.6.0')
  • Warnings around finding a codelist in the codelists object improved.
CL_IMPROVED_WARNINGS <- as.data.frame(response@codelists, 
                                    codelistId='CL_INDEX_TYPE')

@eblondel eblondel self-requested a review August 10, 2025 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant