{"id":19982949,"url":"https://github.com/veryfi/veryfi-ruby","last_synced_at":"2025-05-04T05:32:36.971Z","repository":{"id":42445757,"uuid":"402658730","full_name":"veryfi/veryfi-ruby","owner":"veryfi","description":"Ruby gem for communicating with the Veryfi OCR API.","archived":false,"fork":false,"pushed_at":"2024-03-04T23:01:49.000Z","size":4951,"stargazers_count":8,"open_issues_count":1,"forks_count":7,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-04-22T04:23:53.677Z","etag":null,"topics":["api","invoice","invoice-parser","ocr","ocr-library","receipt","receipt-reader","ruby","sdk","sdk-ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/veryfi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-03T05:37:43.000Z","updated_at":"2024-05-29T21:16:38.557Z","dependencies_parsed_at":"2023-12-18T22:03:29.688Z","dependency_job_id":"d8f7e806-35f7-4a90-9d03-a154c8f10ebe","html_url":"https://github.com/veryfi/veryfi-ruby","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veryfi%2Fveryfi-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veryfi%2Fveryfi-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veryfi%2Fveryfi-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veryfi%2Fveryfi-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/veryfi","download_url":"https://codeload.github.com/veryfi/veryfi-ruby/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252293082,"owners_count":21724960,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","invoice","invoice-parser","ocr","ocr-library","receipt","receipt-reader","ruby","sdk","sdk-ruby"],"created_at":"2024-11-13T04:13:41.238Z","updated_at":"2025-05-04T05:32:35.069Z","avatar_url":"https://github.com/veryfi.png","language":"Ruby","readme":"# Veryfi SDK for Ruby\n\n\u003cimg src=\"https://user-images.githubusercontent.com/30125790/212157461-58bdc714-2f89-44c2-8e4d-d42bee74854e.png#gh-dark-mode-only\" width=\"200\"\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/30125790/212157486-bfd08c5d-9337-4b78-be6f-230dc63838ba.png#gh-light-mode-only\" width=\"200\"\u003e\n\n[![Version](https://img.shields.io/gem/v/veryfi)](https://rubygems.org/gems/veryfi)\n[![Test](https://github.com/veryfi/veryfi-ruby/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/veryfi/veryfi-ruby/actions/workflows/test.yml)\n[![Coverage](https://raw.githubusercontent.com/veryfi/veryfi-ruby/main/coverage/coverage-badge.png)](https://raw.githubusercontent.com/veryfi/veryfi-ruby/main/coverage/coverage-badge.png)\n\n**veryfi-ruby** is a Ruby gem for communicating with the [Veryfi OCR API](https://veryfi.com/api/)\n\n[Documentation](https://veryfi.github.io/veryfi-ruby/)\n\n## Table of Contents\n\n- [Top](#veryfi-sdk-for-ruby)\n  - [Table of Contents](#table-of-contents)\n  - [Example](#example)\n  - [Installation](#installation)\n  - [Getting Started](#getting-started)\n    - [Obtaining Client ID and user keys](#obtaining-client-id-and-user-keys)\n    - [Ruby API Client Library](#ruby-api-client-library)\n  - [Need help?](#need-help)\n- [For Developers](#for-developers)\n  - [Install](#install)\n  - [Quality tools](#quality-tools)\n  - [Develop](#develop)\n\n\n## Example\n\nBelow is a sample script using \u003ca href=\"https://www.veryfi.com\" target=\"_blank\"\u003e**Veryfi**\u003c/a\u003e for OCR and extracting data from a document:\n\n```ruby\nrequire 'veryfi'\n\nveryfi_client = Veryfi::Client.new(\n  client_id: 'your_client_id',\n  client_secret: 'your_client_secret',\n  username: 'your_username',\n  api_key: 'your_password'\n)\n```\n\nThis submits a document for processing (3-5 seconds for a response)\n\n```ruby\nparams = {\n  file_path: './test/receipt.jpg',\n  auto_delete: true,\n  boost_mode: false,\n  async: false,\n  external_id: '123456789',\n  max_pages_to_process: 10,\n  tags: ['tag1'],\n  categories: [\n    'Advertising \u0026 Marketing',\n    'Automotive'\n  ]\n}\n\nresponse = veryfi_client.document.process(params)\n\nputs response\n```\n\n...or with a URL\n\n```ruby\nparams = {\n  file_url: 'https://raw.githubusercontent.com/veryfi/veryfi-python/master/tests/assets/receipt_public.jpg',\n  auto_delete: true,\n  boost_mode: false,\n  async: false,\n  external_id: '123456789',\n  max_pages_to_process: 10,\n  tags: ['tag1'],\n  categories: [\n    'Advertising \u0026 Marketing',\n    'Automotive'\n  ]\n}\n\nresponse = veryfi_client.document.process_url(params)\n\nputs response\n```\n\nThis will produce the following response:\n\n```json\n{\n  \"abn_number\": \"\",\n  \"account_number\": \"\",\n  \"bill_to_address\": \"2 Court Square\\nNew York, NY 12210\",\n  \"bill_to_name\": \"John Smith\",\n  \"bill_to_vat_number\": \"\",\n  \"card_number\": \"\",\n  \"cashback\": 0,\n  \"category\": \"Repairs \u0026 Maintenance\",\n  \"created\": \"2021-06-28 19:20:02\",\n  \"currency_code\": \"USD\",\n  \"date\": \"2019-02-11 00:00:00\",\n  \"delivery_date\": \"\",\n  \"discount\": 0,\n  \"document_reference_number\": \"\",\n  \"document_title\": \"\",\n  \"document_type\": \"invoice\",\n  \"due_date\": \"2019-02-26\",\n  \"duplicate_of\": 37055375,\n  \"external_id\": \"\",\n  \"id\": 37187909,\n  \"img_file_name\": \"receipt.png\",\n  \"img_thumbnail_url\": \"https://scdn.veryfi.com/receipts/thumbnail.png\",\n  \"img_url\": \"https://scdn.veryfi.com/receipts/receipt.png\",\n  \"insurance\": \"\",\n  \"invoice_number\": \"US-001\",\n  \"is_duplicate\": 1,\n  \"line_items\": [\n    {\n      \"date\": \"\",\n      \"description\": \"Front and rear brake cables\",\n      \"discount\": 0,\n      \"id\": 68004313,\n      \"order\": 0,\n      \"price\": 100,\n      \"quantity\": 1,\n      \"reference\": \"\",\n      \"section\": \"\",\n      \"sku\": \"\",\n      \"tax\": 0,\n      \"tax_rate\": 0,\n      \"total\": 100,\n      \"type\": \"product\",\n      \"unit_of_measure\": \"\"\n    },\n    {\n      \"date\": \"\",\n      \"description\": \"New set of pedal arms\",\n      \"discount\": 0,\n      \"id\": 68004315,\n      \"order\": 1,\n      \"price\": 15,\n      \"quantity\": 2,\n      \"reference\": \"\",\n      \"section\": \"\",\n      \"sku\": \"\",\n      \"tax\": 0,\n      \"tax_rate\": 0,\n      \"total\": 30,\n      \"type\": \"product\",\n      \"unit_of_measure\": \"\"\n    },\n    {\n      \"date\": \"\",\n      \"description\": \"Labor 3hrs\",\n      \"discount\": 0,\n      \"id\": 68004316,\n      \"order\": 2,\n      \"price\": 5,\n      \"quantity\": 3,\n      \"reference\": \"\",\n      \"section\": \"\",\n      \"sku\": \"\",\n      \"tax\": 0,\n      \"tax_rate\": 0,\n      \"total\": 15,\n      \"type\": \"service\",\n      \"unit_of_measure\": \"\"\n    }\n  ],\n  \"notes\": \"\",\n  \"ocr_text\": \"\\n\\fEast Repair Inc.\\n1912 Harvest Lane\\nNew York, NY 12210\\n\\nBILL TO\\t\\tSHIP TO\\tRECEIPT #\\tUS-001\\nJohn Smith\\t\\tJohn Smith\\tRECEIPT DATE\\t11/02/2019\\n2 Court Square\\t3787 Pineview Drive\\n\\tP.O.#\\t2312/2019\\nNew York, NY 12210\\tCambridge, MA 12210\\n\\tDUE DATE\\t26/02/2019\\nReceipt Total\\t\\t\\t$154.06\\n\\nQTY DESCRIPTION\\t\\t\\tUNIT PRICE\\tAMOUNT\\n1\\tFront and rear brake cables\\t\\t100.00\\t100.00\\n2\\tNew set of pedal arms\\t\\t\\t15.00\\t30.00\\n3\\tLabor 3hrs\\t\\t\\t\\t5.00\\t15.00\\n\\n\\tSubtotal\\t145.00\\n\\tSales Tax 6.25%\\t9.06\\n\\nTERMS \u0026 CONDITIONS\\nPayment is due within 15 days\\nPlease make checks payable to: East Repair\\n\\tJohn Smith\\n\\tInc.\\n\",\n  \"order_date\": \"\",\n  \"payment_display_name\": \"\",\n  \"payment_terms\": \"15 days\",\n  \"payment_type\": \"\",\n  \"phone_number\": \"\",\n  \"purchase_order_number\": \"2312/2019\",\n  \"rounding\": 0,\n  \"service_end_date\": \"\",\n  \"service_start_date\": \"\",\n  \"ship_date\": \"\",\n  \"ship_to_address\": \"3787 Pineview Drive\\nCambridge, MA 12210\",\n  \"ship_to_name\": \"John Smith\",\n  \"shipping\": 0,\n  \"store_number\": \"\",\n  \"subtotal\": 145,\n  \"tax\": 9.06,\n  \"tax_lines\": [\n    {\n      \"base\": 0,\n      \"name\": \"Sales\",\n      \"order\": 0,\n      \"rate\": 6.25,\n      \"total\": 9.06\n    }\n  ],\n  \"tip\": 0,\n  \"total\": 154.06,\n  \"total_weight\": \"\",\n  \"tracking_number\": \"\",\n  \"updated\": \"2021-06-28 19:20:03\",\n  \"vat_number\": \"\",\n  \"vendor\": {\n    \"address\": \"1912 Harvest Lane\\nNew York, NY 12210\",\n    \"category\": \"Car Repair\",\n    \"email\": \"\",\n    \"fax_number\": \"\",\n    \"name\": \"East Repair\",\n    \"phone_number\": \"\",\n    \"raw_name\": \"East Repair Inc.\",\n    \"vendor_logo\": \"https://cdn.veryfi.com/logos/tmp/560806841.png\",\n    \"vendor_reg_number\": \"\",\n    \"vendor_type\": \"Car Repair\",\n    \"web\": \"\"\n  },\n  \"vendor_account_number\": \"\",\n  \"vendor_bank_name\": \"\",\n  \"vendor_bank_number\": \"\",\n  \"vendor_bank_swift\": \"\",\n  \"vendor_iban\": \"\"\n}\n```\n\n## Installation\n\n```bash\ngem install veryfi\n```\n\nOr add to your Gemfile:\n```ruby\ngem 'veryfi', '~\u003e 0.1'\n```\n\n## Getting Started\n\n### Obtaining Client ID and user keys\n\nIf 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/)\n\n### Ruby API Client Library\n\nThe **veryfi-ruby** gem can be used to communicate with Veryfi API. All available functionality is described [in docs](https://veryfi.github.io/veryfi-ruby/)\n\n## Need help?\n\nIf you run into any issue or need help installing or using the library, please contact support@veryfi.com.\n\nIf you found a bug in this library or would like new features added, then open an issue or pull requests against this repo!\n\n# For Developers\n\n## Install\n\n```bash\nbin/setup\n```\n\n## Quality tools\n\n* `bin/quality` based on [RuboCop](https://github.com/bbatsov/rubocop)\n* `.rubocop.yml` describes active checks\n\n## Develop\n\n`bin/ci` checks your specs and runs quality tools\n\n## Release\n\n1. Change version in `lib/veryfi/version.rb`\n2. Run `bundle` - this should update `Gemfile.lock`\n3. Commit changes, push to a new Github branch, and merge\n4. On Github go to `Actions` -\u003e `Release` -\u003e and click `Run workflow` to trigger a new release\n5. Release workflow will publish gem to [Rubygems](https://rubygems.org/gems/veryfi)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fveryfi%2Fveryfi-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fveryfi%2Fveryfi-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fveryfi%2Fveryfi-ruby/lists"}