Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/flrd/autobahn

An R client for Autobahn App API, https://autobahn.api.bund.dev/
https://github.com/flrd/autobahn

Last synced: 9 days ago
JSON representation

An R client for Autobahn App API, https://autobahn.api.bund.dev/

Awesome Lists containing this project

README

        

---
output: github_document
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```

# autobahn

The `autobahn` package provides an R interface to the
[Autobahn App API](https://autobahn.api.bund.dev/).

## Installation

You can install the development version of `autobahn` from [GitHub](https://github.com/) with:

``` {r install_github, eval=FALSE}
# install.packages("devtools")
devtools::install_github("flrd/autobahn")
```

## What will you get
`autobahn` provides bindings to fetch data from the Autobahn App API, see the
[API documentation on their Swagger UI](https://autobahn.api.bund.dev/) for
more information.

The nomenclature of the functions follows the names of the resource identifiers
(URI) of the endpoints:

- `autobahn_roadworks()`
- `autobahn_parking_lorry()`
- `autobahn_warning()`
- `autobahn_closure()`
- `autobahn_electric_charging_station()`

The one exception to this rule is the function `autobahnen()` which calls
https://verkehr.autobahn.de/o/autobahn/ and returns all autobahns in Germany, see
Examples section below.

### Examples

Get a list of all Autobahnen in Germany:

```{r autobahnen, eval=TRUE}
library(autobahn)
autobahnen() |> head()
```

Get a list of all electric charging stations on autobahn "A9":

```{r A9_as_is, eval=TRUE}
A9 <- autobahn_electric_charging_station(roadId = "A9")
A9[[1]]
```

Each of the `autobahn_*` functions has two arguments:

1. `roadId`
2. `return`

The first is the identifier of a autobahn, the second argument can take one of
two values: `"as-is"`, and `"simplified"`. Default is `"as-is"` and the data
is returned -- well -- as is. If you choose the option `"simplified"` then the
data is returned in a way that shall make it easier for you to work with it.

```{r A9_simple, eval=TRUE}
A9_simple <- autobahn_electric_charging_station(roadId = "A9", return = "simplified")
A9_simple[[1]]
```
## Code of Conduct

Please note that this project is released with a [Contributor Code of Conduct](https://github.com/flrd/autobahn/blob/main/CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.