Skip to content

Commit

Permalink
Rename src directory to tafrigh to be able to do from tafrigh import ...
Browse files Browse the repository at this point in the history
  • Loading branch information
AliOsm committed Jun 28, 2024
1 parent 9c8ef36 commit 7334bca
Show file tree
Hide file tree
Showing 24 changed files with 14 additions and 20 deletions.
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[tool.poetry]
name = "tafrigh"
version = "1.2.9"
version = "1.3.0"
description = "تفريغ النصوص وإنشاء ملفات SRT و VTT باستخدام نماذج Whisper وتقنية wit.ai."
authors = ["EasyBooks <[email protected]>"]
license = "MIT"
readme = "README.md"
packages = [{include = "src"}]
packages = [{include = "tafrigh"}]
keywords = ["tafrigh", "speech-to-text", "wit.ai", "whisper"]
classifiers = [
"Development Status :: 5 - Production/Stable",
Expand Down Expand Up @@ -38,7 +38,7 @@ whisper = ["faster-whisper", "openai-whisper", "stable-ts"]
all = ["wit", "whisper"]

[tool.poetry.scripts]
tafrigh = "src.cli:main"
tafrigh = "tafrigh.cli:main"

[tool.poetry.group.dev.dependencies]
pre-commit = "^3.7.1"
Expand All @@ -50,7 +50,7 @@ ignore = ["E121"]

[tool.isort]
line_length = 120
src_paths = ["src"]
src_paths = ["tafrigh"]
lines_between_types = 1
lines_after_imports = 2

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 0 additions & 6 deletions src/downloader.py → tafrigh/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ def _config(self, download_archive: str | bool) -> dict[str, Any]:
'ignoreerrors': True,
'download_archive': download_archive,
'playlist_items': self.playlist_items,
'postprocessors': [
{
'key': 'FFmpegExtractAudio',
'preferredcodec': 'wav',
},
],
}

def download(self, url: str, save_response: bool = False) -> dict[str, Any]:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

from tqdm import tqdm

from src.config import Config
from src.types.segment_type import SegmentType
from src.types.whisper.type_hints import WhisperModel
from tafrigh.config import Config
from tafrigh.types.segment_type import SegmentType
from tafrigh.types.whisper.type_hints import WhisperModel


class WhisperRecognizer:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
from tqdm import tqdm
from urllib3.util.retry import Retry

from src.audio_splitter import AudioSplitter
from src.config import Config
from src.recognizers.wit_calling_throttle import WitCallingThrottle, WitCallingThrottleManager
from src.types.segment_type import SegmentType
from tafrigh.audio_splitter import AudioSplitter
from tafrigh.config import Config
from tafrigh.recognizers.wit_calling_throttle import WitCallingThrottle, WitCallingThrottleManager
from tafrigh.types.segment_type import SegmentType


def init_pool(throttle: WitCallingThrottle) -> None:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/utils/cli_utils.py → tafrigh/utils/cli_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import importlib.metadata
import re

from src.types.transcript_type import TranscriptType
from tafrigh.types.transcript_type import TranscriptType


PLAYLIST_ITEMS_RE = re.compile(
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import faster_whisper
import stable_whisper

from src.config import Config
from src.types.whisper.type_hints import WhisperModel
from tafrigh.config import Config
from tafrigh.types.whisper.type_hints import WhisperModel


def load_model(whisper_config: Config.Whisper) -> WhisperModel: # type: ignore
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 7334bca

Please sign in to comment.