Created
November 17, 2022 02:46
-
-
Save korakot/f1fa39642ddd4e221df0765612436d35 to your computer and use it in GitHub Desktop.
Check status of Amazon transcription jobs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
tran = boto3.client('transcribe') | |
def check_jobs(in_name): | |
jobs = [] | |
resp = tran.list_transcription_jobs(JobNameContains=in_name) | |
while True: | |
jobs += resp['TranscriptionJobSummaries'] | |
next_token = resp.get('NextToken') | |
if next_token is None: break | |
resp = tran.list_transcription_jobs( | |
JobNameContains=in_name, NextToken=next_token) | |
# print status | |
for job in jobs: | |
name = job['TranscriptionJobName'] | |
status = job['TranscriptionJobStatus'] | |
print(f"{name}: {status}") | |
#return jobs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment