typed-ffmpeg-compatible 2.7.2__py3-none-any.whl → 2.7.3__py3-none-any.whl

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.
@@ -15,6 +15,27 @@ from ..utils.run import ignore_default
15
15
  from .nodes import FilterableStream, FilterNode
16
16
 
17
17
 
18
+ def eval_formula(formula: str, **kwargs: Any) -> list[StreamType]:
19
+ """
20
+ Evaluate a formula string with the given parameters.
21
+
22
+ This function evaluates a formula string using the provided parameters.
23
+ It supports basic arithmetic operations and conditional logic.
24
+
25
+ Args:
26
+ formula: The formula string to evaluate
27
+ **kwargs: Additional keyword arguments to pass to the formula
28
+
29
+ Returns:
30
+ The result of the formula evaluation
31
+ """
32
+ # Convert formula to Python code
33
+ return eval(
34
+ formula,
35
+ {"StreamType": StreamType, "re": re, **kwargs},
36
+ )
37
+
38
+
18
39
  def filter_node_factory(
19
40
  ffmpeg_filter_def: FFMpegFilterDef, *inputs: FilterableStream, **kwargs: Any
20
41
  ) -> FilterNode:
@@ -45,9 +66,9 @@ def filter_node_factory(
45
66
 
46
67
  if isinstance(ffmpeg_filter_def.typings_input, str):
47
68
  input_typings = tuple(
48
- eval(
69
+ eval_formula(
49
70
  ffmpeg_filter_def.typings_input,
50
- {"StreamType": StreamType, "re": re, **kwargs},
71
+ **kwargs,
51
72
  )
52
73
  )
53
74
  else:
@@ -58,9 +79,9 @@ def filter_node_factory(
58
79
 
59
80
  if isinstance(ffmpeg_filter_def.typings_output, str):
60
81
  output_typings = tuple(
61
- eval(
82
+ eval_formula(
62
83
  ffmpeg_filter_def.typings_output,
63
- {"StreamType": StreamType, "re": re, **kwargs},
84
+ **kwargs,
64
85
  )
65
86
  )
66
87
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: typed-ffmpeg-compatible
3
- Version: 2.7.2
3
+ Version: 2.7.3
4
4
  Summary: Modern Python FFmpeg wrappers offer comprehensive support for complex filters, complete with detailed typing and documentation.
5
5
  Home-page: https://livingbio.github.io/typed-ffmpeg/
6
6
  License: MIT
@@ -6,7 +6,7 @@ typed_ffmpeg/common/serialize.py,sha256=QH7UVPCXAHrqbAMK11DzFfy03XgFEHXWOrCVUJxB
6
6
  typed_ffmpeg/dag/__init__.py,sha256=qAApSNqjbZ1DtUaV5bSku9RwG7MpMPa1HJO764cSBt4,849
7
7
  typed_ffmpeg/dag/compile.py,sha256=GXMTFE1vqRDI-nuIZPtJwXQhCc61uCIGh5u4OBRp8gg,3129
8
8
  typed_ffmpeg/dag/context.py,sha256=pv77lltW6yk-PRYlZ0MC6FICVxYLuyxQAS9Vx5vko0s,11691
9
- typed_ffmpeg/dag/factory.py,sha256=7iRB2Inth97wxvklI-MoL_47Cl7rZOogNj10qM7wUTs,2600
9
+ typed_ffmpeg/dag/factory.py,sha256=2IMVKP_2UaTrlGXBg8YDx5KXBqhpScJiJQ87PRrppzY,3147
10
10
  typed_ffmpeg/dag/global_runnable/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  typed_ffmpeg/dag/global_runnable/global_args.py,sha256=ehLtx4v-XxqkmODhpE_gik0r79hs4Sa8TJnRsH9Fj1o,8043
12
12
  typed_ffmpeg/dag/global_runnable/runnable.py,sha256=wvfvojrLFvu-Vz0N2AIXbla2kptwcu0Dba4TfKYOH3I,11041
@@ -41,8 +41,8 @@ typed_ffmpeg/utils/run.py,sha256=mSoAdcvD-InldqkRgWNc8iXKgJJoEMAOE4PL2gVmtqw,217
41
41
  typed_ffmpeg/utils/snapshot.py,sha256=mKILRm6qiQV2egaD-70MSUEl-DFoLD5w_v9GZIequI4,2181
42
42
  typed_ffmpeg/utils/typing.py,sha256=DBQn_gCF8C_DTwsfMHeCgfnNUROwAjlIcHrQ7lNDOoE,1187
43
43
  typed_ffmpeg/utils/view.py,sha256=4DJmyGIkUeE6-V0azudDCWm608mRdeRhTZHMgnew9Kw,3409
44
- typed_ffmpeg_compatible-2.7.2.dist-info/LICENSE,sha256=8Aaya5i_09Cou2i3QMxTwz6uHGzi_fGA4uhkco07-A4,1066
45
- typed_ffmpeg_compatible-2.7.2.dist-info/METADATA,sha256=djaV8dOPAbYJax4MQV1G0kDMuZXwlOxNbCpxzbgD3pw,7249
46
- typed_ffmpeg_compatible-2.7.2.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
47
- typed_ffmpeg_compatible-2.7.2.dist-info/entry_points.txt,sha256=KfZmNsM16GT_lF1otASIN6E3i6xXHXoB1gMeEdlptjA,44
48
- typed_ffmpeg_compatible-2.7.2.dist-info/RECORD,,
44
+ typed_ffmpeg_compatible-2.7.3.dist-info/LICENSE,sha256=8Aaya5i_09Cou2i3QMxTwz6uHGzi_fGA4uhkco07-A4,1066
45
+ typed_ffmpeg_compatible-2.7.3.dist-info/METADATA,sha256=95rIej_AdoZU92K9-9OJMVJo-mv0M7IcaBTqJMzXpZE,7249
46
+ typed_ffmpeg_compatible-2.7.3.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
47
+ typed_ffmpeg_compatible-2.7.3.dist-info/entry_points.txt,sha256=KfZmNsM16GT_lF1otASIN6E3i6xXHXoB1gMeEdlptjA,44
48
+ typed_ffmpeg_compatible-2.7.3.dist-info/RECORD,,