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
muslpy 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.673s · 22.3MB
glibcpy 3.10–3.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.")
Upgrade
Version history
2.21.0latest on PyPI · released Nov 27, 2024
Audit
Dependencies
requestsrequiredHTTP client for API communication.