Package 'beekeeper'

Title: Rapidly Scaffold API Client Packages
Description: Automatically generate R package skeletons from 'application programming interfaces (APIs)' that follow the 'OpenAPI Specification (OAS)'. The skeletons implement best practices to streamline package development.
Authors: Jon Harmon [aut, cre, cph] , R Consortium [fnd]
Maintainer: Jon Harmon <[email protected]>
License: MIT + file LICENSE
Version: 0.4.0.9000
Built: 2024-10-26 05:57:48 UTC
Source: https://github.com/jonthegeek/beekeeper

Help Index


Use a beekeeper config file to generate code

Description

Creates or updates package files based on the information in a beekeeper config file (generated by use_beekeeper() or manually). The files enforce an opinionated framework for API packages.

Usage

generate_pkg(
  config_file = "_beekeeper.yml",
  pkg_agent = generate_pkg_agent(config_file)
)

Arguments

config_file

The path to a beekeeper yaml file.

pkg_agent

A string to identify this package, for use in the user_agent argument of nectar::req_setup().

Value

A character vector of paths to files that were added or updated, invisibly.


Create a user agent for the active package

Description

Create a user agent for the active package

Usage

generate_pkg_agent(path = ".")

Arguments

path

The path to the DESCRIPTION file, or to a directory within a package.

Value

A string with the name of the package and (if available) the first URL associated with the package.


Configure a package to use beekeeper

Description

Create a configuration file for a package to use beekeeper. The configuration file tracks information that will be used for generation of other functions, and the timestamp when the configuration was last updated or used.

Usage

use_beekeeper(
  x,
  api_abbr,
  ...,
  config_file = "_beekeeper.yml",
  rapid_file = "_beekeeper_rapid.rds"
)

Arguments

x

An object to use to define the configuration. It must be translatable to a rapid::class_rapid() object by rapid::as_rapid(). Usually this will be a url pointing to an OpenAPI document, or a list generated by reading such a document.

api_abbr

A short (about 2-5 letter) abbreviation for the API, for use in function names and environment variables.

...

These dots are for future extensions and must be empty.

config_file

The path to which the configuration should be written.

rapid_file

The path to which the R API definition (rapid) object should be written.

Value

The path to the configuration file, invisibly. The config file is written as a side effect of this function. The rapid object is also written, and the path to that file is saved in the config file.