The Reducto Python SDK provides a type-safe interface for convenient access to the Reducto REST API from any Python 3.9+ application. It handles authentication, request formatting, and response parsing automatically. The library is currently at version 0.22.0 and has a frequent release cadence, with multiple updates often occurring within a single month.
pip install reductoaiVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize the `Reducto` client, upload a local file, and then parse its content. It assumes your Reducto API key is set as an environment variable `REDUCTO_API_KEY`. A dummy file is created for demonstration purposes and then cleaned up.
Update your file upload calls to pass `pathlib.Path('your_file.pdf')`, `open('your_file.pdf', 'rb').read()`, or `('filename.pdf', b'content', 'application/pdf')` instead of just the string path.Re-upload the file if you need to process it again after 24 hours, or implement a mechanism to manage `file_id` lifecycles if persistent storage is required.
For large files, refer to the Reducto documentation on 'Presigned URL Upload' to handle the upload process correctly.
Always set the `REDUCTO_API_KEY` environment variable or explicitly pass `api_key='YOUR_KEY'` when initializing the `Reducto` client.
Install with `pip install reductoai[aiohttp]` and then initialize `AsyncReducto` with `http_client=DefaultAioHttpClient()` if `aiohttp` is desired.
pip install reductoai
from reducto import Client
client = Client(api_key="YOUR_API_KEY")
Verify your Reducto API key is correct and active. Ensure it is correctly passed to the `Client` constructor or set as the `REDUCTO_API_KEY` environment variable.