The Mindee Ruby Client Library continues to evolve, and our latest release—Version 4—is here to simplify your integration experience while boosting stability and functionality!
The Ruby Client Library acts as a full deserializer, converting API responses into easily manageable formats for your Ruby applications, as well as a toolset to make the parsing of documents easier.
With this tool, you'll handle well-structured data ready for immediate use, so you can focus on building your application rather than worrying about type handling.
What’s New in Version 4?
Enhanced Compatibility and Development Features
- Ruby 3.4 Support: We've expanded our compatibility to include Ruby 3.4, ensuring that your projects can benefit from the latest language improvements.
- Full Typing with RBS: Our integration of full typing support via RBS enhances code reliability and helps catch potential issues early.
- Bug Fixes: Several bugs, such as imprecise handling of server errors or unintuitive saving mechanisms, have been addressed to improve overall stability, so you can trust the SDK to perform consistently in your production environments.
Simplified API Integration
- Unified Syntax for All APIs: The previous parse() and enqueue_and_parse() method has been consolidated into a single, more intuitive parse() method. This change streamlines how you interact with our APIs, reducing the learning curve and making integration smoother.
- Universal Custom API Class: We now offer a product-agnostic Universal class that replaces the older CustomV1 and GeneratedV1 classes, making custom API interactions more straightforward than ever.
Improved Developer Experience
- Enhanced Logging: Detailed logging has been added throughout the library, as well as the ability to use your own custom logging tool. This provides better visibility into operations, making it easier to trace and debug issues.
- Refined Error Management: We’ve refactored error handling and introduced customized errors to simplify troubleshooting.
- Advanced Data Extraction: For supported APIs, you can now extract full_text_ocr at the page level, expanding the range of data you can harness from your documents.
- Image Compression: In case you are dealing with heavy files, we added a tool which allows you to compress the size of your images without having to implement the code yourself or adding external dependencies.
Quick Start Example
If you're just getting started with the Ruby Client Library, check out our introduction and getting started guides.
To give you an immediate feel for the new version, here’s a quick snippet that extracts the billing address from the second page of an invoice using our FinancialDocument API:
require 'mindee'
# Initialize a new client
mindee_client = Mindee::Client.new(api_key: 'my-api-key') # Replace with your own API key!
# Load a file from disk
input_source = mindee_client.source_from_path('/path/to/my/invoice.pdf') # Replace with your document path
# Parse the file
result = mindee_client.parse(
input_source,
Mindee::Product::FinancialDocument::FinancialDocumentV1
)
# Print the billing address from page 2
puts result.document.inference.pages[1].prediction.billing_address
Migration Guide from v3 to v4
For those upgrading from Version 3, the key change is the deprecation of the enqueue_and_parse() method. In Version 4, the parse() method now handles both synchronous API calls and polling in one go.
For example, if you previously wrote:
result = mindee_client.enqueue_and_parse(
input_source,
Mindee::Product::InternationalId::InternationalIdV2
)
Now, simply update it to:
result = mindee_client.parse(
input_source,
Mindee::Product::InternationalId::InternationalIdV2
)
Should you wish to implement custom polling strategies or utilize webhooks, the enqueue() and parse_queued() methods are still available.
With these improvements, Version 4.0 of the Mindee Ruby SDK is set to offer an even smoother, more robust integration experience.
We invite you to download the new version and explore the enhanced features for yourself!
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere. uis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.