Retrieves core bibliographic metadata for one or more Finnish statutes from the Finlex Open Data API: the date of issue, the official title, and the number of sections (Finnish: pykälät) in the statute text.

flx_get_metadata(year, number)

Arguments

year

Integer vector. Year(s) of the statute(s).

number

Integer vector. Number(s) of the statute(s) within that year. Recycled against year if shorter.

Value

A tibble::tibble() with one row per (year, number) pair and the columns:

year

As supplied.

number

As supplied.

status

One of "ok", "not_found", or "error".

date_issued

Date the statute was issued, as a Date.

title

The statute's official title.

n_sections

Integer. Number of section elements found in the Akoma Ntoso document — a rough, purely structural proxy for statute length.

Details

This function intentionally returns only raw, directly observed fields. Any derived classification (for example, grouping statutes into categories such as "Act", "Decree", or "Decision" based on title patterns) is left to a separate function, since that involves methodological choices rather than data retrieval.

Examples

# \donttest{
flx_get_metadata(year = 1992, number = 1535) # Tuloverolaki
#> # A tibble: 1 × 6
#>    year number status date_issued title        n_sections
#>   <int>  <int> <chr>  <date>      <chr>             <int>
#> 1  1992   1535 ok     1992-12-30  Tuloverolaki        155
# }