modusa 0.3.41__tar.gz → 0.3.42__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.3.41 → modusa-0.3.42}/PKG-INFO +2 -1
- {modusa-0.3.41 → modusa-0.3.42}/pyproject.toml +2 -1
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/__init__.py +1 -1
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/tools/__init__.py +2 -1
- modusa-0.3.42/src/modusa/tools/audio_recorder.py +115 -0
- {modusa-0.3.41 → modusa-0.3.42}/LICENSE.md +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/README.md +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/.DS_Store +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/config.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/decorators.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/devtools/generate_docs_source.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/devtools/generate_template.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/devtools/list_authors.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/devtools/list_plugins.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/devtools/main.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/devtools/templates/generator.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/devtools/templates/io.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/devtools/templates/model.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/devtools/templates/plugin.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/devtools/templates/test.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/devtools/templates/tool.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/fonts/NotoSansDevanagari-Regular.ttf +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/generators/__init__.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/generators/audio.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/generators/audio_waveforms.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/generators/base.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/generators/ftds.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/generators/s1d.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/generators/s2d.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/generators/s_ax.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/generators/t_ax.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/generators/tds.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/models/__init__.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/models/__pycache__/signal1D.cpython-312.pyc.4443461152 +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/models/audio.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/models/base.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/models/data.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/models/ftds.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/models/s1d.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/models/s2d.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/models/s_ax.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/models/t_ax.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/models/tds.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/plugins/__init__.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/plugins/base.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/tools/ann_loader.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/tools/audio_converter.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/tools/audio_loader.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/tools/audio_player.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/tools/base.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/tools/math_ops.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/tools/plotter.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/tools/youtube_downloader.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/utils/.DS_Store +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/utils/__init__.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/utils/config.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/utils/excp.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/utils/logger.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/utils/np_func_cat.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/src/modusa/utils/plot.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/tests/__init__.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/tests/data/song1.mp3 +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/tests/data/song1.wav +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/tests/test_generators/audio_waveform.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/tests/test_generators/test_audio.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/tests/test_generators/test_ftds.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/tests/test_generators/test_s1d.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/tests/test_generators/test_s2d.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/tests/test_generators/test_s_ax.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/tests/test_generators/test_signal.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/tests/test_generators/test_signal_generator.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/tests/test_generators/test_t_ax.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/tests/test_generators/test_tds.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/tests/test_io/audio_player.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/tests/test_io/plotter.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/tests/test_models/test_data.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/tests/test_models/test_t_ax.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/tests/test_plugins/youtube_audio_loader.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/tests/test_signals/frequency_domain_signal.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/tests/test_signals/spectrogram.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/tests/test_signals/test_axis.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/tests/test_signals/test_feature_time_domain_signal.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/tests/test_signals/test_frequency_time_domain_signal.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/tests/test_signals/test_signal1D.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/tests/test_signals/test_signal2D.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/tests/test_signals/test_time_domain_signal.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/tests/test_signals/test_u_ax.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/tests/test_signals/test_window_signal.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/tests/test_signals/time_domain_signal.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/tests/test_tools/test_audio_converter.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/tests/test_tools/test_fourier_tranform.py +0 -0
- {modusa-0.3.41 → modusa-0.3.42}/tests/test_tools/test_math_ops.py +0 -0
| @@ -1,6 +1,6 @@ | |
| 1 1 | 
             
            Metadata-Version: 2.1
         | 
| 2 2 | 
             
            Name: modusa
         | 
| 3 | 
            -
            Version: 0.3. | 
| 3 | 
            +
            Version: 0.3.42
         | 
| 4 4 | 
             
            Summary: A modular signal analysis python library.
         | 
| 5 5 | 
             
            Author-Email: Ankit Anand <ankit0.anand0@gmail.com>
         | 
| 6 6 | 
             
            License: MIT
         | 
| @@ -10,6 +10,7 @@ Requires-Dist: matplotlib>=3.10.3 | |
| 10 10 | 
             
            Requires-Dist: yt-dlp>=2025.6.30
         | 
| 11 11 | 
             
            Requires-Dist: librosa==0.11.0
         | 
| 12 12 | 
             
            Requires-Dist: IPython>=8.0.0
         | 
| 13 | 
            +
            Requires-Dist: sounddevice>=0.5.2
         | 
| 13 14 | 
             
            Description-Content-Type: text/markdown
         | 
