Skip to main content

Wordcab Python SDK

Project description

Wordcab Python

PyPI Status Python Version License

Read the documentation at https://wordcab-python.readthedocs.io/ Tests Codecov

pre-commit Black

Wordcab

What is Wordcab?

Summarize any business communications at scale with Wordcab's API.

Wordcab is a summarization service that provides a simple API to summarize any audio, text, or JSON file.

It also includes compatibility with famous transcripts platforms like AssemblyAI, Deepgram, Rev.ai, Otter.ai, or Sonix.ai.

Getting started

You can learn more about Wordcab services and pricing on our website.

If you want to try out the API, you can signup for a free account and start using the API right away.

Requirements

  • Os: Linux, Mac, Windows
  • Python 3.8+

Installation

You can install Wordcab Python via pip from PyPI:

$ pip install wordcab

Start using the API with any python script right away!

Usage

Quick video demo

Start Summary full pipeline

import time
from wordcab import retrieve_job, retrieve_summary, start_summary
from wordcab.core_objects import AudioSource, GenericSource, InMemorySource


# Prepare your input source
## For a transcript stored as a .txt or .json file
source = GenericSource(filepath="path/to/file.txt")  # Or file.json
## For a transcript stored as an audio file
source = AudioSource(filepath="path/to/file.mp3")
## For a transcript already in memory
transcript = {"transcript": ["SPEAKER A: Hello.", "SPEAKER B: Hi."]}
source = InMemorySource(obj=transcript)

# Launch the Summarization job
job = start_summary(
	source_object=source,
	display_name="sample_txt",
	summary_type="no_speaker",
	summary_length=3,
	tags=["sample", "text"],
)

# Wait for the job completion
while True:
	job = retrieve_job(job_name=job.job_name)
	if job.job_status == "SummaryComplete":
		break
	else:
		time.sleep(3)

# Get the summary id
summary_id = job.summary_details["summary_id"]
# Retrieve the summary
summary = retrieve_summary(summary_id=summary_id)

# Get all information from the retrieved summary
for k, v in summary.__dict__.items():
    print(f"{k}: {v}")

# Get the summary as one block of text
for k, v in summary.summary:
	print(f"Summary Length: {k}")
	print(f"Summary: {v['structured_summary'].summary}")

Documentation

Please see the Documentation for more details.

Contributing

Contributions are very welcome. 🚀 To learn more, see the Contributor Guide.

License

Distributed under the terms of the Apache 2.0 license, Wordcab Python SDK is free and open source software.

Issues

If you encounter any problems, please file an issue along with a detailed description.

Credits

This project was generated from @cjolowicz's Hypermodern Python Cookiecutter template.

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

wordcab-0.4.0.tar.gz (22.0 kB view hashes)

Uploaded Source

Built Distribution

wordcab-0.4.0-py3-none-any.whl (28.9 kB view hashes)

Uploaded 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