lupy 0.0.1__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.
lupy-0.0.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Matthew Reid
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,30 @@
1
+ Copyright (c) 2001-2002 Enthought, Inc. 2003-2024, SciPy Developers.
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without
5
+ modification, are permitted provided that the following conditions
6
+ are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright
9
+ notice, this list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above
12
+ copyright notice, this list of conditions and the following
13
+ disclaimer in the documentation and/or other materials provided
14
+ with the distribution.
15
+
16
+ 3. Neither the name of the copyright holder nor the names of its
17
+ contributors may be used to endorse or promote products derived
18
+ from this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
lupy-0.0.1/PKG-INFO ADDED
@@ -0,0 +1,139 @@
1
+ Metadata-Version: 2.4
2
+ Name: lupy
3
+ Version: 0.0.1
4
+ Summary: Python library for Audio Loudness measurements
5
+ Author-email: Matthew Reid <matt@nomadic-recording.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/nocarryr/lupy
8
+ Project-URL: Documentation, https://lupy-nocarryr.readthedocs.io/
9
+ Keywords: audio,loudness,r128,ebur128,bs1770,bs1771,tech3341,tech3342
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Natural Language :: English
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Topic :: Multimedia :: Sound/Audio
15
+ Classifier: Topic :: Multimedia :: Sound/Audio :: Analysis
16
+ Classifier: Topic :: Software Development :: Libraries
17
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Programming Language :: Python :: 3.14
24
+ Requires-Python: >=3.10
25
+ Description-Content-Type: text/x-rst
26
+ License-File: LICENSE
27
+ License-File: LICENSE-SCIPY
28
+ Requires-Dist: numpy<=2.4.4
29
+ Requires-Dist: scipy<=1.17.1
30
+ Requires-Dist: typing-extensions; python_version < "3.13"
31
+ Dynamic: license-file
32
+
33
+ lupy
34
+ ####
35
+
36
+ Python library for `Audio Loudness`_ measurements.
37
+ Yet another implementation of `ITU-R BS.1770`_, `ITU-R BS.1771`_,
38
+ `EBU Tech 3341`_ and `EBU Tech 3342`_.
39
+
40
+
41
+ Purpose
42
+ =======
43
+
44
+ This library provides a way to measure audio loudness and true peak measurements
45
+ validated against the official EBU compliance test materials.
46
+
47
+ Its design focuses more on real-time processing, using a block-based approach
48
+ suitable for audio engines, rather than offline processing of entire audio files.
49
+
50
+
51
+
52
+ Features
53
+ ========
54
+
55
+ * Historical tracking of all measurements over time
56
+ * Multi-channel audio support
57
+ * Compliance-based validation of measurements
58
+
59
+
60
+ Measurement Types
61
+ -----------------
62
+
63
+ * Integrated Loudness
64
+ * Short-Term Loudness
65
+ * Momentary Loudness
66
+ * Loudness Range (LRA)
67
+ * True Peak
68
+
69
+
70
+
71
+ Compliance
72
+ ----------
73
+
74
+ This library is validated against comprehensive compliance test cases based on
75
+ the official EBU and ITU-R documents:
76
+
77
+ `EBU Tech 3341`_
78
+ Integrated, Momentary, Short-Term and True Peak measurements
79
+
80
+ `EBU Tech 3342`_
81
+ Loudness Range (LRA) measurements
82
+
83
+ `ITU-R BS.2217`_
84
+ Integrated Loudness measurements for various channel configurations
85
+
86
+
87
+
88
+ Installation
89
+ ============
90
+
91
+ Pip
92
+ ---
93
+
94
+ .. code-block:: bash
95
+
96
+ $ pip install lupy
97
+
98
+
99
+
100
+ Dependencies
101
+ ============
102
+
103
+ * numpy
104
+ * scipy
105
+
106
+
107
+ Project Links
108
+ =============
109
+
110
+
111
+ Homepage
112
+ https://github.com/nocarryr/lupy
113
+
114
+ PyPI
115
+ https://pypi.org/project/lupy/
116
+
117
+ Documentation
118
+ https://lupy-nocarryr.readthedocs.io/
119
+
120
+
121
+
122
+ License
123
+ =======
124
+
125
+ This project is licensed under the MIT License - see the `LICENSE`_ file for details.
126
+
127
+
128
+ Portions of the code (src/lupy/signalutils) are derived from the Scipy library, which is
129
+ licensed under the BSD License. See the `LICENSE-SCIPY`_ file for details.
130
+
131
+
132
+ .. _Audio Loudness: https://tech.ebu.ch/loudness
133
+ .. _ITU-R BS.1770: https://www.itu.int/rec/R-REC-BS.1770/en
134
+ .. _ITU-R BS.1771: https://www.itu.int/rec/R-REC-BS.1771/en
135
+ .. _EBU Tech 3341: https://tech.ebu.ch/publications/tech3341
136
+ .. _EBU Tech 3342: https://tech.ebu.ch/publications/tech3342
137
+ .. _ITU-R BS.2217: https://www.itu.int/pub/R-REP-BS.2217
138
+ .. _LICENSE: LICENSE
139
+ .. _LICENSE-SCIPY: LICENSE-SCIPY
lupy-0.0.1/README.rst ADDED
@@ -0,0 +1,107 @@
1
+ lupy
2
+ ####
3
+
4
+ Python library for `Audio Loudness`_ measurements.
5
+ Yet another implementation of `ITU-R BS.1770`_, `ITU-R BS.1771`_,
6
+ `EBU Tech 3341`_ and `EBU Tech 3342`_.
7
+
8
+
9
+ Purpose
10
+ =======
11
+
12
+ This library provides a way to measure audio loudness and true peak measurements
13
+ validated against the official EBU compliance test materials.
14
+
15
+ Its design focuses more on real-time processing, using a block-based approach
16
+ suitable for audio engines, rather than offline processing of entire audio files.
17
+
18
+
19
+
20
+ Features
21
+ ========
22
+
23
+ * Historical tracking of all measurements over time
24
+ * Multi-channel audio support
25
+ * Compliance-based validation of measurements
26
+
27
+
28
+ Measurement Types
29
+ -----------------
30
+
31
+ * Integrated Loudness
32
+ * Short-Term Loudness
33
+ * Momentary Loudness
34
+ * Loudness Range (LRA)
35
+ * True Peak
36
+
37
+
38
+
39
+ Compliance
40
+ ----------
41
+
42
+ This library is validated against comprehensive compliance test cases based on
43
+ the official EBU and ITU-R documents:
44
+
45
+ `EBU Tech 3341`_
46
+ Integrated, Momentary, Short-Term and True Peak measurements
47
+
48
+ `EBU Tech 3342`_
49
+ Loudness Range (LRA) measurements
50
+
51
+ `ITU-R BS.2217`_
52
+ Integrated Loudness measurements for various channel configurations
53
+
54
+
55
+
56
+ Installation
57
+ ============
58
+
59
+ Pip
60
+ ---
61
+
62
+ .. code-block:: bash
63
+
64
+ $ pip install lupy
65
+
66
+
67
+
68
+ Dependencies
69
+ ============
70
+
71
+ * numpy
72
+ * scipy
73
+
74
+
75
+ Project Links
76
+ =============
77
+
78
+
79
+ Homepage
80
+ https://github.com/nocarryr/lupy
81
+
82
+ PyPI
83
+ https://pypi.org/project/lupy/
84
+
85
+ Documentation
86
+ https://lupy-nocarryr.readthedocs.io/
87
+
88
+
89
+
90
+ License
91
+ =======
92
+
93
+ This project is licensed under the MIT License - see the `LICENSE`_ file for details.
94
+
95
+
96
+ Portions of the code (src/lupy/signalutils) are derived from the Scipy library, which is
97
+ licensed under the BSD License. See the `LICENSE-SCIPY`_ file for details.
98
+
99
+
100
+ .. _Audio Loudness: https://tech.ebu.ch/loudness
101
+ .. _ITU-R BS.1770: https://www.itu.int/rec/R-REC-BS.1770/en
102
+ .. _ITU-R BS.1771: https://www.itu.int/rec/R-REC-BS.1771/en
103
+ .. _EBU Tech 3341: https://tech.ebu.ch/publications/tech3341
104
+ .. _EBU Tech 3342: https://tech.ebu.ch/publications/tech3342
105
+ .. _ITU-R BS.2217: https://www.itu.int/pub/R-REP-BS.2217
106
+ .. _LICENSE: LICENSE
107
+ .. _LICENSE-SCIPY: LICENSE-SCIPY
@@ -0,0 +1,77 @@
1
+ [build-system]
2
+ requires = ["setuptools"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "lupy"
7
+ version = "0.0.1"
8
+ authors = [
9
+ {name = "Matthew Reid", email = "matt@nomadic-recording.com"}
10
+ ]
11
+ description = "Python library for Audio Loudness measurements"
12
+ readme = "README.rst"
13
+ license = "MIT"
14
+ keywords = [
15
+ "audio", "loudness", "r128", "ebur128",
16
+ "bs1770", "bs1771", "tech3341", "tech3342"
17
+ ]
18
+ requires-python = ">=3.10"
19
+ classifiers = [
20
+ "Development Status :: 4 - Beta",
21
+ "Intended Audience :: Developers",
22
+ "Natural Language :: English",
23
+ "Operating System :: OS Independent",
24
+ "Topic :: Multimedia :: Sound/Audio",
25
+ "Topic :: Multimedia :: Sound/Audio :: Analysis",
26
+ "Topic :: Software Development :: Libraries",
27
+ "Topic :: Software Development :: Libraries :: Python Modules",
28
+ "Programming Language :: Python :: 3",
29
+ "Programming Language :: Python :: 3.10",
30
+ "Programming Language :: Python :: 3.11",
31
+ "Programming Language :: Python :: 3.12",
32
+ "Programming Language :: Python :: 3.13",
33
+ "Programming Language :: Python :: 3.14",
34
+ ]
35
+ dependencies = [
36
+ "numpy<=2.4.4",
37
+ "scipy<=1.17.1",
38
+ "typing-extensions; python_version<'3.13'"
39
+ ]
40
+
41
+ [project.urls]
42
+ Homepage = "https://github.com/nocarryr/lupy"
43
+ Documentation = "https://lupy-nocarryr.readthedocs.io/"
44
+
45
+
46
+
47
+ [tool.setuptools.packages.find]
48
+ where = ["src"]
49
+ exclude = ["tests*"]
50
+
51
+
52
+ [tool.pytest.ini_options]
53
+ addopts = "-n auto --dist=worksteal --doctest-modules"
54
+ testpaths = ["tests", "src"]
55
+
56
+ [dependency-groups]
57
+ test = [
58
+ "pytest",
59
+ "pytest-xdist",
60
+ "pytest-codspeed",
61
+ "mypy>=1.19.1",
62
+ "scipy-stubs; python_version>='3.10'",
63
+ ]
64
+ doc = [
65
+ "sphinx",
66
+ "furo",
67
+ ]
68
+ dev = [
69
+ {include-group = "test"},
70
+ {include-group = "doc"},
71
+ "ipython",
72
+ "jupyterlab",
73
+ "matplotlib",
74
+ ]
75
+
76
+ [tool.mypy]
77
+ packages = "lupy"
lupy-0.0.1/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,3 @@
1
+ from .sampling import *
2
+ from .processing import *
3
+ from .meter import *
@@ -0,0 +1,66 @@
1
+ from __future__ import annotations
2
+
3
+ from typing import Generic
4
+
5
+ import numpy as np
6
+ import numpy.typing as npt
7
+
8
+
9
+ from .types import NumChannelsT
10
+
11
+ __all__ = (
12
+ 'MeterDtype', 'MeterArray', 'TruePeakDtype', 'TruePeakArray',
13
+ )
14
+
15
+
16
+ MeterDtype = np.dtype([
17
+ ('t', np.float64),
18
+ ('m', np.float64),
19
+ ('s', np.float64),
20
+ ])
21
+ """A :term:`structured data type` for loudness results
22
+
23
+ .. attribute:: t
24
+ :type: numpy.float64
25
+
26
+ The time in seconds for each measurement
27
+
28
+ .. attribute:: m
29
+ :type: numpy.float64
30
+
31
+ The :term:`Momentary Loudness` at time :attr:`t`
32
+
33
+ .. attribute:: s
34
+ :type: numpy.float64
35
+
36
+ The :term:`Short-Term Loudness` at time :attr:`t`
37
+
38
+ """
39
+
40
+ class TruePeakDtype(np.void, Generic[NumChannelsT]):
41
+ """A :term:`structured data type` for true peak results
42
+
43
+ .. attribute:: t
44
+ :type: numpy.float64
45
+
46
+ The time in seconds for each measurement
47
+
48
+ .. attribute:: tp
49
+ :type: tuple[numpy.float64, ...]
50
+
51
+ The :term:`True Peak` values per channel at time :attr:`t` as a :term:`subarray`
52
+ of length :obj:`NumChannelsT`
53
+
54
+ """
55
+
56
+
57
+ class MeterArray(npt.NDArray[np.void]):
58
+ """Array with dtype :obj:`MeterDtype`
59
+ """
60
+ pass
61
+
62
+
63
+ class TruePeakArray(npt.NDArray[np.void], Generic[NumChannelsT]):
64
+ """Array with dtype :obj:`TruePeakDtype`
65
+ """
66
+ pass
@@ -0,0 +1,48 @@
1
+ # mypy: disable-error-code="override"
2
+ from __future__ import annotations
3
+
4
+ from typing import Generic, Literal, Any, Self, overload
5
+
6
+ import numpy as np
7
+ import numpy.typing as npt
8
+
9
+ from lupy.types import Float1dArray, Float2dArray, NumChannelsT
10
+
11
+
12
+ __all__ = (
13
+ 'MeterDtype', 'MeterArray', 'TruePeakDtype', 'TruePeakArray',
14
+ )
15
+
16
+ MeterDtype = np.dtype([
17
+ ('t', np.float64),
18
+ ('m', np.float64),
19
+ ('s', np.float64),
20
+ ])
21
+
22
+ class TruePeakDtype(np.void, Generic[NumChannelsT]): ... # type: ignore[misc]
23
+
24
+
25
+ _MeterArrayFields = Literal['t', 'm', 's']
26
+
27
+
28
+ class MeterArray(npt.NDArray[np.void]):
29
+ @overload
30
+ def __getitem__(self, key: int|slice[Any, Any, Any]) -> Self: ...
31
+ @overload
32
+ def __getitem__(self, key: _MeterArrayFields) -> Float1dArray: ...
33
+
34
+ def view(self, dtype: np.dtype|type[npt.NDArray[Any]]) -> Self: ...
35
+
36
+
37
+ _TruePeakArrayFields = Literal['t', 'tp']
38
+
39
+
40
+ class TruePeakArray(npt.NDArray[np.void], Generic[NumChannelsT]):
41
+ @overload
42
+ def __getitem__(self, key: int|slice[Any, Any, Any]) -> Self: ...
43
+ @overload
44
+ def __getitem__(self, key: Literal['t']) -> Float1dArray: ...
45
+ @overload
46
+ def __getitem__(self, key: Literal['tp']) -> np.ndarray[tuple[int, NumChannelsT], np.dtype[np.float64]]: ...
47
+
48
+ def view(self, dtype: np.dtype|type[npt.NDArray[Any]]) -> Self: ...