Skip to main content

Rev.ai makes speech applications easy to build!

Project description

Rev.ai Python SDK

Build Status

Documentation

See the API docs for more information about the API and more python examples.

Installation

You don't need this source code unless you want to modify the package. If you just want to use the package, just run:

pip install --upgrade rev_ai

Install from source with:

python setup.py install

Requirements

  • Python 2.7+ or Python 3.4+

Usage

All you need to get started is your Access Token, which can be generated on your Settings Page. Create a client with the given Access Token:

from rev_ai import apiclient

# create your client
client = apiclient.RevAiAPIClient("ACCESS TOKEN")

Sending a file

Once you've set up your client with your Access Token sending a file is easy!

# you can send a local file
job = client.submit_job_local_file("FILE PATH")

# or send a link to the file you want transcribed
job = client.submit_job_url("https://example.com/file-to-transcribe.mp3")

job will contain all the information normally found in a successful response from our Submit Job endpoint.

If you want to get fancy, both send job methods take metadata, callback_url, and a boolean skip_diarization as optional parameters, these are also described in the request body of the Submit Job endpoint.

Checking your file's status

You can check the status of your transcription job using its id

job_details = client.get_job_details(job.id)

job_details will contain all information normally found in a successful response from our Get Job endpoint

Checking multiple files

You can retrieve a list of transcription jobs with optional parameters

jobs = client.get_list_of_jobs()

# limit amount of retrieved jobs
jobs = client.get_list_of_jobs(limits=3)

# get jobs starting after a certain job id
jobs = client.get_list_of_jobs(starting_after='Umx5c6F7pH7r')

jobs will contain a list of job details having all information normally found in a successful response from our Get List of Jobs endpoint

Deleting a job

You can delete a transcription job using its id

client.delete_job(job.id)

All data related to the job, such as input media and transcript, will be permanently deleted. A job can only by deleted once it's completed (either with success or failure).

Getting your transcript

Once your file is transcribed, you can get your transcript in a few different forms:

# as text
transcript_text = client.get_transcript_text(job.id)

# as json
transcript_json = client.get_transcript_json(job.id)

# or as a python object
transcript_object = client.get_transcript_object(job.id)

Both the json and object forms contain all the formation outlined in the response of the Get Transcript endpoint when using the json response schema. While the text output is a string containing just the text of your transcript

======= History

0.0.0 (2018-09-28)

  • Initial alpha release

2.1.0

  • Revamped official release

2.1.1

  • File upload bug fixes

2.2.1

  • Better Documentation

2.2.2

  • Fix pypi readme formatting

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rev_ai-2.3.0.tar.gz (11.2 kB view hashes)

Uploaded Source

Built Distribution

rev_ai-2.3.0-py2.py3-none-any.whl (9.1 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page