Skip to contents

istatlab 0.8.0

Nuove funzionalità

  • La directory della cache dei metadati è ora configurabile tramite la variabile d’ambiente ISTATLAB_CACHE_DIR. La risoluzione avviene con Sys.getenv("ISTATLAB_CACHE_DIR", unset = "meta"): quando la variabile non è impostata il comportamento resta invariato (directory locale meta/). Impostando la variabile (ad esempio in .Renviron) più progetti possono condividere una sola cache (es. shared_data/meta), evitando la duplicazione di codelists.rds e flussi_istat.rds.

Interno

  • Nuovo helper interno .istatlab_cache_dir() usato come unica regola di risoluzione della directory di cache in tutte le funzioni che leggono o scrivono i metadati.

istatlab 0.7.3

New Features

  • New check_bulk_updates() function for scanning multiple datasets to detect which ones require updating. The function performs metadata-only queries without downloading actual data, returning a vector of dataset IDs with newer updates available. This enables efficient update scheduling for bulk data pipelines.

Bug Fixes

Internal

  • Added targets pipeline at pipelines/daily_employment/ for daily automated download of employment datasets to DuckDB.
  • Added dataset_id and status to globalVariables() in R/istatlab-package.R to suppress R CMD check NOTEs.
  • Added 35 unit tests for check_bulk_updates() covering edge cases, API failures, and timestamp handling.

istatlab 0.7.2

Bug Fixes

  • Fixed HTTP 406 errors on HVD structure endpoints. The HVD server rejects all SDMX-specific Accept headers for structure queries; these now use generic application/json, application/xml, or text/csv headers. Data endpoints retain SDMX-specific headers.
  • Fixed list_hvd_dataflows() response parser. The HVD server returns dataflows in a references map keyed by URN, not in the standard Structure.Dataflows.Dataflow path. The parser now handles both formats.

Tests

  • Added 29 tests for .parse_hvd_dataflows() covering all response format variants.
  • Updated Accept header tests to match generic structure headers.

istatlab 0.7.1

Bug Fixes

Improvements

  • Removed curl dependency entirely. All HTTP operations now use httr exclusively, eliminating redundant curl fallback retries that contributed to ISTAT rate-limit bans.
  • Removed deprecated istat_fetch_with_curl() function.
  • Removed live endpoint integration tests to prevent ban-triggering traffic during automated testing.

istatlab 0.7.0

New Features

HTTP Transport

SDMX 3.0 Support

  • New build_sdmx3_filters() function to translate time period filters from startPeriod/endPeriod to SDMX 3.0 c[TIME_PERIOD]=ge:..+le:.. syntax.
  • HVD v2 URL builders handle the full SDMX 3.0 path structure with context, agencyId, resourceId, and version parameters.
  • HVD v2 is marked as experimental; v1 is recommended for production use.

Internal

  • New files: R/hvd_config.R, R/hvd_download.R, R/hvd_metadata.R.
  • HVD configuration added to get_istat_config() with base URLs and endpoint registry.
  • Extended list_istat_endpoints() and test_endpoint_connectivity() to include HVD endpoints.
  • Test suite expanded with 169 new tests across 3 test files (test-hvd-config.R, test-hvd-download.R, test-http-post.R).

istatlab 0.6.0

Breaking Changes

  • Demo registry overhaul: ISTAT restructured the demo.istat.it portal. URL patterns for most datasets changed. The registry now reflects the current portal structure with 8 URL patterns (A, A1, B, C, D, E, F, G) covering 15 downloadable datasets and 15 interactive-only datasets.

New Features

  • New URL patterns for the restructured demo.istat.it portal:
    • Pattern A1: Year+locale URLs for AIR (AIRE registry) dataset.
    • Pattern F: Static file download for TVA (actuarial mortality tables).
    • Pattern G: Plain CSV download (no ZIP) for ISM (deaths by municipality).
  • download_demo_data() now handles plain CSV files (Pattern G) in addition to ZIP archives.
  • Non-downloadable (interactive-only) datasets return informative errors pointing to the portal URL.
  • list_demo_datasets() and search_demo_datasets() include a downloadable column.
  • Pattern D now supports per-dataset base_path, file_extension, and optional geo_level, enabling PPR, PPC, RIC, and PRF datasets with their distinct URL structures.

