Changelog
Source:NEWS.md
pixieweb 0.1.1.9002
New features
-
get_variables()gainscacheandcache_locationarguments, matching the interface ofget_tables()andget_data(). Variable metadata can now be cached to the shared SQLite backend via annxt_handlefrom nordstatExtras, or to the legacy.rdsdirectory. Previously, callers that passed these arguments (reasonably assuming parity with the otherget_*functions) received a silent error via consumer-sidetryCatchwrapping.
pixieweb 0.1.1.9001
Bug fixes
get_tables()now paginates transparently on v2 APIs. Previously, the v2 code path sent a single request withpageSize = max_results(default 100). For SCB, which holds tens of thousands of tables, users had to discover the undocumented workaround of settingmax_results = 100000Lto avoid silently capped results. The new implementation loops overpageNumberin 1000-row chunks, stopping when the API reportstotalPagesreached, whenmax_resultsis satisfied, when a short page is returned, or at a 50000-row safety cap for the rare “no filter, nomax_results” full-listing case.max_results = NULL(the default) now means “all matching tables”, consistent withrKolada::get_kpi()andrTrafa::get_products(). A user query for “befolkning” on SCB that previously returned 100 tables now returns all 205 in roughly 1 second.get_tables(query = ...)now URL-encodes the query parameter. Previously,get_tables_v2built the request URL with a plainpaste()call, unlike the v1 code path which correctly usedutils::URLencode(). As a result, any search term containing non-ASCII characters (å/ä/ö, accented letters, spaces, punctuation) silently returned zero tables even when matching tables existed. For SCB searches this meant almost all Swedish queries failed. Verified against the SCB API:query = "arbetslöshet"now correctly returns tables such as TAB203 Arbetslösa 16-64 år (AKU).
pixieweb 0.1.1
New features
-
data_legend()gainslang,omit_varnameandomit_descarguments, mirroring the same API in the sibling packagerTrafa.lang(default"EN", settable viagetOption("pixieweb.lang", "EN")) toggles the source prefix between"Source: …, table X"and"Källa: …, tabell X".omit_varnamedrops the raw variable codes from the variable list;omit_descshows only the codes. -
data_legend()’svar_dfargument is now optional. When omitted, the caption contains only the source line derived from thepx_sourceattribute attached byget_data(). -
Optional SQLite-backed caching via nordstatExtras.
get_data(),get_tables(), andtable_enrich()now acceptcache = TRUEwith a.sqlitecache_locationfor shared, multi-process cache backed by the nordstatExtras package. Cell-level deduplication for data; per-table incremental enrichment with resume-on-crash andasync = TRUEsupport fortable_enrich(). Falls back to the existing.rdscache when nordstatExtras is not installed.
Documentation
-
Vignette data is now pre-cached on disk via
data-raw/vignette-data.RandR/sysdata.rda, mirroring the approach used inrKoladaandrTrafa. Vignettes render offline and show real API output for tables, variables, prepared queries, codelists and plots. -
Introduction vignette rewritten: the
Kolada-comparison table in the “data model” section is replaced with a dedicated, pedagogical explanation of the PX-Web data cube (API → table → variables → content codes → codelists → data), following the same structure as therKoladaandrTrafaintroduction vignettes. - Vignette plots now convert
TidtoDatebefore plotting and usescale_x_date(date_breaks = "1 year", date_labels = "%Y"), so axis breaks land on whole years rather than on decimal years like2020, 2022.5, 2025. This pattern is explained inline and is consistent with the sibling packagesrKoladaandrTrafa. - README and all vignettes now cross-link to the sibling packages
rKoladaandrTrafa, and listinstall.packages("pixieweb")as the primary install path. - README now includes a section on enhanced caching with nordstatExtras.
pixieweb 0.1.0
CRAN release: 2026-03-26
Initial CRAN release.
Documentation
- Improved quickstart vignette: explains ContentsCode, elimination,
_textcolumns, and adds inline ggplot comments. - Improved introduction vignette: navigation help, clearer elimination explanation, “Advanced features” marker, and motivation for codelists/wide output/query composition/saved queries.
- Improved multi-api vignette: honest framing of cross-country challenges, guidance on finding comparable tables, actionable tips, and cross-references.
- Fixed Unicode
≤inprepare_query()documentation that caused LaTeX PDF manual errors.
Features
-
API connection:
px_api()creates reusable connection objects for any PX-Web API (SCB, SSB, Statistics Finland, etc.) with automatic version detection (v1/v2). -
API availability:
px_available()performs a lightweight connectivity check, used to guard examples and tests. -
Table discovery:
get_tables()searches and lists available tables with support for both v1 (tree-walking) and v2 (search endpoint) APIs. -
Variable inspection:
get_variables()retrieves variable metadata for any table, including value lists and selection types. -
Data retrieval:
get_data()downloads data with automatic query construction, chunking for large requests, and rate limiting. -
Codelists:
get_codelists()retrieves codelist metadata;codelist_values()andcodelist_describe()for inspection. -
Selection helpers:
px_all(),px_top(),px_bottom(),px_from(),px_to(),px_range()for concise variable selections. -
Query workflow:
prepare_query()for interactive query building;compose_table_query(),compose_data_query(),execute_query()for programmatic access. -
Saved queries:
save_query()andget_saved_query()for persisting and reloading query specifications. -
Table helpers:
table_search(),table_describe(),table_enrich(),table_minimize(),table_extract_ids()for working with table metadata. -
Variable helpers:
variable_search(),variable_describe(),variable_minimize(),variable_extract_ids(),variable_name_to_code(),variable_values()for working with variables. -
Data helpers:
data_minimize(),data_comments(),data_legend()for working with downloaded data. -
Persistent caching:
pixieweb_cache_dir()andpixieweb_clear_cache()for managing cached API responses usingtools::R_user_dir(). -
Citations:
px_cite()generates citations for downloaded data. - HTTP resilience: Automatic retry with exponential backoff for transient errors and rate limiting (HTTP 429).
- Built-in API catalogue: Ships with a catalogue of known PX-Web APIs for Nordic and European statistical agencies.