Skip to content

R library for DocumentCloud API

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

MuckRock/rdocumentcloud

Repository files navigation

rdocumentcloud

The rdocumentcloud package is an R wrapper for the DocumentCloud API.

Note: This package is currently a work in progress. Want to help? Check out our projects page.

Currently useful for authenticating and bulk uploading documents to an existing DocumentCloud project.

Installation

You can install the development version of rdocumentcloud from GitHub.

# install.packages("devtools")
devtools::install_github("MuckRock/rdocumentcloud")

Usage

#load the package into your environment after installing it
library(rdocumentcloud)

#create a list of document paths to upload
file_names <- c('./path/to/file/document2020_file.pdf', './path/to/file/test_file13.jpg', './path/to/file/public_record.pdf')

#specify a DocumentCloud project ID number where you want to upload documents
project_id <- 200555

#Authenticate with DocumentCloud API using username and password.
auth_response <- dc_auth('username@email.com', 'my_secret_password')
#> x  AUTHENTICATION ERROR: 401

#Bulk upload of documents to DocumentCloud. Returns a dataframe
# of paths and destination urls. NOTE: must already be authenticated
dc_response <- upload_documents(file_names, project_id, unlist(auth_response$refresh))
#> ...BEGINNING UPLOAD AT SEPTEMBER 11, 2022 17:09:15 PM 
#> x  AUTHENTICATION ERROR: 400 
#> x  EXITING AFTER 0.035 SECONDS

Sources

About

R library for DocumentCloud API

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages