Title: | Client Package for Vipunen API |
---|---|
Description: | vipunen is a client package for Vipunen (https://vipunen.fi/en-gb/), the Finnish education administration's reporting portal. |
Authors: | Joona Lehtomäki [aut, cre] |
Maintainer: | Joona Lehtomäki <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.1.9000 |
Built: | 2025-01-30 11:23:21 UTC |
Source: | https://github.com/rOpenGov/vipunen |
Get the count of data items available through the API, which is useful for estimating the maximum number of items available.
get_data_count(resource)
get_data_count(resource)
resource |
character name of the resource. Name provided must be a valid resource name. |
numeric count of data items.
get_data_count("avoin_yliopisto")
get_data_count("avoin_yliopisto")
Low level function used for getting the valid API query parameters for a given resource endpoint.
get_parameters(resource)
get_parameters(resource)
resource |
character name of the resource. Name provided must be a valid resource name. |
tibble of query parameters.
params <- get_parameters("julkaisut")
params <- get_parameters("julkaisut")
Print method for vipunen_api class
## S3 method for class 'vipunen_api' print(x, ...)
## S3 method for class 'vipunen_api' print(x, ...)
x |
vipunen_api object |
... |
ignored |
vipunen_api object
# Get available resources v <- vipunen_api("api/resources") print(v)
# Get available resources v <- vipunen_api("api/resources") print(v)
Test if a provided argument is a valid resource in Vipunen API. Valid resources are fetched from the API.
valid_resource(x)
valid_resource(x)
x |
character name of the resource |
logical TRUE/FALSE
# TRUE valid_resource("julkaisut") # FALSE valid_resource("foobar")
# TRUE valid_resource("julkaisut") # FALSE valid_resource("foobar")
Make a request to one of the Vipunen API's endopoints. The base url is
http://api.vipunen.fi to which a specific url defined by path
is
appended.
vipunen_api(path)
vipunen_api(path)
path |
character url to be appended to the host. |
This is a low-level function intended to be used by other higher level functions in the package.
vipunen_api (S3) object with the following attributes:
a list of parsed JSON content.
path provided to get the resonse.
the original response object.
# Get available resources vipunen_api("api/resources")
# Get available resources vipunen_api("api/resources")