Package 'vipunen'

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

Help Index


get_data_count

Description

Get the count of data items available through the API, which is useful for estimating the maximum number of items available.

Usage

get_data_count(resource)

Arguments

resource

character name of the resource. Name provided must be a valid resource name.

Value

numeric count of data items.

Examples

get_data_count("avoin_yliopisto")

get_parameters

Description

Low level function used for getting the valid API query parameters for a given resource endpoint.

Usage

get_parameters(resource)

Arguments

resource

character name of the resource. Name provided must be a valid resource name.

Value

tibble of query parameters.

Examples

params <- get_parameters("julkaisut")

Print method for vipunen_api class

Description

Print method for vipunen_api class

Usage

## S3 method for class 'vipunen_api'
print(x, ...)

Arguments

x

vipunen_api object

...

ignored

Value

vipunen_api object

Examples

# Get available resources
v <- vipunen_api("api/resources")
print(v)

valid_resource

Description

Test if a provided argument is a valid resource in Vipunen API. Valid resources are fetched from the API.

Usage

valid_resource(x)

Arguments

x

character name of the resource

Value

logical TRUE/FALSE

Examples

# TRUE
valid_resource("julkaisut")
# FALSE
valid_resource("foobar")

vipunen_api

Description

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.

Usage

vipunen_api(path)

Arguments

path

character url to be appended to the host.

Details

This is a low-level function intended to be used by other higher level functions in the package.

Value

vipunen_api (S3) object with the following attributes:

content

a list of parsed JSON content.

path

path provided to get the resonse.

response

the original response object.

Examples

# Get available resources
vipunen_api("api/resources")