Registry / ai-ml / rev-ai

rev-ai

JSON →
library2.21.0pypypiunverified

The Rev AI Python SDK provides convenient access to the Rev AI Speech-to-Text APIs, enabling developers to easily integrate asynchronous and streaming speech recognition capabilities into their Python applications. It handles audio transcription for both local files and remote URLs. The library is actively maintained and receives regular updates, with the current version being 2.21.0.

pip install --upgrade rev-ai
INSTALL
IMPORT
SIG · REV-AI
R
rev-ai
ai-mlpythonv2.21.0
Install
2.3s avg
Import
625ms
Disk
20MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.21.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.673s · 22.3MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 2.3s · import 0.577s · 23MB
20MB installed
● package 20MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

RevAiAPIClient
from rev_ai import apiclient
from rev_ai.apiclient import RevAiAPIClient
RevAiAPIClient is exposed directly under `rev_ai.apiclient`, so `from rev_ai import apiclient` and then `apiclient.RevAiAPIClient` is the standard pattern.
RevAiStreamingClient
from rev_ai.streamingclient import RevAiStreamingClient
MediaConfig
from rev_ai.models import MediaConfig
RevAiApiDeployment
from rev_ai import apiclient, RevAiApiDeploymentConfigMap, RevAiApiDeployment
Used for configuring specific API deployment regions, e.g., for EU.

This quickstart demonstrates how to initialize the Rev AI client, submit a local audio file for transcription, poll for job completion, retrieve the transcript as text, and finally delete the job. Remember to replace the placeholder `AUDIO_FILE_PATH` and set your `REVAI_ACCESS_TOKEN` environment variable.

import os import time from rev_ai import apiclient REVAI_ACCESS_TOKEN = os.environ.get('REVAI_ACCESS_TOKEN', 'YOUR_REVAI_ACCESS_TOKEN') AUDIO_FILE_PATH = 'path/to/your/audio.mp3' # Replace with your audio file path if not REVAI_ACCESS_TOKEN or REVAI_ACCESS_TOKEN == 'YOUR_REVAI_ACCESS_TOKEN': print("Please set the REVAI_ACCESS_TOKEN environment variable or replace 'YOUR_REVAI_ACCESS_TOKEN' with your actual token.") exit(1) if not os.path.exists(AUDIO_FILE_PATH): print(f"Audio file not found: {AUDIO_FILE_PATH}") print("Please replace 'path/to/your/audio.mp3' with a valid audio file path.") exit(1) # Create your client client = apiclient.RevAiAPIClient(REVAI_ACCESS_TOKEN) print(f"Submitting job for: {AUDIO_FILE_PATH}") # Submit a local file for transcription job = client.submit_job_local_file(AUDIO_FILE_PATH) job_id = job.id print(f"Job submitted with ID: {job_id}") # Polling for job completion (simple example, consider webhooks for production) while True: job_details = client.get_job_details(job_id) if job_details.status == 'transcribed': print("Job transcribed successfully!") break elif job_details.status == 'failed': print(f"Job failed: {job_details.failure_detail}") exit(1) else: print(f"Job status: {job_details.status}... waiting") time.sleep(5) # Wait 5 seconds before checking again # Retrieve transcript as text transcript_text = client.get_transcript_text(job_id) print("\n--- Transcript (Text) ---") print(transcript_text[:500]) # Print first 500 characters print("...") # You can also retrieve as JSON or a Python object # transcript_json = client.get_transcript_json(job_id) # transcript_object = client.get_transcript_object(job_id) # Delete the job (optional, but good practice for cost/data management) client.delete_job(job_id) print(f"Job {job_id} deleted.")
Debug
Known issues
breakingThe `media_url` and `callback_url` parameters were deprecated in SDK version 2.16.0 in favor of `source_config` and `notification_config`. While the old parameters are still supported in the API, future SDK versions may remove support.
fix
Migrate to `source_config` for specifying audio URLs and `notification_config` for webhook callbacks. These new parameters offer enhanced security and allow for authentication headers.
affects: >=2.16.0
gotchaRev AI APIs have rate limits (e.g., 10,000 requests/10 minutes, 500 processed/10 minutes) and file size limits (2GB for multipart/form-data, 5TB via `source_config` with URL). Exceeding these limits can lead to queued jobs or API errors.
fix
Implement robust error handling and retry mechanisms with exponential backoff. For large-scale usage, consider optimizing job submission patterns or contacting Rev AI support to adjust limits.
affects: All
gotchaDifferent base URLs are used for non-US deployments. Using the incorrect base URL for your selected deployment will result in connection errors or incorrect data routing.
fix
When initializing `RevAiAPIClient`, pass the correct `url` parameter using `RevAiApiDeploymentConfigMap` and `RevAiApiDeployment` for your specific region (e.g., EU).
affects: All
gotchaPolling for job status, as shown in simple quickstarts, is inefficient for high-volume or long-running jobs. It can lead to unnecessary API calls and potential rate limiting.
fix
For production applications, use webhooks (`notification_config`) to receive asynchronous notifications when a job's status changes.
affects: All
Upgrade
Version history
2.21.0latest on PyPI · released Nov 27, 2024
Audit
Dependencies
requestsrequiredHTTP client for API communication.
Agent activity
10 hits · last 30 days
node
8
OpenAI (training)
1
Resources
rev-ai — pip install rev-ai · libregistry