| 14 15 |  | 
| 15 16 | 
             
            # modusa
         | 
| @@ -1,6 +1,6 @@ | |
| 1 1 | 
             
            [project]
         | 
| 2 2 | 
             
            name = "modusa"
         | 
| 3 | 
            -
            version = "0.3. | 
| 3 | 
            +
            version = "0.3.42"
         | 
| 4 4 | 
             
            description = "A modular signal analysis python library."
         | 
| 5 5 | 
             
            authors = [
         | 
| 6 6 | 
             
                { name = "Ankit Anand", email = "ankit0.anand0@gmail.com" },
         | 
| @@ -11,6 +11,7 @@ dependencies = [ | |
| 11 11 | 
             
                "yt-dlp>=2025.6.30",
         | 
| 12 12 | 
             
                "librosa==0.11.0",
         | 
| 13 13 | 
             
                "IPython>=8.0.0",
         | 
| 14 | 
            +
                "sounddevice>=0.5.2",
         | 
| 14 15 | 
             
            ]
         | 
| 15 16 | 
             
            requires-python = ">=3.10"
         | 
| 16 17 | 
             
            readme = "README.md"
         | 
| @@ -0,0 +1,115 @@ | |
| 1 | 
            +
            #!/usr/bin/env python3
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            #---------------------------------
         | 
| 4 | 
            +
            # Author: Ankit Anand
         | 
| 5 | 
            +
            # Date: 22/08/25
         | 
| 6 | 
            +
            # Email: ankit0.anand0@gmail.com
         | 
| 7 | 
            +
            #---------------------------------
         | 
| 8 | 
            +
             | 
| 9 | 
            +
             | 
| 10 | 
            +
            import sounddevice as sd
         | 
| 11 | 
            +
            import numpy as np
         | 
| 12 | 
            +
            import ipywidgets as widgets
         | 
| 13 | 
            +
            from IPython.display import display, clear_output, Audio
         | 
| 14 | 
            +
             | 
| 15 | 
            +
            def record():
         | 
| 16 | 
            +
            	"""
         | 
| 17 | 
            +
            	Create a UI to record audio in jupyter notebook, the 
         | 
| 18 | 
            +
            	recorded signal is available as array.
         | 
| 19 | 
            +
             | 
| 20 | 
            +
            	.. code-block:: python
         | 
| 21 | 
            +
            		
         | 
| 22 | 
            +
            		import modusa as ms
         | 
| 23 | 
            +
            		result = ms.record()
         | 
| 24 | 
            +
            		y, sr, title = result() # Keep it in the next cell
         | 
| 25 | 
            +
             | 
| 26 | 
            +
            	Returns
         | 
| 27 | 
            +
            	-------
         | 
| 28 | 
            +
            	Callable
         | 
| 29 | 
            +
            		A lambda function that returns y(audio signal), sr(sampling rate), title(title set in the UI)
         | 
| 30 | 
            +
            	"""
         | 
| 31 | 
            +
            	devices = sd.query_devices()
         | 
| 32 | 
            +
            	device_options = [(d['name'][:30], i) for i, d in enumerate(devices) if d['max_input_channels'] > 0]
         | 
| 33 | 
            +
            	
         | 
| 34 | 
            +
            	# Controls
         | 
| 35 | 
            +
            	device_dropdown = widgets.Dropdown(
         | 
| 36 | 
            +
            		options=device_options,
         | 
| 37 | 
            +
            		description="Microphone:",
         | 
| 38 | 
            +
            		layout=widgets.Layout(width="300px")
         | 
| 39 | 
            +
            	)
         | 
| 40 | 
            +
            	
         | 
| 41 | 
            +
            	sr_dropdown = widgets.Dropdown(
         | 
| 42 | 
            +
            		options=[('16 Khz', 16000), ('22.05 Khz', 22050), ('44.1 Khz', 44100)],
         | 
| 43 | 
            +
            		value=22050,
         | 
| 44 | 
            +
            		description="Sample Rate:",
         | 
| 45 | 
            +
            		layout=widgets.Layout(width="300px")
         | 
| 46 | 
            +
            	)
         | 
| 47 | 
            +
            	
         | 
| 48 | 
            +
            	title_box = widgets.Text(
         | 
| 49 | 
            +
            		placeholder="Title",
         | 
| 50 | 
            +
            		description="Title:",
         | 
| 51 | 
            +
            		layout=widgets.Layout(width="300px")
         | 
| 52 | 
            +
            	)
         | 
| 53 | 
            +
            	
         | 
| 54 | 
            +
            	toggle_button = widgets.Button(
         | 
| 55 | 
            +
            		description="Record",
         | 
| 56 | 
            +
            		button_style="",
         | 
| 57 | 
            +
            	)
         | 
| 58 | 
            +
            	
         | 
| 59 | 
            +
            	status = widgets.HTML(value="")
         | 
| 60 | 
            +
            	out = widgets.Output()
         | 
| 61 | 
            +
            	
         | 
| 62 | 
            +
            	# State
         | 
| 63 | 
            +
            	recording = {"data": None, "sr": None, "title": None}
         | 
| 64 | 
            +
            	stream = {"obj": None, "frames": [], "recording": False}
         | 
| 65 | 
            +
            	
         | 
| 66 | 
            +
            	def callback(indata, frames, time, status):
         | 
| 67 | 
            +
            		if not status:
         | 
| 68 | 
            +
            			stream["frames"].append(indata.copy())
         | 
| 69 | 
            +
            			
         | 
| 70 | 
            +
            	def on_toggle(b):
         | 
| 71 | 
            +
            		if not stream["recording"]:
         | 
| 72 | 
            +
            			stream["frames"].clear()
         | 
| 73 | 
            +
            			sr = sr_dropdown.value
         | 
| 74 | 
            +
            			device_id = device_dropdown.value
         | 
| 75 | 
            +
            			
         | 
| 76 | 
            +
            			stream["obj"] = sd.InputStream(callback=callback, channels=1, samplerate=sr, device=device_id)
         | 
| 77 | 
            +
            			stream["obj"].start()
         | 
| 78 | 
            +
            			stream["recording"] = True
         | 
| 79 | 
            +
            			
         | 
| 80 | 
            +
            			toggle_button.description = "Stop"
         | 
| 81 | 
            +
            			toggle_button.button_style = "danger"
         | 
| 82 | 
            +
            			status.value = "Recording..."
         | 
| 83 | 
            +
            		else:
         | 
| 84 | 
            +
            			stream["obj"].stop()
         | 
| 85 | 
            +
            			stream["obj"].close()
         | 
| 86 | 
            +
            			
         | 
| 87 | 
            +
            			sr = sr_dropdown.value
         | 
| 88 | 
            +
            			y = np.concatenate(stream["frames"], axis=0).flatten()
         | 
| 89 | 
            +
            			title = title_box.value.strip() or "Recording"
         | 
| 90 | 
            +
            			
         | 
| 91 | 
            +
            			recording["data"], recording["sr"], recording["title"] = y, sr, title
         | 
| 92 | 
            +
            			record.result = (y, sr, title)
         | 
| 93 | 
            +
            			stream["recording"] = False
         | 
| 94 | 
            +
            			
         | 
| 95 | 
            +
            			toggle_button.description = "Record"
         | 
| 96 | 
            +
            			toggle_button.button_style = "success"
         | 
| 97 | 
            +
            			
         | 
| 98 | 
            +
            			with out:
         | 
| 99 | 
            +
            				clear_output()
         | 
| 100 | 
            +
            				display(Audio(y, rate=sr))
         | 
| 101 | 
            +
            				
         | 
| 102 | 
            +
            	toggle_button.on_click(on_toggle)
         | 
| 103 | 
            +
            	
         | 
| 104 | 
            +
            	# Layout
         | 
| 105 | 
            +
            	ui = widgets.VBox([
         | 
| 106 | 
            +
            		device_dropdown,
         | 
| 107 | 
            +
            		sr_dropdown,
         | 
| 108 | 
            +
            		title_box,
         | 
| 109 | 
            +
            		widgets.HBox([toggle_button]),
         | 
| 110 | 
            +
            		out
         | 
| 111 | 
            +
            	])
         | 
| 112 | 
            +
            	
         | 
| 113 | 
            +
            	display(ui)
         | 
| 114 | 
            +
            	record.result = None
         | 
| 115 | 
            +
            	return lambda: record.result
         | 
| 
            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
         | 
    
        {modusa-0.3.41 → modusa-0.3.42}/src/modusa/models/__pycache__/signal1D.cpython-312.pyc.4443461152
    RENAMED
    
    | 
            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
         | 
| 
            File without changes
         | 
| 
            File without changes
         | 
| 
            File without changes
         | 
| 
            File without changes
         |