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

lifecycle Travis build status AppVeyor build status Coverage status License: MIT

poistimesheets

poistimesheets is an R package to download Harvest timesheets and calculate hours worked for Poisson team members (it is unlikely to be useful for non-team members).

Configuration

poistimesheets uses the harvestR to get the timesheets using the Harvest API.

To permit access you will have to obtain your Harvest Account ID and Personal Access Token by registering at Harvest Developers.

You will then have to ensure that your Harvest Account ID and Personal Access Token are the environmental variables HARVEST_ACCOUNT_ID and HARVEST_PAT.

For security reasons it is recommended to save both as environment variables in your .Renviron file. Note usethis::edit_r_environ() will open .Renviron for editing.

Add two lines like this, but substitute your account ID and PAT:

HARVEST_ACCOUNT_ID=2333
HARVEST_PAT=3467.yf.yCouoea_la68-1oouoeuS-nxedugCGtls9FlJx8N66VUGvoeuoeuoe2yvtf0NqWI04nBz-Foeu

Make sure this file ends in a newline as lack of a newline can lead to silent failure to load the last environment variable...

Restart your session and confirm your ID and PAT are now available:

Sys.getenv("HARVEST_ACCOUNT_ID")
Sys.getenv("HARVEST_PAT")

Demonstration

library(poistimesheets)
timesheet <- pts_get_timesheet(from = as.Date("2018-12-23"), 
                               to = as.Date("2019-03-27"))
pts_calc_hours(timesheet)

Installation

To install the latest development version from GitHub

if(!"devtools" %in% installed.packages()[,1]) install.packages("devtools")
devtools::install_github("poissonconsulting/harvestR")
devtools::install_github("poissonconsulting/poistimesheets")

To install the latest development version from the Poisson drat repository

if(!"drat" %in% installed.packages()[,1]) install.packages("drat")
drat::addRepo("poissonconsulting")
install.packages("poistimesheets")

Contribution

Please report any issues.

Pull requests are always welcome.

Please note that the 'poistimesheets' project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms



poissonconsulting/poistimesheets documentation built on Jan. 24, 2020, 4:54 a.m.