Client#
The client object is the main interface to the API. You can use it to access all API endpoints.
from wordcab import Client
client = Client()
stats = client.get_stats()
# Run with a context manager
with Client() as client:
stats = client.get_stats()
# Run with a context manager and a custom API key
with Client(api_key="my_api_key") as client:
stats = client.get_stats()
- class wordcab.Client(api_key=None)#
Wordcab API Client.
- Parameters:
api_key (str | None) –
- change_speaker_labels(transcript_id, speaker_map)#
Change the speaker labels of a transcript.
- Parameters:
transcript_id (str) –
speaker_map (Dict[str, str]) –
- Return type:
- delete_job(job_name, warning=True)#
Delete a job.
- Parameters:
job_name (str) –
warning (bool) –
- Return type:
Dict[str, str]
- get_stats(min_created=None, max_created=None, tags=None)#
Get the stats of the account.
- Parameters:
min_created (str | None) –
max_created (str | None) –
tags (List[str] | None) –
- Return type:
- list_jobs(page_size=100, page_number=None, order_by='-time_started')#
List all jobs.
- Parameters:
page_size (int | None) –
page_number (int | None) –
order_by (str | None) –
- Return type:
- list_summaries(page_size=100, page_number=None)#
List all summaries.
- Parameters:
page_size (int | None) –
page_number (int | None) –
- Return type:
- list_transcripts(page_size=100, page_number=None)#
List all transcripts.
- Parameters:
page_size (int | None) –
page_number (int | None) –
- Return type:
- request(method, **kwargs)#
Make a request to the Wordcab API.
- Parameters:
method (str) –
kwargs (bool | int | str | Dict[str, str] | List[int] | List[str]) –
- Return type:
BaseSource | BaseSummary | BaseTranscript | ExtractJob | ListJobs | ListSummaries | ListTranscripts | Stats | SummarizeJob
- retrieve_job(job_name)#
Retrieve a job.
- Parameters:
job_name (str) –
- Return type:
- retrieve_summary(summary_id)#
Retrieve a summary.
- Parameters:
summary_id (str) –
- Return type:
- retrieve_transcript(transcript_id)#
Retrieve a transcript.
- Parameters:
transcript_id (str) –
- Return type:
- start_extract(source_object, display_name, ephemeral_data=False, only_api=True, pipelines=['questions_answers', 'topic_segments', 'emotions', 'speaker_talk_ratios'], split_long_utterances=False, tags=None)#
Start an Extraction job.
- Parameters:
source_object (BaseSource | InMemorySource | WordcabTranscriptSource) –
display_name (str) –
ephemeral_data (bool | None) –
only_api (bool | None) –
pipelines (str | List[str]) –
split_long_utterances (bool | None) –
tags (str | List[str] | None) –
- Return type:
- start_summary(source_object, display_name, summary_type, context=None, ephemeral_data=False, only_api=True, pipelines=['transcribe', 'summarize'], source_lang=None, split_long_utterances=False, summary_lens=None, target_lang=None, tags=None)#
Start a Summary job.
- Parameters:
source_object (BaseSource | InMemorySource | WordcabTranscriptSource) –
display_name (str) –
summary_type (str) –
context (str | List[str] | None) –
ephemeral_data (bool | None) –
only_api (bool | None) –
pipelines (str | List[str]) –
source_lang (str | None) –
split_long_utterances (bool | None) –
summary_lens (int | List[int] | None) –
target_lang (str | None) –
tags (str | List[str] | None) –
- Return type: