MyNixOS website logo
Description

'R' Interface to the 'Diariodeobras' Application.

Provides a set of functions for securely storing 'API' tokens and interacting with the <https://diariodeobras.net> system. Includes convenient wrappers around the 'httr2' package to perform authenticated requests, retrieve project details, tasks, reports, and more.

diario

diario provides a set of functions for securely storing API tokens and interacting with the diariodeobras.net system. It wraps common functionality (e.g., authentication, GET/POST requests) in convenient R functions, making it easier to integrate Diario within R workflows.

Installation

You can install the development version of diario from GitHub with:

# install.packages("remotes")   # if needed
remotes::install_github("StrategicProjects/diario")

Getting Started

  1. Store your API token:

Before making any requests, you’ll need to store your Diario API token securely. Use diario_store_token():

library(diario)

# Store your API token securely using keyring
diario_store_token("YOUR_API_TOKEN_HERE")
  1. Retrieve your token (for debugging or confirmation):
diario_retrieve_token()
#> "YOUR_API_TOKEN_HERE"
  1. Make an authenticated request:

The main workhorse is perform_request(), which sets up and executes an authenticated request to the Diario API endpoints.

# Example: retrieving data from an endpoint
response <- diario_perform_request("v1/obras")
head(response)

Usage Examples

Get Company Details

# Retrieve information about the company
company_info <- diario_get_company()
company_info

Get Registered Entities

entities <- diario_get_entities()
entities

Get List of Projects (Obras)

projects <- diario_get_projects()
projects

Get Project Details

project_id <- "6717f864d163f517ae06e242"
project_details <- diario_get_project_details(project_id)
project_details

Get Task List for a Project

tasks <- diario_get_task_list(project_id)
tasks

Get Task Details

task_id <- "6717f884baf8d51c4f079593"
task_details <- diario_get_task_details(project_id, task_id)
task_details

Get Reports for a Project

reports <- diario_get_reports(project_id, limit = 10, order = "asc")
reports

Get Report Details

report_id <- "67648080f0971de9d00324c2"
report_details <- diario_get_report_details(project_id, report_id)
report_details

Contributing

If you would like to contribute to diario:

  • Submit issues or feature requests in the GitHub repository.
  • Create a pull request with your changes or improvements.

License

This package is provided under the MIT License. See LICENSE for details.

Metadata

Version

0.1.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows