Metadata-Version: 2.4
Name: visionfi-client
Version: 2025.4.21.1
Summary: Python client library for the VisionFi document analysis platform
Author: VisionFi Team
License: MIT License
        
        Copyright (c) 2024 VisionFi
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: Homepage, https://github.com/visionfi/visionfi-python
Project-URL: Bug Tracker, https://github.com/visionfi/visionfi-python/issues
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICE.txt
Requires-Dist: requests>=2.25.0
Requires-Dist: google-auth>=2.0.0
Requires-Dist: google-auth-oauthlib>=0.4.0
Requires-Dist: pydantic>=1.8.0
Dynamic: license-file

# VisionFi Python Client

A Python client library for the VisionFi document analysis platform.

> **Note:** This package is a wrapper for the VisionFi API, which is a subscription service. A valid service account is required to use this package with the VisionFi API. Contact VisionFi for subscription details and to obtain your service account credentials.

## Installation

```bash
pip install visionfi-client
```

## Basic Usage

```python
from visionfi import VisionFi
import pathlib

# Initialize client
client = VisionFi(service_account_path='./service-account.json')

# Check authentication
auth_result = client.verify_auth()
print(f"Authentication successful: {auth_result.data}")

# Get client information
client_info = client.get_client_info()
if client_info.success:
    print(f"Client name: {client_info.data.name}")
    print(f"Client status: {client_info.data.status}")

# Analyze a document
with open('document.pdf', 'rb') as f:
    file_data = f.read()

job = client.analyze_document(file_data, {
    'file_name': 'document.pdf',
    'analysis_type': 'auto_loan_abstract'
})

print(f"Analysis job created: {job.uuid}")

# Get results (with polling)
results = client.get_results(
    job.uuid,
    poll_interval=5000,  # 5 seconds
    max_attempts=30,     # Up to 2.5 minutes
    early_warning_attempts=5
)

if results.status == 'processed':
    print("Analysis processed successfully!")
    print(f"Results: {results.results}")
```

## Features

- Authentication with Google service accounts
- Document analysis submission
- Results retrieval with polling
- Client information and workflow retrieval
- Comprehensive error handling

## License

MIT

## Acknowledgments

This package includes components licensed under Apache License 2.0 and MIT License. It builds on industry-standard libraries (requests, pydantic, google-auth) with hundreds of millions of monthly downloads.

See [ACKNOWLEDGMENTS.md](ACKNOWLEDGMENTS.md) for statistics and [NOTICE.txt](NOTICE.txt) for licensing details.
