restatis
R API Client for the Three Main Databases of German Official Statistics
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (17.8%) to scientific vocabulary
Last synced: 10 months ago
·
JSON representation
Repository
R API Client for the Three Main Databases of German Official Statistics
Basic Info
- Host: GitHub
- Owner: CorrelAid
- License: other
- Language: R
- Default Branch: main
- Homepage: https://correlaid.github.io/restatis/
- Size: 2.56 MB
Statistics
- Stars: 26
- Watchers: 9
- Forks: 5
- Open Issues: 8
- Releases: 0
Created over 4 years ago
· Last pushed 11 months ago
Metadata Files
Readme
Changelog
License
README.Rmd
--- output: github_document --- # restatis```{r, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" ) ``` [](https://CRAN.R-project.org/package=restatis) [](https://github.com/CorrelAid/restatis/actions/workflows/R-CMD-check.yaml) [](https://app.codecov.io/gh/CorrelAid/restatis) [](https://lifecycle.r-lib.org/articles/stages.html#experimental) [](https://github.com/sindresorhus/awesome) **{restatis}** is a wrapper around the RESTful APIs that provide access to the three main databases of German official statistics: - The [**GENESIS database** of the Federal Statistical Office of Germany (Destatis)](https://www-genesis.destatis.de/genesis/online), - [**regionalstatistik.de** which is the database of the German Länder (Regionaldatenbank)](https://www.regionalstatistik.de/genesis/online/), - The [database of the **German 2022 Census** (Zensus 2022)](https://ergebnisse.zensus2022.de/datenbank/online/). Almost all functions work on either one of them, on all of them or just on a selection. #### Current (known) performance issues - The function `gen_download_job` currently does not work in the CRAN release version for the GENESIS database. This is because the mode of downloading the tables has changed. A fix has been deployed to the development version and will be coming with the next CRAN update. - It might be that the creation of jobs with `gen_table` is currently buggy in the release version (jobs not being created despite of `job = TRUE`). A fix has been deployed to the development version and will be coming with the next CRAN update. ## Installation You can install the released version of `{restatis}` from CRAN: ``` r install.packages("restatis") ``` Or install a development version of `{restatis}` from [GitHub](https://github.com/CorrelAid/restatis) with: ``` r # install.packages("devtools") devtools::install_github("CorrelAid/restatis") ``` ## Usage ### Authentication To access each one of the APIs, you need to have an account that you can create on the homepage (see links to them above) and store your username and password for use in R with `restatis::gen_auth_save()` (see `?gen_auth_save` for more details). **Note:** The GENESIS and Zensus 2022 databases do support authentication with an API token as well. You can set the token as credential by using setting the parameter `use_token = TRUE` for `restatis::gen_auth_save()`. The token itself can be found when logging into the respective webpage with your account and by clicking on *Webservice (API)* (EN) or *Webservice-Schnittstelle (API)* (DE) in the bottom left corner. **Important:** The GENESIS database will not let you create jobs when using API tokens to authenticate. This is why `{restatis}` will check your credential type once you set `job = TRUE` for `gen_table()` and error in case a token is used. To enable the use of jobs, use `gen_auth_save()` and input your username and password (by setting `use_token = FALSE`). ### Main features {restatis} provides functions (prefixed with `gen_`) for finding, exploring, and retrieving data from the three supported APIs. See the ["Basic restatis workflow" vignette](https://correlaid.github.io/restatis/articles/restatis.html) for an overview of the main features of the package. In short, there are functions divided in two main parts, searching for (meta)data and retrieving data: #### Searching for (meta)data - **gen_catalogue()**: Search the API's catalogue of data - **gen_find()**: Find objects related to a search term - **gen_metadata()**: Find meta data to an objects - **gen_alternative_terms()**: Find alternative terms to a search term - **gen_modified_data()**: Find out when an object has last been modified - **gen_objects2stat()**, **gen_objects2var()**, **gen_var2stat()**, **gen_val2var()**, **gen_val2var2stat()** and **gen_search_vars()**: Find objects, statistics, variables and values related to each other #### Retrieving data - **gen_cube()**: Using this function, you can download 'cube' objects - **gen_table()**: Using this function, you can download 'table' objects - **gen_list_jobs()** and **gen_download_job()**: Using this function, you can find and download previously created jobs (large tables) #### Other functions - **gen_logincheck()**: Perform a logincheck to test your credentials - **gen_signs()**: Get a list of quality signs (special characters) found in the API's tables - **gen_update_evas()**: Manually scrape a newer version of the EVAS numbers (official statistic IDs) ### Caching `{restatis}` uses [**memoisation**](https://github.com/r-lib/memoise) to cache query results. This means that if you call a function multiple times with the same exact input, the values returned the first time are stored and reused from the second time on. Cached objects are stored in memory and do not persist across R sessions. With version 0.3.0, we have enabled users to turn off caching. The caching option is set to TRUE by default and can be changed by setting `options(restatis.use_cache = TRUE)` (or `FALSE`, respectively). You can get the current state of the option by using `getOption("restatis.use_cache")`. **Note:** Memoisation is *never* used for the functions `gen_list_jobs()` and `gen_logincheck()` because there is no use-case for a cached version of the results of these functions (e.g., login checks should always be executed when called). ## Disclaimer This package is in no way affiliated with the German Federal Statistical Office (Destatis) or the 'Verbund Statistische Ämter des Bundes und der Länder'. It is a simple wrapper providing R functions to access different official statistics APIs. The package authors are in no way responsible for the data that can be retrieved using its functions and do not provide support for any problems arising from the APIs' functionality itself. Conversely, support for problems related to this package is **exclusively** provided by the package authors. The license of this package solely applies to its source code.
Owner
- Name: CorrelAid
- Login: CorrelAid
- Kind: organization
- Email: info@correlaid.org
- Location: Germany
- Website: https://www.correlaid.org
- Twitter: CorrelAid
- Repositories: 66
- Profile: https://github.com/CorrelAid
Soziales Engagement 2.0 - Datenanalyse für den guten Zweck
GitHub Events
Total
- Issues event: 39
- Watch event: 4
- Delete event: 1
- Issue comment event: 23
- Push event: 86
- Pull request event: 6
- Fork event: 1
Last Year
- Issues event: 39
- Watch event: 4
- Delete event: 1
- Issue comment event: 23
- Push event: 86
- Pull request event: 6
- Fork event: 1
Issues and Pull Requests
Last synced: 10 months ago
All Time
- Total issues: 10
- Total pull requests: 2
- Average time to close issues: 29 days
- Average time to close pull requests: 5 minutes
- Total issue authors: 2
- Total pull request authors: 2
- Average comments per issue: 0.6
- Average comments per pull request: 0.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 9
- Pull requests: 2
- Average time to close issues: 12 days
- Average time to close pull requests: 5 minutes
- Issue authors: 2
- Pull request authors: 2
- Average comments per issue: 0.33
- Average comments per pull request: 0.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- yannikbuhl (24)
- wahlatlas (2)
- long39ng (1)
- Vetrarsol (1)
- CubicTom (1)
- MTRNord (1)
Pull Request Authors
- yannikbuhl (8)
- stefanlinner (1)
- dakilian (1)
Top Labels
Issue Labels
enhancement (13)
documentation (5)
bug (5)
question (3)
Pull Request Labels
bug (1)
Packages
- Total packages: 1
-
Total downloads:
- cran 581 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 3
- Total maintainers: 1
cran.r-project.org: restatis
R Wrapper to Access a Wide Range of Germany's Federal Statistical System Databases Based on the GENESIS Web Service RESTful API of the German Federal Statistical Office (Statistisches Bundesamt/Destatis)
- Homepage: https://correlaid.github.io/restatis/
- Documentation: http://cran.r-project.org/web/packages/restatis/restatis.pdf
- License: MIT + file LICENSE
-
Latest release: 0.3.0
published about 1 year ago
Rankings
Dependent packages count: 29.1%
Dependent repos count: 34.8%
Average: 51.2%
Downloads: 89.6%
Maintainers (1)
Last synced:
10 months ago
Dependencies
.github/workflows/R-CMD-check.yaml
actions
- actions/checkout v2 composite
- r-lib/actions/check-r-package v1 composite
- r-lib/actions/setup-pandoc v1 composite
- r-lib/actions/setup-r v1 composite
- r-lib/actions/setup-r-dependencies v1 composite
DESCRIPTION
cran
- askpass * imports
- httr2 * imports
- memoise * imports
.github/workflows/pkgdown.yaml
actions
- JamesIves/github-pages-deploy-action v4.4.1 composite
- actions/checkout v3 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/test-coverage.yaml
actions
- actions/checkout v3 composite
- actions/upload-artifact v3 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
[](https://CRAN.R-project.org/package=restatis)
[](https://github.com/CorrelAid/restatis/actions/workflows/R-CMD-check.yaml)
[](https://app.codecov.io/gh/CorrelAid/restatis)
[](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[](https://github.com/sindresorhus/awesome)
**{restatis}** is a wrapper around the RESTful APIs that provide access to the three main databases of German official statistics:
- The [**GENESIS database** of the Federal Statistical Office of Germany (Destatis)](https://www-genesis.destatis.de/genesis/online),
- [**regionalstatistik.de** which is the database of the German Länder (Regionaldatenbank)](https://www.regionalstatistik.de/genesis/online/),
- The [database of the **German 2022 Census** (Zensus 2022)](https://ergebnisse.zensus2022.de/datenbank/online/).
Almost all functions work on either one of them, on all of them or just on a selection.
#### Current (known) performance issues
- The function `gen_download_job` currently does not work in the CRAN release version for the GENESIS database. This is because the mode of downloading the tables has changed. A fix has been deployed to the development version and will be coming with the next CRAN update.
- It might be that the creation of jobs with `gen_table` is currently buggy in the release version (jobs not being created despite of `job = TRUE`). A fix has been deployed to the development version and will be coming with the next CRAN update.
## Installation
You can install the released version of `{restatis}` from CRAN:
``` r
install.packages("restatis")
```
Or install a development version of `{restatis}` from [GitHub](https://github.com/CorrelAid/restatis) with:
``` r
# install.packages("devtools")
devtools::install_github("CorrelAid/restatis")
```
## Usage
### Authentication
To access each one of the APIs, you need to have an account that you can create on the homepage (see links to them above) and store your username and password for use in R with `restatis::gen_auth_save()` (see `?gen_auth_save` for more details).
**Note:** The GENESIS and Zensus 2022 databases do support authentication with an API token as well. You can set the token as credential by using setting the parameter `use_token = TRUE` for `restatis::gen_auth_save()`. The token itself can be found when logging into the respective webpage with your account and by clicking on *Webservice (API)* (EN) or *Webservice-Schnittstelle (API)* (DE) in the bottom left corner. **Important:** The GENESIS database will not let you create jobs when using API tokens to authenticate. This is why `{restatis}` will check your credential type once you set `job = TRUE` for `gen_table()` and error in case a token is used. To enable the use of jobs, use `gen_auth_save()` and input your username and password (by setting `use_token = FALSE`).
### Main features
{restatis} provides functions (prefixed with `gen_`) for finding, exploring, and retrieving data from the three supported APIs. See the ["Basic restatis workflow" vignette](https://correlaid.github.io/restatis/articles/restatis.html) for an overview of the main features of the package.
In short, there are functions divided in two main parts, searching for (meta)data and retrieving data:
#### Searching for (meta)data
- **gen_catalogue()**: Search the API's catalogue of data
- **gen_find()**: Find objects related to a search term
- **gen_metadata()**: Find meta data to an objects
- **gen_alternative_terms()**: Find alternative terms to a search term
- **gen_modified_data()**: Find out when an object has last been modified
- **gen_objects2stat()**, **gen_objects2var()**, **gen_var2stat()**, **gen_val2var()**, **gen_val2var2stat()** and **gen_search_vars()**: Find objects, statistics, variables and values related to each other
#### Retrieving data
- **gen_cube()**: Using this function, you can download 'cube' objects
- **gen_table()**: Using this function, you can download 'table' objects
- **gen_list_jobs()** and **gen_download_job()**: Using this function, you can find and download previously created jobs (large tables)
#### Other functions
- **gen_logincheck()**: Perform a logincheck to test your credentials
- **gen_signs()**: Get a list of quality signs (special characters) found in the API's tables
- **gen_update_evas()**: Manually scrape a newer version of the EVAS numbers (official statistic IDs)
### Caching
`{restatis}` uses [**memoisation**](https://github.com/r-lib/memoise) to cache query results. This means that if you call a function multiple times with the same exact input, the values returned the first time are stored and reused from the second time on. Cached objects are stored in memory and do not persist across R sessions. With version 0.3.0, we have enabled users to turn off caching. The caching option is set to TRUE by default and can be changed by setting `options(restatis.use_cache = TRUE)` (or `FALSE`, respectively). You can get the current state of the option by using `getOption("restatis.use_cache")`. **Note:** Memoisation is *never* used for the functions `gen_list_jobs()` and `gen_logincheck()` because there is no use-case for a cached version of the results of these functions (e.g., login checks should always be executed when called).
## Disclaimer
This package is in no way affiliated with the German Federal Statistical Office (Destatis) or the 'Verbund Statistische Ämter des Bundes und der Länder'. It is a simple wrapper providing R functions to access different official statistics APIs. The package authors are in no way responsible for the data that can be retrieved using its functions and do not provide support for any problems arising from the APIs' functionality itself. Conversely, support for problems related to this package is **exclusively** provided by the package authors. The license of this package solely applies to its source code.