Skip to content

Commit 8b3a173

Browse files
Merge pull request #8 from deepgram/sr/imports
add imports to init file
2 parents 570b102 + a761ddf commit 8b3a173

File tree

8 files changed

+24
-17
lines changed

8 files changed

+24
-17
lines changed

README.md

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Deepgram Python Captions
22

3-
[![Discord](https://dcbadge.vercel.app/api/server/xWRaCDBtW4?style=flat)](https://discord.gg/xWRaCDBtW4) [![PyPI version](https://badge.fury.io/py/deepgram-captions.svg)](https://badge.fury.io/py/deepgram-captions)
3+
[![Discord](https://dcbadge.vercel.app/api/server/xWRaCDBtW4?style=flat)](https://discord.gg/xWRaCDBtW4) [![PyPI version](https://badge.fury.io/py/deepgram-captions.svg)](https://badge.fury.io/py/deepgram-captions)
44

55
This package is the Python implementation of Deepgram's WebVTT and SRT formatting. Given a transcription, this package can return a valid string to store as WebVTT or SRT caption files.
66

@@ -13,8 +13,7 @@ pip install deepgram-captions
1313
## WebVTT from Deepgram Transcriptions
1414

1515
```python
16-
from deepgram_captions.converters import DeepgramConverter
17-
from deepgram_captions.webvtt import webvtt
16+
from deepgram_captions import DeepgramConverter, webvtt
1817

1918
transcription = DeepgramConverter(dg_response)
2019
captions = webvtt(transcription)
@@ -23,8 +22,7 @@ captions = webvtt(transcription)
2322
## SRT from Deepgram Transcriptions
2423

2524
```py
26-
from deepgram_captions.converters import DeepgramConverter
27-
from deepgram_captions.srt import srt
25+
from deepgram_captions import DeepgramConverter, srt
2826

2927
transcription = DeepgramConverter(dg_response)
3028
captions = srt(transcription)
@@ -35,8 +33,7 @@ captions = srt(transcription)
3533
### Whisper Timestamped
3634

3735
```py
38-
from deepgram_captions.converters import WhisperTimestampedConverter
39-
from deepgram_captions.webvtt import webvtt
36+
from deepgram_captions import WhisperTimestampedConverter, webvtt
4037

4138
transcription = WhisperTimestampedConverter(whisper_response)
4239
captions = webvtt(transcription)
@@ -47,8 +44,7 @@ captions = webvtt(transcription)
4744
### Assembly AI
4845

4946
```py
50-
from deepgram_captions.converters import AssemblyAIConverter
51-
from deepgram_captions.webvtt import webvtt
47+
from deepgram_captions import AssemblyAIConverter, webvtt
5248

5349
transcription = AssemblyAIConverter(assembly_response)
5450
captions = webvtt(transcription)
@@ -115,8 +111,7 @@ have today.
115111
When transcribing https://dpgr.am/spacewalk.wav, and running it through our library, this is the SRT output.
116112

117113
```py
118-
from deepgram_captions.converters import DeepgramConverter
119-
from deepgram_captions.srt import srt
114+
from deepgram_captions import DeepgramConverter, srt
120115

121116
transcription = DeepgramConverter(dg_response)
122117
captions = srt(transcription)

deepgram_captions/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from .converters import (
2+
DeepgramConverter,
3+
AssemblyAIConverter,
4+
WhisperTimestampedConverter,
5+
)
6+
from .srt import srt
7+
from .webvtt import webvtt
175 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

deepgram_captions/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.0.0'
1+
__version__ = "0.0.0"

example.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
from deepgram_captions.srt import srt
2-
from deepgram_captions.webvtt import webvtt
3-
from deepgram_captions.converters import (
4-
AssemblyAIConverter,
1+
from deepgram_captions import (
2+
srt,
3+
webvtt,
54
DeepgramConverter,
5+
AssemblyAIConverter,
66
WhisperTimestampedConverter,
77
)
88
import json

setup.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@
44
with open("README.md", "r", encoding="utf-8") as fh:
55
LONG_DESCRIPTION = fh.read()
66

7-
with open(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'deepgram_captions', '_version.py'), encoding="utf8") as file:
7+
with open(
8+
os.path.join(
9+
os.path.abspath(os.path.dirname(__file__)), "deepgram_captions", "_version.py"
10+
),
11+
encoding="utf8",
12+
) as file:
813
exec(file.read())
914
# imports as __version__
1015

0 commit comments

Comments
 (0)