Title: | Client for the Captricity API |
---|---|
Description: | Get text from images of text using Captricity Optical Character Recognition (OCR) API. Captricity allows you to get text from handwritten forms --- think surveys --- and other structured paper documents. And it can output data in form a delimited file keeping field information intact. For more information, read <https://shreddr.captricity.com/developer/overview/>. |
Authors: | Gaurav Sood [aut, cre] |
Maintainer: | Gaurav Sood <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.3.1 |
Built: | 2024-10-25 03:31:55 UTC |
Source: | https://github.com/gojiplus/captr |
OCR images and forms. See https://captricity.com/. Details about results of calls to the API can be found at https://shreddr.captricity.com/developer/.
Your need credentials to use this application. If you haven't already, you can get this at https://shreddr.captricity.com/developer/.
Gaurav Sood
The price for processing the batch.
batch_price(batch_id = NULL, ...)
batch_price(batch_id = NULL, ...)
batch_id |
ID for the batch; Required; String. |
... |
Additional arguments passed to |
named list
https://shreddr.captricity.com/developer/
## Not run: batch_price("batch_id") ## End(Not run)
## Not run: batch_price("batch_id") ## End(Not run)
Check if authentication information is there
captr_CHECKAUTH()
captr_CHECKAUTH()
DELETE
captr_DELETE(path = "", query = NULL, ...)
captr_DELETE(path = "", query = NULL, ...)
path |
path to specific API request URL |
query |
query list |
... |
Additional arguments passed to |
list
GET
captr_GET(path = "", query = NULL, ...)
captr_GET(path = "", query = NULL, ...)
path |
path to specific API request URL |
query |
query list |
... |
Additional arguments passed to |
list
POST
captr_POST(path = "", query = NULL, ...)
captr_POST(path = "", query = NULL, ...)
path |
path to specific API request URL |
query |
query list |
... |
Additional arguments passed to |
list
Create a new batch.
create_batch(batch_name = NULL, ...)
create_batch(batch_name = NULL, ...)
batch_name |
name of the batch; Required; character |
... |
Additional arguments passed to |
List of length 26. Includes information like created_by, user_id, etc.
https://shreddr.captricity.com/developer/api-reference/#v1-batch
## Not run: create_batch(batch_name = "name_of_batch") ## End(Not run)
## Not run: create_batch(batch_name = "name_of_batch") ## End(Not run)
Delete a Batch
delete_batch(batch_id = "", ...)
delete_batch(batch_id = "", ...)
batch_id |
ID for the batch |
... |
Additional arguments passed to |
https://shreddr.captricity.com/developer/api-reference/#v1-batches
## Not run: delete_batch("batch_id") ## End(Not run)
## Not run: delete_batch("batch_id") ## End(Not run)
Delete a Job
delete_job(job_id = "", ...)
delete_job(job_id = "", ...)
job_id |
ID for the job (which you get from related_job_id field of submit_batch) |
... |
Additional arguments passed to |
https://shreddr.captricity.com/developer/api-reference/#v1-batches
## Not run: delete_job("job_id") ## End(Not run)
## Not run: delete_job("job_id") ## End(Not run)
Get all the data
get_all(job_id = "", output_dir = "./")
get_all(job_id = "", output_dir = "./")
job_id |
ID for the job |
output_dir |
output directory |
https://shreddr.captricity.com/developer/
## Not run: get_all(job_id ="job_id") ## End(Not run)
## Not run: get_all(job_id ="job_id") ## End(Not run)
Get details such as who the batch was created by, user id of the creator, name of the batch, whether or not the batch has been submitted for processing, files in the batch, etc.
get_batch_details(batch_id = "", ...)
get_batch_details(batch_id = "", ...)
batch_id |
ID for the batch |
... |
Additional arguments passed to |
list of length 26.
https://shreddr.captricity.com/developer/api-reference/#v1-batch
## Not run: get_batch_details("batch_id") ## End(Not run)
## Not run: get_batch_details("batch_id") ## End(Not run)
If you are interested in getting data from one particular form, use this function.
get_instance_set(instance_set_id = "", ...)
get_instance_set(instance_set_id = "", ...)
instance_set_id |
ID for the form (instance_set) (which you get from list_instance_sets) |
... |
Additional arguments passed to |
https://shreddr.captricity.com/developer/
## Not run: get_instance_set("instance_set_id") ## End(Not run)
## Not run: get_instance_set("instance_set_id") ## End(Not run)
To digitize documents, create a template using the Captricity Web UI at https://shreddr.captricity.com/job/ The template tells Captricity which data to get from where in the document.
get_template_id(...)
get_template_id(...)
... |
Additional arguments passed to |
Get the template ids of all the documents
named list
https://shreddr.captricity.com/developer/
## Not run: get_template_id() ## End(Not run)
## Not run: get_template_id() ## End(Not run)
List all the files in a batch
list_batch_files(batch_id = "", ...)
list_batch_files(batch_id = "", ...)
batch_id |
ID for the batch; Required; String |
... |
Additional arguments passed to |
list. If no files in a batch, an empty list
https://shreddr.captricity.com/developer/
## Not run: list_batch_files("batch_id") ## End(Not run)
## Not run: list_batch_files("batch_id") ## End(Not run)
A list of batches owned by the calling account.
list_batches(...)
list_batches(...)
... |
Additional arguments passed to |
named list. Prints number of batches by default. Named list has 15 items:
total_batch_cost_in_fields, user_included_fields_per_page, can_be_priced,
user_pay_go_fields_applied, page_count, total_user_cost_in_cents, user_subscription_fields_applied,
user_subscription_fields_per_month, overage_field_count, total_user_cost_in_fields, batch_id,
user_subscription_fields, user_pay_go_fields, user_fields_per_overage_field, user_fields_per_page
https://shreddr.captricity.com/developer/api-reference/#v1-batches
## Not run: list_batches() ## End(Not run)
## Not run: list_batches() ## End(Not run)
A list of document resources owned by the calling account.
list_docs(...)
list_docs(...)
... |
Additional arguments passed to |
data.frame Prints total number of documents by default.
https://shreddr.captricity.com/developer/api-reference/#v1-documents
## Not run: list_docs() ## End(Not run)
## Not run: list_docs() ## End(Not run)
List all the forms (instance sets) for a particular job. Use this to get ids of forms (instance sets) you want to download.
list_instance_sets(job_id = "", ...)
list_instance_sets(job_id = "", ...)
job_id |
ID for the job (which you get from related_job_id field of submit_batch) |
... |
Additional arguments passed to |
https://shreddr.captricity.com/developer/
## Not run: list_instance_sets(job_id = "job_id") ## End(Not run)
## Not run: list_instance_sets(job_id = "job_id") ## End(Not run)
A list of jobs owned by the calling account.
list_jobs(...)
list_jobs(...)
... |
Additional arguments passed to |
https://shreddr.captricity.com/developer/api-reference/#v1-jobs
## Not run: list_jobs() ## End(Not run)
## Not run: list_jobs() ## End(Not run)
To digitize documents, create a template using the Captricity Web UI at https://shreddr.captricity.com/job/ The template tells Captricity which data to get from where in the document. Set the relevant document id using this function
set_batch_template(batch_id = "", template_id = "")
set_batch_template(batch_id = "", template_id = "")
batch_id |
Batch ID |
template_id |
ID for the template |
https://shreddr.captricity.com/developer/
## Not run: set_batch_template("batch_id", template_id) ## End(Not run)
## Not run: set_batch_template("batch_id", template_id) ## End(Not run)
Captricity requires an application token to use the API. Get the token from https://shreddr.captricity.com/.
The functions looks for CaptricityToken
in the environment. If it doesn't find it or if change is forced,
it looks for arguments passed in the function. If it fails to find that, it asks for input.
set_token(app_token = NULL, force = FALSE)
set_token(app_token = NULL, force = FALSE)
app_token |
Application token. Get these from https://shreddr.captricity.com/developer/. |
force |
Force change the |
Run this function before anything else.
https://shreddr.captricity.com/developer/
## Not run: set_token("app_token") ## End(Not run)
## Not run: set_token("app_token") ## End(Not run)
Submit the Batch for Processing
submit_batch(batch_id = "", ...)
submit_batch(batch_id = "", ...)
batch_id |
ID for the batch. Required. String. |
... |
Additional arguments passed to |
https://shreddr.captricity.com/developer/
## Not run: submit_batch("batch_id") ## End(Not run)
## Not run: submit_batch("batch_id") ## End(Not run)
Check if the batch is ready to be processed
test_readiness(batch_id = "", ...)
test_readiness(batch_id = "", ...)
batch_id |
ID for the batch. Required. String. |
... |
Additional arguments passed to |
https://shreddr.captricity.com/developer/
## Not run: test_readiness("batch_id") ## End(Not run)
## Not run: test_readiness("batch_id") ## End(Not run)
Check what percentage of the job is digitized
track_progress(job_id = "")
track_progress(job_id = "")
job_id |
ID for the job (which you get from related_job_id field of submit_batch) |
https://shreddr.captricity.com/developer/
## Not run: track_progress("job_id") ## End(Not run)
## Not run: track_progress("job_id") ## End(Not run)
Upload an image to captricity.
upload_image(batch_id = "", path_to_image = "", ...)
upload_image(batch_id = "", path_to_image = "", ...)
batch_id |
ID for the batch |
path_to_image |
Path to the image you want OCRd |
... |
Additional arguments passed to |
https://shreddr.captricity.com/developer/
## Not run: upload_image("batch_id", "path_to_image") ## End(Not run)
## Not run: upload_image("batch_id", "path_to_image") ## End(Not run)
Provides account information for the provided API Token.
user_profile(...)
user_profile(...)
... |
Additional arguments passed to |
named list with the following elements: username, deny_batch_submission_for_digitization,
account_balance, user_id, enrolled_subscription_is_annualized, enrolled_subscription,
enrolled_subscription_is_trial, trial_eligible, remaining_quota
https://shreddr.captricity.com/developer/api-reference/#v1-user_profile
## Not run: user_profile() ## End(Not run)
## Not run: user_profile() ## End(Not run)