modusa 0.4.23__tar.gz → 0.4.26__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {modusa-0.4.23 → modusa-0.4.26}/PKG-INFO +2 -1
- {modusa-0.4.23 → modusa-0.4.26}/pyproject.toml +20 -1
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/__init__.py +1 -1
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/tools/audio_loader.py +10 -3
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/tools/plotter.py +1 -1
- modusa-0.4.23/src/modusa/.DS_Store +0 -0
- modusa-0.4.23/tests/.DS_Store +0 -0
- modusa-0.4.23/tests/__init__.py +0 -0
- modusa-0.4.23/tests/test_load.py +0 -158
- modusa-0.4.23/tests/testdata/.DS_Store +0 -0
- modusa-0.4.23/tests/testdata/audio-formats/sample.aac +0 -0
- modusa-0.4.23/tests/testdata/audio-formats/sample.aiff +0 -0
- modusa-0.4.23/tests/testdata/audio-formats/sample.flac +0 -0
- modusa-0.4.23/tests/testdata/audio-formats/sample.m4a +0 -0
- modusa-0.4.23/tests/testdata/audio-formats/sample.mp3 +0 -0
- modusa-0.4.23/tests/testdata/audio-formats/sample.opus +0 -0
- modusa-0.4.23/tests/testdata/audio-formats/sample.wav +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/LICENSE.md +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/README.md +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/config.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/decorators.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/devtools/generate_docs_source.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/devtools/generate_template.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/devtools/list_authors.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/devtools/list_plugins.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/devtools/main.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/devtools/templates/generator.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/devtools/templates/io.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/devtools/templates/model.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/devtools/templates/plugin.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/devtools/templates/test.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/devtools/templates/tool.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/fonts/NotoSansDevanagari-Regular.ttf +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/generators/__init__.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/generators/audio.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/generators/audio_waveforms.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/generators/base.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/generators/ftds.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/generators/s1d.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/generators/s2d.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/generators/s_ax.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/generators/t_ax.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/generators/tds.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/images/icon.png +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/models/__init__.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/models/audio.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/models/base.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/models/data.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/models/ftds.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/models/s1d.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/models/s2d.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/models/s_ax.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/models/t_ax.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/models/tds.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/plugins/__init__.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/plugins/base.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/tools/__init__.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/tools/_plotter_old.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/tools/ann_loader.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/tools/audio_converter.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/tools/audio_player.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/tools/audio_recorder.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/tools/audio_saver.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/tools/base.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/tools/math_ops.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/tools/youtube_downloader.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/utils/__init__.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/utils/config.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/utils/excp.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/utils/logger.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/utils/np_func_cat.py +0 -0
- {modusa-0.4.23 → modusa-0.4.26}/src/modusa/utils/plot.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: modusa
|
3
|
-
Version: 0.4.
|
3
|
+
Version: 0.4.26
|
4
4
|
Summary: A modular signal analysis python library.
|
5
5
|
Author-Email: Ankit Anand <ankit0.anand0@gmail.com>
|
6
6
|
License: MIT
|
@@ -9,6 +9,7 @@ Requires-Dist: numpy>=2.2.6
|
|
9
9
|
Requires-Dist: matplotlib>=3.10.3
|
10
10
|
Requires-Dist: yt-dlp==2025.9.23
|
11
11
|
Requires-Dist: IPython>=9.5.0
|
12
|
+
Requires-Dist: sounddevice>=0.5.2
|
12
13
|
Requires-Dist: ipywidgets>=8.1.7
|
13
14
|
Requires-Dist: imageio-ffmpeg>=0.6.0
|
14
15
|
Description-Content-Type: text/markdown
|
@@ -10,12 +10,13 @@ dependencies = [
|
|
10
10
|
"matplotlib>=3.10.3",
|
11
11
|
"yt-dlp==2025.9.23",
|
12
12
|
"IPython>=9.5.0",
|
13
|
+
"sounddevice>=0.5.2",
|
13
14
|
"ipywidgets>=8.1.7",
|
14
15
|
"imageio-ffmpeg>=0.6.0",
|
15
16
|
]
|
16
17
|
requires-python = ">=3.11"
|
17
18
|
readme = "README.md"
|
18
|
-
version = "0.4.
|
19
|
+
version = "0.4.26"
|
19
20
|
|
20
21
|
[project.license]
|
21
22
|
text = "MIT"
|
@@ -59,6 +60,24 @@ misc = [
|
|
59
60
|
[tool.pdm.package-dir]
|
60
61
|
"" = "src"
|
61
62
|
|
63
|
+
[tool.pdm.build]
|
64
|
+
includes = [
|
65
|
+
"src",
|
66
|
+
"README.md",
|
67
|
+
"LICENSE.md",
|
68
|
+
"pyproject.toml",
|
69
|
+
]
|
70
|
+
excludes = [
|
71
|
+
"tests/**",
|
72
|
+
"**/.DS_Store",
|
73
|
+
"__pycache__/**",
|
74
|
+
"*.pyc",
|
75
|
+
"dist",
|
76
|
+
"build",
|
77
|
+
".venv",
|
78
|
+
".git",
|
79
|
+
]
|
80
|
+
|
62
81
|
[build-system]
|
63
82
|
requires = [
|
64
83
|
"pdm-backend",
|
@@ -99,12 +99,19 @@ def load(path, sr=None, trim=None, ch=None):
|
|
99
99
|
File name stem.
|
100
100
|
"""
|
101
101
|
path = Path(path)
|
102
|
-
ffmpeg_exe = ffmpeg.get_ffmpeg_exe()
|
103
|
-
|
104
|
-
yt = False # Is the path a youtube URL
|
105
102
|
|
103
|
+
# If the path is a YouTube URL, turn on the yt flag
|
104
|
+
yt = False # By default, set to false
|
106
105
|
if ".youtube" in str(path):
|
107
106
|
yt = True
|
107
|
+
|
108
|
+
# For local files, check if the audio exists
|
109
|
+
elif not path.exists():
|
110
|
+
raise FileExistsError(f"{path} does not exist")
|
111
|
+
|
112
|
+
ffmpeg_exe = ffmpeg.get_ffmpeg_exe()
|
113
|
+
|
114
|
+
if yt:
|
108
115
|
try:
|
109
116
|
path: Path = _load_audio_from_youtube(url=str(path))
|
110
117
|
except Exception as e:
|
@@ -31,7 +31,7 @@ def _load_devanagari_font():
|
|
31
31
|
hindi_font = fm.FontProperties(fname=str(font_path))
|
32
32
|
|
33
33
|
# Set as default rcParam
|
34
|
-
mpl.rcParams['font.family'] = hindi_font.get_name()
|
34
|
+
mpl.rcParams['font.family'] = [hindi_font.get_name(), 'DejaVu Sans'] # Fallback to DejaVu Sans
|
35
35
|
|
36
36
|
#==============
|
37
37
|
|
Binary file
|
modusa-0.4.23/tests/.DS_Store
DELETED
Binary file
|
modusa-0.4.23/tests/__init__.py
DELETED
File without changes
|
modusa-0.4.23/tests/test_load.py
DELETED
@@ -1,158 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python3
|
2
|
-
|
3
|
-
#---------------------------------
|
4
|
-
# Author: Ankit Anand
|
5
|
-
# Date: 21/10/25
|
6
|
-
# Email: ankit0.anand0@gmail.com
|
7
|
-
#---------------------------------
|
8
|
-
|
9
|
-
import pytest
|
10
|
-
import modusa as ms
|
11
|
-
from pathlib import Path
|
12
|
-
|
13
|
-
|
14
|
-
#----------------------------------
|
15
|
-
# Loading different audio formats
|
16
|
-
#----------------------------------
|
17
|
-
this_dir = Path(__file__).parents[0].resolve()
|
18
|
-
def test_load_aac():
|
19
|
-
y, sr, title = ms.load(this_dir / "testdata/audio-formats/sample.aac")
|
20
|
-
assert title == "sample"
|
21
|
-
|
22
|
-
def test_load_aiff():
|
23
|
-
y, sr, title = ms.load(this_dir / "testdata/audio-formats/sample.aiff")
|
24
|
-
assert title == "sample"
|
25
|
-
|
26
|
-
def test_load_flac():
|
27
|
-
y, sr, title = ms.load(this_dir / "testdata/audio-formats/sample.flac")
|
28
|
-
assert title == "sample"
|
29
|
-
|
30
|
-
def test_load_m4a():
|
31
|
-
y, sr, title = ms.load(this_dir / "testdata/audio-formats/sample.m4a")
|
32
|
-
assert title == "sample"
|
33
|
-
|
34
|
-
def test_load_mp3():
|
35
|
-
y, sr, title = ms.load(this_dir / "testdata/audio-formats/sample.mp3")
|
36
|
-
assert title == "sample"
|
37
|
-
|
38
|
-
def test_load_opus():
|
39
|
-
y, sr, title = ms.load(this_dir / "testdata/audio-formats/sample.opus")
|
40
|
-
assert title == "sample"
|
41
|
-
|
42
|
-
def test_load_wav():
|
43
|
-
y, sr, title = ms.load(this_dir / "testdata/audio-formats/sample.wav")
|
44
|
-
assert title == "sample"
|
45
|
-
|
46
|
-
#----------------------------------
|
47
|
-
# Resampe feature
|
48
|
-
#----------------------------------
|
49
|
-
SR = 16000 # Hz
|
50
|
-
def test_load_with_resample_aac():
|
51
|
-
y, sr, title = ms.load(this_dir / "testdata/audio-formats/sample.aac", sr=SR)
|
52
|
-
assert sr == SR
|
53
|
-
assert title == "sample"
|
54
|
-
|
55
|
-
def test_load_with_resample_aiff():
|
56
|
-
y, sr, title = ms.load(this_dir / "testdata/audio-formats/sample.aiff", sr=SR)
|
57
|
-
assert sr == SR
|
58
|
-
assert title == "sample"
|
59
|
-
|
60
|
-
def test_load_with_resample_flac():
|
61
|
-
y, sr, title = ms.load(this_dir / "testdata/audio-formats/sample.flac", sr=SR)
|
62
|
-
assert sr == SR
|
63
|
-
assert title == "sample"
|
64
|
-
|
65
|
-
def test_load_with_resample_m4a():
|
66
|
-
y, sr, title = ms.load(this_dir / "testdata/audio-formats/sample.m4a", sr=SR)
|
67
|
-
assert sr == SR
|
68
|
-
assert title == "sample"
|
69
|
-
|
70
|
-
def test_load_with_resample_mp3():
|
71
|
-
y, sr, title = ms.load(this_dir / "testdata/audio-formats/sample.mp3", sr=SR)
|
72
|
-
assert sr == SR
|
73
|
-
assert title == "sample"
|
74
|
-
|
75
|
-
def test_load_with_resample_opus():
|
76
|
-
y, sr, title = ms.load(this_dir / "testdata/audio-formats/sample.opus", sr=SR)
|
77
|
-
assert sr == SR
|
78
|
-
assert title == "sample"
|
79
|
-
|
80
|
-
def test_load_with_resample_wav():
|
81
|
-
y, sr, title = ms.load(this_dir / "testdata/audio-formats/sample.wav", sr=SR)
|
82
|
-
assert sr == SR
|
83
|
-
assert title == "sample"
|
84
|
-
|
85
|
-
#----------------------------------
|
86
|
-
# Trim feature
|
87
|
-
#----------------------------------
|
88
|
-
def test_load_with_trim_aac():
|
89
|
-
y, sr, title = ms.load(this_dir / "testdata/audio-formats/sample.aac", trim=(0, 5.3))
|
90
|
-
assert title == "sample"
|
91
|
-
|
92
|
-
def test_load_with_trim_aiff():
|
93
|
-
y, sr, title = ms.load(this_dir / "testdata/audio-formats/sample.aiff", trim=(0, 5.3))
|
94
|
-
assert title == "sample"
|
95
|
-
|
96
|
-
def test_load_with_trim_flac():
|
97
|
-
y, sr, title = ms.load(this_dir / "testdata/audio-formats/sample.flac", trim=(0, 5.3))
|
98
|
-
assert title == "sample"
|
99
|
-
|
100
|
-
def test_load_with_trim_m4a():
|
101
|
-
y, sr, title = ms.load(this_dir / "testdata/audio-formats/sample.m4a", trim=(0, 5.3))
|
102
|
-
assert title == "sample"
|
103
|
-
|
104
|
-
def test_load_with_trim_mp3():
|
105
|
-
y, sr, title = ms.load(this_dir / "testdata/audio-formats/sample.mp3", trim=(0, 5.3))
|
106
|
-
assert title == "sample"
|
107
|
-
|
108
|
-
def test_load_with_trim_opus():
|
109
|
-
y, sr, title = ms.load(this_dir / "testdata/audio-formats/sample.opus", trim=(0, 5.3))
|
110
|
-
assert title == "sample"
|
111
|
-
|
112
|
-
def test_load_with_trim_wav():
|
113
|
-
y, sr, title = ms.load(this_dir / "testdata/audio-formats/sample.wav", trim=(0, 5.3))
|
114
|
-
assert title == "sample"
|
115
|
-
|
116
|
-
#----------------------------------
|
117
|
-
# Mono feature
|
118
|
-
#----------------------------------
|
119
|
-
def test_load_in_stereo_aac():
|
120
|
-
y, sr, title = ms.load(this_dir / "testdata/audio-formats/sample.aac", ch=2)
|
121
|
-
assert y.ndim == 2
|
122
|
-
assert title == "sample"
|
123
|
-
|
124
|
-
def test_load_in_stereo_aiff():
|
125
|
-
y, sr, title = ms.load(this_dir / "testdata/audio-formats/sample.aiff", ch=2)
|
126
|
-
assert y.ndim == 2
|
127
|
-
assert title == "sample"
|
128
|
-
|
129
|
-
def test_load_in_stereo_flac():
|
130
|
-
y, sr, title = ms.load(this_dir / "testdata/audio-formats/sample.flac", ch=2)
|
131
|
-
assert y.ndim == 2
|
132
|
-
assert title == "sample"
|
133
|
-
|
134
|
-
def test_load_in_stereo_m4a():
|
135
|
-
y, sr, title = ms.load(this_dir / "testdata/audio-formats/sample.m4a", ch=2)
|
136
|
-
assert y.ndim == 2
|
137
|
-
assert title == "sample"
|
138
|
-
|
139
|
-
def test_load_in_stereo_mp3():
|
140
|
-
y, sr, title = ms.load(this_dir / "testdata/audio-formats/sample.mp3", ch=2)
|
141
|
-
assert y.ndim == 2
|
142
|
-
assert title == "sample"
|
143
|
-
|
144
|
-
def test_load_in_stereo_opus():
|
145
|
-
y, sr, title = ms.load(this_dir / "testdata/audio-formats/sample.opus", ch=2)
|
146
|
-
assert y.ndim == 2
|
147
|
-
assert title == "sample"
|
148
|
-
|
149
|
-
def test_load_in_stereo_wav():
|
150
|
-
y, sr, title = ms.load(this_dir / "testdata/audio-formats/sample.wav", ch=2)
|
151
|
-
assert y.ndim == 2
|
152
|
-
assert title == "sample"
|
153
|
-
|
154
|
-
#----------------------------------
|
155
|
-
# Load from YouTube
|
156
|
-
#----------------------------------
|
157
|
-
def test_load_youtube_1():
|
158
|
-
y, sr, title = ms.load("https://www.youtube.com/watch?v=DIU_vmElPkU", ch=1)
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|