Regula Document Reader WebClient
raw JSON → 9.4.829 verified Sat May 09 auth: no python
Official Python client for Regula's Document Reader API, enabling identity document authentication and data extraction. Current version 9.4.829, maintained by Regula. Release cadence follows API updates.
pip install regula-documentreader-webclient Common errors
error TypeError: ProcessingApi.__init__() got an unexpected keyword argument 'api_key' ↓
cause The parameter is named `access_token`, not `api_key`.
fix
Use
ProcessingApi(access_token='your_token') error ModuleNotFoundError: No module named 'regula' ↓
cause Package installed with hyphens but imported with underscores incorrectly, or not installed.
fix
Install:
pip install regula-documentreader-webclient. Import: from regula.documentreader.webclient.api import ProcessingApi error AttributeError: 'NoneType' object has no attribute 'status_code' ↓
cause The API returned an error response that was not handled; check the response object.
fix
Wrap API call in try/except catching
regula.documentreader.webclient.ApiException. Warnings
deprecated The synchronous client method `process` is deprecated in v9.x in favor of the asynchronous version. ↓
fix Use `async def` and `await api.process(request)` with an event loop.
gotcha The access token must be passed as `access_token` parameter, not as a header. ↓
fix Initialize `ProcessingApi(access_token='your_token')`.
gotcha The API expects images in base64 format without data URI prefix (e.g., 'data:image/png;base64,'). ↓
fix Strip any prefix before setting the base64 property.
Imports
- ProcessingApi wrong
from regula_documentreader_webclient.api import ProcessingApicorrectfrom regula.documentreader.webclient.api import ProcessingApi - ProcessingApi wrong
from regula.documentreader.webclient import ProcessingApicorrectfrom regula.documentreader.webclient import ProcessingApi - ProcessRequest
from regula.documentreader.webclient.models import ProcessRequest
Quickstart
from regula.documentreader.webclient import ProcessingApi
from regula.documentreader.webclient.models import ProcessRequest
import os
api = ProcessingApi(access_token=os.environ.get('REGULA_API_KEY', ''))
request = ProcessRequest(base64="base64_image_data")
response = api.process(request)
print(response)