Python SDK
This guide documents all the functionality available in the Deepgram Python SDK, and explains in detail how the library works. All the official Deepgram SDKs are open source. To learn more about this SDK specifically, visit
the Python SDK repository on GitHub.
Notebook
Prefer the workflow of a Python notebook? Download our Python starter notebook and be up and running quickly without having to copy or paste any code.
Python Version
Currently, the Deepgram Python SDK supports Python 3.7 and higher.
Pre-requisites
Before using the Python SDK, you'll need to do a few things.
Create a Deepgram Account
Before you can use Deepgram products, you'll need to create a Deepgram account. Signup is free and includes:
$200 in credit, which gives you access to:
- all base models
- pre-recorded and streaming functionality
- all features
Create a Deepgram API Key
To access Deepgram’s API, you'll need to create a Deepgram API Key. Make note of your API Key; you will need it later.
Installation
You can install the Deepgram Python SDK as a dependency in your application using pip
. Using a virtual environment is recommended when installing packages in Python instead of a global installation. You can learn more about how to do that in this article.
Here's how to install Deepgram with pip
:
pip install deepgram-sdk
Next you should import the Deepgram client in your application code:
from deepgram import Deepgram
Initialization
Once the SDK is installed and imported, you'll want to create a single instance of the Deepgram client. You should specify your API key here so that your application will be authorized to connect to Deepgram.
dg_client = Deepgram(DEEPGRAM_API_KEY)
With the Deepgram client initialized, you can now send requests to the Deepgram API to transcribe audio, manage projects & keys, and retrieve usage information.
Updated 12 days ago