Commit 8402a248 authored by Pauline Maury Laribière's avatar Pauline Maury Laribière
Browse files

experimenting post-processing

parent 535a8795
Pipeline #269609 passed with stage
in 16 seconds
identifier <- 'HCL_CH_ISCO_19_PROF'
language <- 'fr'
level_from <- 1
level_to <- 4
annotations <- FALSE
my_filters <- hash::hash(
'prop1'= list("string"),
'prop2' = list("string", "string2")
)
parameters <- glue::glue("language={language}&levelFrom={level_from}&levelTo={level_to}&annotations={tolower(annotations)}&{stringify(my_filters)}")
print(parameters)
api <- api_class(
api_type = "nomenclature_multiple_levels",
id = identifier,
parameters = parameters,
export_format = "CSV"
)
res <- api$get_response()
names(res)
nb_col <- level_to - level_from + 1
group_columns <- names(res)[1:nb_col]
group_columns
group_columns[[1]]
res[[group_columns[[1]]]] = data.table::nafill(res[[group_columns[[1]]]], type="locf")
res[[group_columns[[1]]]]
# df[group_columns[1:]] = (
# df.groupby([group_columns[0]])[group_columns[1:]]
# ).apply(lambda x: x.ffill())
group_columns[[1]] # group_columns[0]
group_columns[2:4] # df[group_columns[1:]]
res
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/api_call.R
\name{dcat_get_agent_from_id}
\alias{dcat_get_agent_from_id}
\title{Get the agent with the corresponding agent id}
\usage{
dcat_get_agent_from_id(agent_id)
}
\arguments{
\item{agent_id}{agent's id}
}
\value{
agent with this id
}
\description{
Get the agent with the corresponding agent id
}
\examples{
dcat_get_agent_from_id(agent_id='xx')
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/api_call.R
\name{dcat_get_dataset_from_id}
\alias{dcat_get_dataset_from_id}
\title{Get the dataset with the corresponding id}
\usage{
dcat_get_dataset_from_id(dataset_id)
}
\arguments{
\item{dataset_id}{dataset's id}
}
\value{
the dataset
}
\description{
Get the dataset with the corresponding id
}
\examples{
dcat_get_dataset_from_id(dataset_id='xx')
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/api_call.R
\name{dcat_get_dataset_from_identifier}
\alias{dcat_get_dataset_from_identifier}
\title{Get the dataset with the corresponding identifier}
\usage{
dcat_get_dataset_from_identifier(identifier)
}
\arguments{
\item{identifier}{dataset's identifier}
}
\value{
the dataset
}
\description{
Get the dataset with the corresponding identifier
}
\examples{
dcat_get_dataset_from_identifier(identifier='xx')
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/api_call.R
\name{dcat_get_distribution_from_id}
\alias{dcat_get_distribution_from_id}
\title{Get the distribution with the corresponding id}
\usage{
dcat_get_distribution_from_id(distribution_id)
}
\arguments{
\item{distribution_id}{distribution's id}
}
\value{
the distribution
}
\description{
Get the distribution with the corresponding id
}
\examples{
dcat_get_distribution_from_id(distribution_id='xx')
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/api_call.R
\name{dcat_get_distributions_from_dataset_id}
\alias{dcat_get_distributions_from_dataset_id}
\title{Get all distributions for the dataset with the corresponding dataset id}
\usage{
dcat_get_distributions_from_dataset_id(dataset_id)
}
\arguments{
\item{dataset_id}{dataset's id}
}
\value{
distributions for the dataset with dataset's id
}
\description{
Get all distributions for the dataset with the corresponding dataset id
}
\examples{
dcat_get_distributions_from_dataset_id(dataset_id='xx')
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/api_call.R
\name{dcat_get_distributions_from_dataset_identifier}
\alias{dcat_get_distributions_from_dataset_identifier}
\title{Get all distributions for the dataset with the corresponding identifier.}
\usage{
dcat_get_distributions_from_dataset_identifier(identifier)
}
\arguments{
\item{identifier}{dataset's identifier}
}
\value{
all distributions for the dataset with
the corresponding dataset identifier
}
\description{
Get all distributions for the dataset with the corresponding identifier.
}
\examples{
dcat_get_distributions_from_dataset_identifier(identifier='xx')
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/api_call.R
\name{dcat_list_all_agents}
\alias{dcat_list_all_agents}
\title{List all agents}
\usage{
dcat_list_all_agents()
}
\value{
all agents
}
\description{
List all agents
}
\examples{
dcat_list_all_agents()
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/api_call.R
\name{dcat_list_all_datasets}
\alias{dcat_list_all_datasets}
\title{List all datasets}
\usage{
dcat_list_all_datasets()
}
\value{
all datasets
}
\description{
List all datasets
}
\examples{
dcat_list_all_datasets()
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/api_call.R
\name{dcat_list_all_distributions}
\alias{dcat_list_all_distributions}
\title{List all distributions}
\usage{
dcat_list_all_distributions()
}
\value{
all distributions
}
\description{
List all distributions
}
\examples{
dcat_list_all_distributions()
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/api_call.R
\name{get_codelist}
\alias{get_codelist}
\title{Get a codelist based on an identifier}
\usage{
get_codelist(
identifier,
export_format = "SDMX-ML",
version_format = 2.1,
annotations = FALSE
)
}
\arguments{
\item{identifier}{the codelist's identifier}
\item{export_format}{the export's format
Available are CSV, XLSX, SDMX-ML or JSON.}
\item{version_format}{the export format's version
(2.0 or 2.1 when format is SDMX-ML).}
\item{annotations}{flag to include annotations}
}
\value{
response based on the export format
}
\description{
Get a codelist based on an identifier
}
\examples{
get_codelist(identifier='CL_NOGA_SECTION')
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/api_call.R
\name{get_content_configuration}
\alias{get_content_configuration}
\title{Get the display information for the available configured content}
\usage{
get_content_configuration()
}
\value{
the configured content's display information
}
\description{
Get the display information for the available configured content
}
\examples{
get_content_configuration()
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/api_call.R
\name{get_data_structure}
\alias{get_data_structure}
\title{Get the data structure}
\usage{
get_data_structure(identifier, language = "en")
}
\arguments{
\item{identifier}{the dataset's identifier}
\item{language}{the language of the response data
Available are 'fr', 'de', 'it', 'en'.}
}
\value{
data structure
}
\description{
Get the data structure
}
\examples{
get_data_structure(identifier='HCL_NOGA', language='it')
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/api_call.R
\name{get_dataset_description}
\alias{get_dataset_description}
\title{Get the dcat dataset description}
\usage{
get_dataset_description(identifier, language = "fr")
}
\arguments{
\item{identifier}{the dataset's identifier}
\item{language}{the language of the response data
Available are 'fr', 'de', 'it', 'en'.}
}
\value{
dataset description
}
\description{
Get the dcat dataset description
}
\examples{
get_dataset_description(identifier='HCL_NOGA', language='de')
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/api_call.R
\name{get_dataset_information}
\alias{get_dataset_information}
\title{Get the dcat dataset information}
\usage{
get_dataset_information(identifier, language = "en")
}
\arguments{
\item{identifier}{the dataset's identifier}
\item{language}{the language of the response data
Available are 'fr', 'de', 'it', 'en'.}
}
\value{
dataset's information
}
\description{
Get the dcat dataset information
}
\examples{
get_dataset_information(identifier='HCL_NOGA', language='de')
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/api_call.R
\name{get_identifier_content}
\alias{get_identifier_content}
\title{Get a nomenclature information based on its identifier}
\usage{
get_identifier_content(identifier)
}
\arguments{
\item{identifier}{the nomenclature's identifier}
}
\value{
the nomenclature's information
}
\description{
Get a nomenclature information based on its identifier
}
\examples{
get_identifier_content(identifier='HCL_CH_ISCO_19_PROF')
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/api_call.R
\name{get_nomenclature_multiple_levels}
\alias{get_nomenclature_multiple_levels}
\title{Get multiple levels of a nomenclature (from `level_from` to `level_to`)}
\usage{
get_nomenclature_multiple_levels(
identifier,
filters,
level_from = 1,
level_to = 2,
language = "en",
annotations = FALSE
)
}
\arguments{
\item{identifier}{nomenclature's identifier}
\item{filters}{additionnal filters}
\item{level_from}{the 1st level to include}
\item{level_to}{the last level to include}
\item{language}{the language of the response data
Available are 'fr', 'de', 'it', 'en'.}
\item{annotations}{flag to include annotations}
}
\value{
dataframe columns
from `level_from` to `level_to` codes
}
\description{
Get multiple levels of a nomenclature (from `level_from` to `level_to`)
}
\examples{
get_nomenclature_multiple_levels(identifier='HCL_CH_ISCO_19_PROF', filters=my_filters, level_from=2, level_to=5)
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/api_call.R
\name{get_nomenclature_one_level}
\alias{get_nomenclature_one_level}
\title{Get one level of a nomenclature}
\usage{
get_nomenclature_one_level(
identifier,
filters,
level_number = 1,
language = "en",
annotations = FALSE
)
}
\arguments{
\item{identifier}{nomenclature's identifier}
\item{filters}{additionnal filters}
\item{level_number}{level to export}
\item{language}{the language of the response data
Available are 'fr', 'de', 'it', 'en'.}
\item{annotations}{flag to include annotations}
}
\value{
dataframe with 3 columns
(Code, Parent and Name in the selected language)
}
\description{
Get one level of a nomenclature
}
\examples{
get_nomenclature_one_level(identifier='HCL_CH_ISCO_19_PROF', filters=my_filters, level_number=2)
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/api_call.R
\name{get_nomenclature_path_nodes}
\alias{get_nomenclature_path_nodes}
\title{Get the nodes of a path within a nomenclature}
\usage{
get_nomenclature_path_nodes(
identifier,
path = ".",
filters = "",
language = "en"
)
}
\arguments{
\item{identifier}{the nomenclature's identifier}
\item{path}{the path leading to the nodes}
\item{filters}{the filters to apply}
\item{language}{the language of the response data
Available are 'fr', 'de', 'it', 'en'.}
}
\value{
nodes and their metadata
}
\description{
Get the nodes of a path within a nomenclature
}
\examples{
get_nomenclature_path_nodes(identifier='HCL_CH_ISCO_19_PROF', path='.', filters=my_filters)
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/api_call.R
\name{query_nomenclature}
\alias{query_nomenclature}
\title{Search query within a nomenclature}
\usage{
query_nomenclature(
identifier,
query,
page_number,
page_size,
filters,
language = "en"
)
}
\arguments{
\item{identifier}{nomenclature's identifier}
\item{query}{the search query}
\item{page_number}{the number of the result page to return}
\item{page_size}{the size of each page result}
\item{filters}{additionnal filters}
\item{language}{the language of the response data
Available are 'fr', 'de', 'it', 'en'.}
}
\value{
the query result
}
\description{
Search query within a nomenclature
}
\examples{
query_nomenclature(identifier='HCL_CH_ISCO_19_PROF', query='SELECT *', page_number=5, page_size=2, filters=my_filters)
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment