https://github.com/veryfi/veryfi-rust
Rust module for communicating with the Veryfi OCR API
https://github.com/veryfi/veryfi-rust
api api-rest invoice invoice-parser ocr ocr-library receipt rust sdk
Last synced: 9 months ago
JSON representation
Rust module for communicating with the Veryfi OCR API
- Host: GitHub
- URL: https://github.com/veryfi/veryfi-rust
- Owner: veryfi
- License: mit
- Created: 2021-12-13T15:32:19.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-03-16T15:09:13.000Z (about 3 years ago)
- Last Synced: 2025-05-04T05:33:10.704Z (about 1 year ago)
- Topics: api, api-rest, invoice, invoice-parser, ocr, ocr-library, receipt, rust, sdk
- Language: Rust
- Homepage:
- Size: 4.79 MB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
https://docs.rs/veryfi/1.0.0/veryfi/

[](https://opensource.org/licenses/MIT)
[](.github/reports/badges/plastic.svg)
**Veryfi** is a Rust module for communicating with the [Veryfi OCR API](https://veryfi.com/api/)
## Installation
Add to your cargo.tml
```toml
veryfi = "1.0.0"
```
## Getting Started
### Obtaining Client ID and user keys
If you don't have an account with Veryfi, please go ahead and register here: [https://hub.veryfi.com/signup/api/](https://hub.veryfi.com/signup/api/)
### Rust API Client Library
The **Veryfi** library can be used to communicate with Veryfi API. All available functionality is described here DOC
Below is the sample script using **Veryfi** to OCR and process data from a document:
### Process a document.
```rust
use veryfi::client::create_client;
use serde_json::{from_str, Map, Value};
fn main() {
let client_id = "your_client_id".to_string();
let client_secret = "your_client_secret".to_string();
let username = "your_username".to_string();
let api_key = "your_api_key".to_string();
let client = create_client(client_id, client_secret, username, api_key);
let categories = vec!["Advertising & Marketing", "Automotive"];
let file_path = "path_to_your_file";
let delete_after_processing = true;
let additional_parameters = Map::new();
let response = client.process_document(file_path, categories, delete_after_processing, additional_parameters);
print!("{}", response); // to print
let json_response: Value = from_str(&*response).unwrap();
// ...
}
```
### Update a document
```rust
use veryfi::client::create_client;
use serde_json::{from_str, Map, Value};
fn main() {
let client_id = "your_client_id".to_string();
let client_secret = "your_client_secret".to_string();
let username = "your_username".to_string();
let api_key = "your_api_key".to_string();
let client = create_client(client_id, client_secret, username, api_key);
let document_id = "your_document_id".to_string();
let mut parameters = Map::new();
let notes = "your_notes";
parameters.insert("notes".to_string(), Value::from(notes.clone()));
let response = client.update_document(document_id, parameters);
print!("{}", response); // to print
let json_response: Value = from_str(&*response).unwrap();
// ...
}
```
## Need help?
If you run into any issue or need help installing or using the library, please contact support@veryfi.com.
If you found a bug in this library or would like new features added, then open an issue or pull requests against this repo!
To learn more about Veryfi visit https://www.veryfi.com/
## Tutorial
Below is an introduction to the Rust SDK.