Python SDK V2 to V3 Migration Guide
Migrating from Deepgram Python SDK v2 to the Deepgram Python SDK v3
This guide is for users with experience using the Deepgram Python SDK v2 who want to migrate to the Deepgram Python SDK v3. This is not an end-to-end guide, but a reference for people using our existing Python SDK to migrate to our newest version.
Notable Changes
- Significant Restructure of the Python SDK
- Improved implementation for Live Client
- Implements both Sync(/Threaded) and Async(/Await) Classes and Functions
- Verbosity Logging Levels for Troubleshooting
- WebVTT and SRT captions published as a standalone package
- Custom Header and Query Parameters for API calls
- Support for future products (APIs)
- Better error handling
Migration Guide
This migration guide focuses primarily on the Sync/Threaded classes and methods in this SDK. The Async/Await classes and methods are very similar, where the class name will be prepended with “Async” and properties prepended with “async”.
For example, the Prerecorded Client for Sync/Threaded would be Prerecorded
and the Async/Await would be AsyncPrerecorded
.
If accessing the Pre-recorded Client from the deepgram.listen
properties, the Sync/Threaded property would be deepgram.listen.prerecorded
and the Async/Await would be deepgram.listen.asyncprerecorded
.
Installation
Initialization
Transcription: Pre-recorded
We have separated the callback
feature into its own method. The functionality below is not valid with the callback feature.
Local File Transcription
Transcribe a local file on the same filesystem as the app is running.
URL File Transcription
Transcribe a remote file by sending us a publicly accessible URL to it.
Transcription: Live
The Live Client abstracts the underlying Websocket implementation from the user. This in turn only requires that you deal with higher level functions like start()
, write()
, finish()
methods.
Live Transcription
Transcribe live audio streams. Previously only Async/Await class and methods were available. As of this release, both Sync/Threaded and Await/Await classes and methods are provided, but the prefered method of performing live transcription is Sync/Threaded.
Management API
This provides a transition guide from Async/Await to Sync/Threaded Manage APIs.
get all projects for a user
See our API reference for more info.
get a project
See our API reference for more info.
update a project
See our API reference for more info.
delete a project
See our API reference for more info.
get all project key details
See our API reference for more info.
get a project key
See our API reference for more info.
create a project key
See our API reference for more info.
delete a project key
See our API reference for more info.
get all project members
See our API reference for more info.
remove a project member
See our API reference for more info.
get all scopes for a project member
See our API reference for more info.
update a scope for a project member
See our API reference for more info.
get all project invites
See our API reference for more info.
send a project invite
See our API reference for more info.
delete a project invite
See our API reference for more info.
leave a project
See our API reference for more info.
get all usage requests for a project
See our API reference for more info.
get a usage request for a project
See our API reference for more info.
get the project usage summary
See our API reference for more info.
get project usage fields
See our API reference for more info.
get all project balances
See our API reference for more info.
get a project balance
See our API reference for more info.
Self-Hosted API
[NOTICE] The self-hosted API has not changed since the last release, but in v4
these APIs will likely go through a breaking change. There was only so much we could do with this release and unfortunately, these APIs failed to make the cut off.