Bug Fixes

  • Fixed STR (foreign resident population) download: base_path changed from stras to strasa, file_code from STRAS to STRASA.
  • Fixed RCS (population by citizenship): moved from Pattern B to Pattern E (subtype-indexed) to match new rcs/Dati_RCS_{subtype}_{year}.zip URL structure.
  • Fixed P02 and P03: moved from Pattern A to Pattern B (territory-indexed) with updated paths.
  • Fixed TVM: updated levels (removed comunali, added ripartizione) and types (renamed sintetici to ridotti).
  • Fixed PPR: updated data_types and geo_levels to match current portal.
  • Fixed TVA: changed from Pattern C to Pattern F (single static file).
  • Fixed RBD: updated base_path to ricostruzione and file_code to RBD-Dataset-.
  • Fixed AIR: updated base_path to aire and file_code to AIRE, year range to 2022-present.

Internal

  • 15 datasets marked as interactive-only (R91, R92, FE1, FE3, SSC, MA1-MA4, NU1, UC1-UC4, PFL) — no longer offer bulk CSV downloads.
  • Test suite expanded from ~60 to 143 demo-specific tests covering all 8 URL patterns.
  • Fixed switch() partial argument match NOTE in build_demo_url().

istatlab 0.5.0

New Features

Bug Fixes

  • Fixed process_editions() to use date-based comparison instead of alphabetical string comparison when determining the latest edition.
  • Fixed edition date parsing to handle double-hyphen artifacts from G/M prefix replacement.

Documentation

  • Updated pkgdown reference index with edition-aware download functions and demographic data functions.

istatlab 0.3.2

New Features

istatlab 0.3.1

Improvements

  • Refactored connectivity testing to use curl R package instead of system() calls, improving portability across platforms
  • Consolidated API function implementations and simplified connectivity testing logic for better maintainability

istatlab 0.3.0

New Features

Improvements

  • Optimized download architecture for better performance on multi-frequency datasets
  • Improved time series filtering with frequency detection and validation

istatlab 0.2.3

Maintenance Release

  • Removed deprecated fetch_datastructure_endpoint() function (redundant wrapper around download_codelists())
  • Cleaned up package by removing duplicate and unused functions
  • Code quality improvements

istatlab 0.2.2

Maintenance Release

  • Updated test infrastructure and test file organization
  • Enhanced test coverage and validation

istatlab 0.2.1

Maintenance Release

  • Enhanced error handling and HTTP transport layer implementation
  • Improved robustness and code quality in download architecture
  • Updated dependencies and internal refactoring for better maintainability

istatlab 0.2.0

New Features

  • New modular architecture for download functions with clear separation of concerns:

    • error_handling.R: Structured error types, exit codes, and timestamped logging
    • http_transport.R: HTTP layer with httr primary and curl fallback
    • response_processor.R: CSV parsing, column normalization, and checksum computation
  • New return_result parameter for download_istat_data() returns structured istat_result object with:

    • success: Boolean success indicator
    • data: Downloaded data.table
    • exit_code: Integer (0=success, 1=error, 2=timeout)
    • md5: MD5 checksum for data integrity (requires digest package)
    • is_timeout: Boolean timeout indicator
    • message: Descriptive status message
  • Enhanced error classification with exit codes following standard conventions:

    • 0: Success
    • 1: Generic error (connectivity, HTTP, parsing)
    • 2: Timeout error
  • Timestamped logging with format: YYYY-MM-DD HH:MM:SS TZ [LEVEL] - message

  • MD5 checksums for data integrity verification (optional, requires digest package)

Deprecations

These deprecated functions remain functional but will be removed in version 1.0.0.

Dependencies

  • Added digest to Suggests for optional MD5 checksum computation

istatlab 0.1.5

  • Maintenance release with dependency synchronization
  • Updated package documentation and roxygen2 comments
  • Enhanced API connectivity and error handling

istatlab 0.1.4

istatlab 0.1.3

  • Reorganized project structure and cleaned up main directory
  • Moved non-package files to reference directory for better maintainability
  • Maintained all core R package functionality and tests

istatlab 0.1.1

  • Enhanced and improved package documentation
  • Updated roxygen2 comments for better clarity and completeness
  • Improved function examples and parameter descriptions
  • Enhanced vignettes and user guides

istatlab 0.1.0

  • Initial release of istatlab package
  • Added core functionality for downloading ISTAT data via SDMX API
  • Implemented comprehensive data processing and labeling functions
  • Added time series analysis capabilities including trend analysis and growth rate calculations
  • Included forecasting functionality with multiple methods (ARIMA, ETS, linear, naive)
  • Created publication-ready visualization functions using ggplot2
  • Established comprehensive testing framework with testthat
  • Added extensive documentation with roxygen2
  • Implemented structural break detection
  • Added dashboard plotting capabilities
  • Included data validation and error handling throughout