Skip to main content

Transcription APIs encapsulation

Project description


ftvstt is a France Télévisions python library which encapsulates multiple online speech-to-text APIs, in order to call them as easily as possible.

It currently supports :

  • Amazon Transcribe
  • Google Cloud speech-to-text
  • Vocapia Voxsigma
  • Bertin Mediaspeech


ftvstt is not currently available through pip, you have to download the package and import it directly : ftvstt is currently available through pip by running : pip install ftvstt. You should then be able to import the package :

import ftvstt


Example of transcription through the services:

Vocapia Voxsigma:

vocapiaTranscriber = ftvstt.Vocapia("")
transcript = vocapiaTranscriber.transcribe("/path/to/file.wav")

Bertin Mediaspeech:

bertinTranscriber = ftvstt.Bertin("")
transcript = bertinTranscriber.transcribe("/path/to/file.wav")

Amazon transcribe:

amazonTranscriber = ftvstt.Amazon("AMAZON_S3_BUCKET_NAME")
amazonTranscriber.authenticate("AMAZON_AWS_ID_KEY", "AMAZON_AWS_SECRET_KEY")
transcript = amazonTranscriber.transcribe("/path/to/file.wav")

You can also authenticate directly with path to the credentials csv file:


You need an amazon AWS S3 bucket besides Amazon AWS Transcribe in order to make transcriptions.

If your file is already on a S3 bucket, use instead:

transcript = amazonTranscriber.transcribe("https://url/to/s3/file.wav", s3file=True)

Google cloud speech-to-text:

googleTranscriber = ftvstt.Google()
googleTranscriber.authenticate("GOOGLE_CLIENT_EMAIL", "GOOGLE_PIVATE_KEY")
transcript = googleTranscriber.transcribe("/path/to/file.wav")

You can also authenticate directly with path to client service credentials json file with google.


Custom vocabulary file

For every provider except Bertin, you can add a custom vocabulary file of probable words as shown :

googleTranscriber = ftvstt.Google()
transcript = googleTranscriber.transcribe("/path/to/file.wav")

The vocabulary file should be of the form:


Results handling

Once a transcription is done, the transcribe function of a Transcriber returns a Transcript instance from ftvstt.transcripts sub-module.

A Transcript instance, as transcript in previous codes, has several useful attributes :

transcript.text: a string containing the textual transcript of the audio file.
transcript.words: a list of Word instances from ftvstt.transcripts sub-module, each one has a content (str), a startTime (float), an endTime (float), a speaker (Speaker instance from ftvstt.transcripts sub-module) (and can have a confidence (float) depending on the provider used) attribute.
transcript.speakers: a list of Speaker instances from ftvstt.transcripts sub-module, each one has an id (int), (and can have a gender (str : "M" or "F") depending on the provider used).
transcript.raw: a string containing the raw result of the transcription received from the provider, which type is transcript.rawType (str : "json" or "xml").

You can also dump the results in a normalised (the same format for any provider) json file:


You can also load a transcript from a raw result file:

with open("/path/to/bertin/raw/result.xml") as file:
    raw =

transcript = ftvstt.Transcript(raw=raw, provider=ftvstt.Bertin)

Error handling

If an error has occured during transcription, a custom python Exception from the ftvstt.exceptions sub-module will be raised. The error will also be accessbile in the exception attribute of the transcript result, as you can see in this example:

googleTranscriber = ftvstt.Google()
    transcript = googleTranscriber.transcribe("/path/to/file.wav")
raise transcript.exception


Coming soon...

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

ftvstt-2.0.0.tar.gz (10.7 kB view hashes)

Uploaded source

Built Distribution

ftvstt-2.0.0-py3-none-any.whl (12.6 kB view hashes)

Uploaded py3

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