Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure Python v3 (Part 5) - Rename Files to Remove Redundancy #175

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions deepgram/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
__version__ = '0.0.0'

# entry point for the deepgram python sdk
from .deepgram_client import DeepgramClient
from .deepgram_client_options import DeepgramClientOptions
from .client import DeepgramClient
from .options import DeepgramClientOptions
from .errors import DeepgramError, DeepgramApiError, DeepgramUnknownApiError, DeepgramUnknownError

# live
from .clients.live.transcription_options import LiveOptions
from .clients.live.options import LiveOptions
from .clients.live.enums import LiveTranscriptionEvents

# prerecorded
from .clients.prerecorded.transcription_options import PrerecordedOptions
from .clients.prerecorded.options import PrerecordedOptions

# manage
from .clients.manage.manage_client import ManageClient
from .clients.manage.client import ManageClient
6 changes: 3 additions & 3 deletions deepgram/deepgram_client.py → deepgram/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
from urllib.parse import urlparse, urlunparse, parse_qs, urlencode
from typing import Optional

from .deepgram_client_options import DeepgramClientOptions
from .options import DeepgramClientOptions
from .errors import DeepgramError

from .clients.listen import ListenClient
from .clients.manage.manage_client import ManageClient
from .clients.onprem.onprem_client import OnPremClient
from .clients.manage.client import ManageClient
from .clients.onprem.client import OnPremClient

class DeepgramClient:
"""
Expand Down
4 changes: 2 additions & 2 deletions deepgram/clients/listen.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from .prerecorded.prerecorded_client import PreRecordedClient
from .live.live_client import LiveClient
from .prerecorded.client import PreRecordedClient
from .live.client import LiveClient
from typing import Dict, Any, Optional


Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from .management import Project, ProjectsResponse, Message, ProjectOptions, KeysResponse, Key, KeyOptions, CreateKeyResponse, MembersResponse, ScopesResponse, ScopeOptions, InvitesResponse, InviteOptions, UsageRequestsResponse, UsageRequestOptions, UsageRequest, UsageSummaryOptions, UsageSummaryResponse, UsageFieldsResponse, UsageFieldsOptions, BalancesResponse, Balance
from .response import Project, ProjectsResponse, Message, ProjectOptions, KeysResponse, Key, KeyOptions, CreateKeyResponse, MembersResponse, ScopesResponse, ScopeOptions, InvitesResponse, InviteOptions, UsageRequestsResponse, UsageRequestOptions, UsageRequest, UsageSummaryOptions, UsageSummaryResponse, UsageFieldsResponse, UsageFieldsOptions, BalancesResponse, Balance

from ..abstract_restful_client import AbstractRestfulClient
from ..abstract_client import AbstractRestfulClient

class ManageClient(AbstractRestfulClient):
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ..abstract_restful_client import AbstractRestfulClient
from ..abstract_client import AbstractRestfulClient

class OnPremClient(AbstractRestfulClient):
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from ...errors import DeepgramError
from ..abstract_restful_client import AbstractRestfulClient
from ..abstract_client import AbstractRestfulClient

from .helpers import is_buffer_source, is_readstream_source, is_url_source
from .prerecorded_source import UrlSource, FileSource
from .transcription_options import PrerecordedOptions
from .prerecorded_response import AsyncPrerecordedResponse, SyncPrerecordedResponse
from .source import UrlSource, FileSource
from .options import PrerecordedOptions
from .response import AsyncPrerecordedResponse, SyncPrerecordedResponse

class PreRecordedClient(AbstractRestfulClient):
"""
Expand Down
2 changes: 1 addition & 1 deletion deepgram/clients/prerecorded/helpers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .prerecorded_source import PrerecordedSource
from .source import PrerecordedSource

def is_buffer_source(provided_source: PrerecordedSource) -> bool:
return "buffer" in provided_source
Expand Down
File renamed without changes.
4 changes: 3 additions & 1 deletion examples/demo_manage.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import asyncio
import os
from deepgram import DeepgramClient
from dotenv import load_dotenv

from deepgram import DeepgramClient

load_dotenv()

API_KEY = os.getenv('DG_API_KEY_MANAGE')
Expand Down
4 changes: 3 additions & 1 deletion examples/demo_prerecorded.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from deepgram import DeepgramClient, PrerecordedOptions
import asyncio
import os
from dotenv import load_dotenv

from deepgram import DeepgramClient, PrerecordedOptions

load_dotenv()

API_KEY = os.getenv('DG_API_KEY')
Expand Down