auto-editor 27.1.1__py3-none-any.whl → 28.0.0__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.
- auto_editor/__init__.py +1 -1
- auto_editor/__main__.py +0 -8
- auto_editor/cmds/desc.py +8 -9
- auto_editor/cmds/info.py +1 -14
- auto_editor/cmds/test.py +35 -19
- auto_editor/edit.py +50 -49
- auto_editor/{formats → exports}/fcp11.py +6 -2
- auto_editor/{formats → exports}/fcp7.py +6 -201
- auto_editor/exports/json.py +32 -0
- auto_editor/{formats → exports}/shotcut.py +6 -11
- auto_editor/ffwrapper.py +1 -3
- auto_editor/help.py +6 -17
- auto_editor/imports/__init__.py +0 -0
- auto_editor/imports/fcp7.py +277 -0
- auto_editor/{formats → imports}/json.py +11 -37
- auto_editor/lang/palet.py +1 -1
- auto_editor/lang/stdenv.py +5 -2
- auto_editor/lib/contracts.py +1 -1
- auto_editor/preview.py +1 -2
- auto_editor/render/audio.py +1 -1
- auto_editor/timeline.py +8 -13
- {auto_editor-27.1.1.dist-info → auto_editor-28.0.0.dist-info}/METADATA +2 -2
- {auto_editor-27.1.1.dist-info → auto_editor-28.0.0.dist-info}/RECORD +28 -26
- {auto_editor-27.1.1.dist-info → auto_editor-28.0.0.dist-info}/WHEEL +1 -1
- auto_editor/formats/utils.py +0 -56
- /auto_editor/{formats → exports}/__init__.py +0 -0
- {auto_editor-27.1.1.dist-info → auto_editor-28.0.0.dist-info}/entry_points.txt +0 -0
- {auto_editor-27.1.1.dist-info → auto_editor-28.0.0.dist-info}/licenses/LICENSE +0 -0
- {auto_editor-27.1.1.dist-info → auto_editor-28.0.0.dist-info}/top_level.txt +0 -0
@@ -1,32 +1,28 @@
|
|
1
1
|
from __future__ import annotations
|
2
2
|
|
3
3
|
import os
|
4
|
-
import sys
|
5
4
|
from difflib import get_close_matches
|
6
5
|
from fractions import Fraction
|
7
|
-
from typing import Any
|
6
|
+
from typing import TYPE_CHECKING, Any
|
8
7
|
|
9
8
|
from auto_editor.ffwrapper import FileInfo
|
10
|
-
from auto_editor.json import
|
9
|
+
from auto_editor.json import load
|
11
10
|
from auto_editor.lib.err import MyError
|
12
11
|
from auto_editor.timeline import (
|
13
|
-
ASpace,
|
14
12
|
Template,
|
15
13
|
TlAudio,
|
16
14
|
TlVideo,
|
17
|
-
VSpace,
|
18
15
|
audio_builder,
|
19
16
|
v1,
|
20
17
|
v3,
|
21
18
|
visual_objects,
|
22
19
|
)
|
23
20
|
from auto_editor.utils.cmdkw import ParserError, Required, pAttrs
|
24
|
-
from auto_editor.utils.log import Log
|
25
21
|
from auto_editor.utils.types import CoerceError
|
26
22
|
|
27
|
-
|
28
|
-
|
29
|
-
|
23
|
+
if TYPE_CHECKING:
|
24
|
+
from auto_editor.timeline import ASpace, VSpace
|
25
|
+
from auto_editor.utils.log import Log
|
30
26
|
|
31
27
|
|
32
28
|
def check_attrs(data: object, log: Log, *attrs: str) -> None:
|
@@ -218,11 +214,13 @@ def read_v1(tl: Any, log: Log) -> v3:
|
|
218
214
|
|
219
215
|
|
220
216
|
def read_json(path: str, log: Log) -> v3:
|
221
|
-
|
222
|
-
|
217
|
+
try:
|
218
|
+
with open(path, encoding="utf-8", errors="ignore") as f:
|
223
219
|
tl = load(path, f)
|
224
|
-
|
225
|
-
|
220
|
+
except FileNotFoundError:
|
221
|
+
log.error(f"File not found: {path}")
|
222
|
+
except MyError as e:
|
223
|
+
log.error(e)
|
226
224
|
|
227
225
|
check_attrs(tl, log, "version")
|
228
226
|
|
@@ -235,27 +233,3 @@ def read_json(path: str, log: Log) -> v3:
|
|
235
233
|
if type(ver) is not str:
|
236
234
|
log.error("version needs to be a string")
|
237
235
|
log.error(f"Importing version {ver} timelines is not supported.")
|
238
|
-
|
239
|
-
|
240
|
-
def make_json_timeline(ver: int, out: str | int, tl: v3, log: Log) -> None:
|
241
|
-
if ver not in {3, 1}:
|
242
|
-
log.error(f"Version {ver} is not supported!")
|
243
|
-
|
244
|
-
if isinstance(out, str):
|
245
|
-
if not out.endswith(".json"):
|
246
|
-
log.error("Output extension must be .json")
|
247
|
-
outfile: Any = open(out, "w")
|
248
|
-
else:
|
249
|
-
outfile = sys.stdout
|
250
|
-
|
251
|
-
if ver == 3:
|
252
|
-
dump(tl.as_dict(), outfile, indent=2)
|
253
|
-
else:
|
254
|
-
if tl.v1 is None:
|
255
|
-
log.error("Timeline can't be converted to v1 format")
|
256
|
-
dump(tl.v1.as_dict(), outfile, indent=2)
|
257
|
-
|
258
|
-
if isinstance(out, str):
|
259
|
-
outfile.close()
|
260
|
-
else:
|
261
|
-
print("") # Flush stdout
|
auto_editor/lang/palet.py
CHANGED
auto_editor/lang/stdenv.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
from __future__ import annotations
|
2
2
|
|
3
|
+
from dataclasses import dataclass
|
3
4
|
from typing import TYPE_CHECKING
|
4
5
|
|
5
6
|
import bv
|
@@ -7,10 +8,12 @@ import bv
|
|
7
8
|
from auto_editor.analyze import mut_remove_large, mut_remove_small
|
8
9
|
from auto_editor.lib.contracts import *
|
9
10
|
from auto_editor.lib.data_structs import *
|
11
|
+
from auto_editor.lib.err import MyError
|
10
12
|
|
11
13
|
from .palet import Syntax, env, is_boolarr, is_iterable, my_eval, p_slice, raise_, ref
|
12
14
|
|
13
15
|
if TYPE_CHECKING:
|
16
|
+
from fractions import Fraction
|
14
17
|
from typing import Any, Literal
|
15
18
|
|
16
19
|
import numpy as np
|
@@ -928,7 +931,7 @@ def make_standard_env() -> dict[str, Any]:
|
|
928
931
|
except Exception:
|
929
932
|
raise MyError("hash-ref: invalid key")
|
930
933
|
|
931
|
-
def hash_set(h: dict, k: object, v: object) -> None:
|
934
|
+
def hash_set(h: dict[object, object], k: object, v: object) -> None:
|
932
935
|
h[k] = v
|
933
936
|
|
934
937
|
def hash_remove(h: dict, v: object) -> None:
|
@@ -953,7 +956,7 @@ def make_standard_env() -> dict[str, Any]:
|
|
953
956
|
except Exception:
|
954
957
|
return False
|
955
958
|
|
956
|
-
def change_file_ext(a, ext) -> str:
|
959
|
+
def change_file_ext(a: str, ext: str) -> str:
|
957
960
|
import os.path
|
958
961
|
|
959
962
|
base_name = os.path.splitext(a)[0]
|
auto_editor/lib/contracts.py
CHANGED
auto_editor/preview.py
CHANGED
auto_editor/render/audio.py
CHANGED
@@ -272,7 +272,7 @@ def mix_audio_files(sr: int, audio_paths: list[str], output_path: str) -> None:
|
|
272
272
|
max_val = np.max(np.abs(mixed_audio))
|
273
273
|
if max_val > 0:
|
274
274
|
mixed_audio = mixed_audio * (32767 / max_val)
|
275
|
-
mixed_audio = mixed_audio.astype(np.int16)
|
275
|
+
mixed_audio = mixed_audio.astype(np.int16)
|
276
276
|
|
277
277
|
output_container = bv.open(output_path, mode="w")
|
278
278
|
output_stream = output_container.add_stream("pcm_s16le", rate=sr)
|
auto_editor/timeline.py
CHANGED
@@ -12,7 +12,6 @@ if TYPE_CHECKING:
|
|
12
12
|
from collections.abc import Iterator
|
13
13
|
from fractions import Fraction
|
14
14
|
from pathlib import Path
|
15
|
-
from typing import Any
|
16
15
|
|
17
16
|
from auto_editor.ffwrapper import FileInfo
|
18
17
|
from auto_editor.utils.chunks import Chunks
|
@@ -297,18 +296,14 @@ video\n"""
|
|
297
296
|
seen.add(source.path)
|
298
297
|
yield source
|
299
298
|
|
300
|
-
def
|
301
|
-
|
302
|
-
for clips in
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
return
|
308
|
-
|
309
|
-
def out_len(self) -> int:
|
310
|
-
# Calculates the duration of the timeline
|
311
|
-
return max(self._duration(self.v), self._duration(self.a))
|
299
|
+
def __len__(self) -> int:
|
300
|
+
result = 0
|
301
|
+
for clips in self.v + self.a:
|
302
|
+
if len(clips) > 0:
|
303
|
+
lastClip = clips[-1]
|
304
|
+
result = max(result, lastClip.start + lastClip.dur)
|
305
|
+
|
306
|
+
return result
|
312
307
|
|
313
308
|
def as_dict(self) -> dict:
|
314
309
|
v = []
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: auto-editor
|
3
|
-
Version:
|
3
|
+
Version: 28.0.0
|
4
4
|
Summary: Auto-Editor: Effort free video editing!
|
5
5
|
Author-email: WyattBlue <wyattblue@auto-editor.com>
|
6
6
|
License-Expression: Unlicense
|
@@ -12,7 +12,7 @@ Requires-Python: <3.14,>=3.10
|
|
12
12
|
Description-Content-Type: text/markdown
|
13
13
|
License-File: LICENSE
|
14
14
|
Requires-Dist: numpy<3.0,>=2
|
15
|
-
Requires-Dist: basswood-av<16,>=15.
|
15
|
+
Requires-Dist: basswood-av<16,>=15.2.1
|
16
16
|
Dynamic: license-file
|
17
17
|
|
18
18
|
<p align="center"><img src="https://auto-editor.com/img/auto-editor-banner.webp" title="Auto-Editor" width="700"></p>
|
@@ -1,40 +1,42 @@
|
|
1
|
-
auto_editor/__init__.py,sha256=
|
2
|
-
auto_editor/__main__.py,sha256=
|
1
|
+
auto_editor/__init__.py,sha256=DffemEfW53YOlYaNQ9gcZ_Hf1d--6ODBrbX9JaC4Y9Y,23
|
2
|
+
auto_editor/__main__.py,sha256=t5Um7M9ess9xYRfmn6iDvJoBqj_KRQLhlkpFdfhx3MU,15478
|
3
3
|
auto_editor/analyze.py,sha256=CeJG0LI9wXZk1R-QPrNGPS4za-_Avd8y7H-D437DqLg,12300
|
4
|
-
auto_editor/edit.py,sha256=
|
5
|
-
auto_editor/ffwrapper.py,sha256=
|
6
|
-
auto_editor/help.py,sha256=
|
4
|
+
auto_editor/edit.py,sha256=p_UOfReMkMmdhh7b5azXBWvX99AyMKO-ZpnZBso5cj0,19257
|
5
|
+
auto_editor/ffwrapper.py,sha256=ueYdN7-cBAdJBJbv5yT05iuQP_BPFIrR5hFeMkk5c3U,5040
|
6
|
+
auto_editor/help.py,sha256=8Kkos7Bpcn-3YN7ngv0fZp-8a8Qw6b70ZZKerL8SEQ4,7901
|
7
7
|
auto_editor/json.py,sha256=8IVhZJSLx2IVqJsbR5YKDvbHOhgIOvdQmYNpMdMG_xA,9332
|
8
8
|
auto_editor/make_layers.py,sha256=nSEeCHysMot2eze23q05g2HFDuskN_4Jk108xlk2Rw8,10102
|
9
|
-
auto_editor/preview.py,sha256=
|
10
|
-
auto_editor/timeline.py,sha256=
|
9
|
+
auto_editor/preview.py,sha256=yYn5jJLQ3TiJiNC6JffaggLVPQfBU558zJeRQz7nCDY,3046
|
10
|
+
auto_editor/timeline.py,sha256=9D-2lXIGXx2R82qQ7_4TfG77ikN4byM_fK_1QyLlPZ8,9346
|
11
11
|
auto_editor/vanparse.py,sha256=Ug5A2QaRqGiw4l55Z_h9T2QU1x0WqRibR7yY5rQ0WTk,10002
|
12
12
|
auto_editor/cmds/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
13
13
|
auto_editor/cmds/cache.py,sha256=bViYbtVXefTeEIUvSanDfA6cG35ep1N_Jvtz7ZjgIkY,1959
|
14
|
-
auto_editor/cmds/desc.py,sha256=
|
15
|
-
auto_editor/cmds/info.py,sha256=
|
14
|
+
auto_editor/cmds/desc.py,sha256=kdRJfabdde5thuFOoTXlW3J3G8F0ZvbsJoOkUn7E3GA,805
|
15
|
+
auto_editor/cmds/info.py,sha256=awiusgunhoiqrr3LX0AevrVwj4foNJrtRBJUbIebwyc,6589
|
16
16
|
auto_editor/cmds/levels.py,sha256=2Hbvoy6wMbRRoHdZf25PMqq1uvhRKyPcITNPMpZFo7s,5632
|
17
17
|
auto_editor/cmds/palet.py,sha256=ONzTqemaQq9YEfIOsDRNnwzfqnEMUMSXIQrETxyroRU,749
|
18
18
|
auto_editor/cmds/repl.py,sha256=HSUTDaVykPb5Bd-v_jz_8R7HvFmKOcT_ZVmP-d0AbUY,3247
|
19
19
|
auto_editor/cmds/subdump.py,sha256=kHg8nfUi6I6VeJjEgMxupPa666qsYUh7ZEUxint7Gqo,2443
|
20
|
-
auto_editor/cmds/test.py,sha256=
|
21
|
-
auto_editor/
|
22
|
-
auto_editor/
|
23
|
-
auto_editor/
|
24
|
-
auto_editor/
|
25
|
-
auto_editor/
|
26
|
-
auto_editor/
|
20
|
+
auto_editor/cmds/test.py,sha256=VVU1sVDhv4jclJUw387ruWTSRFPh5m-1wfYEGW3mzBs,29624
|
21
|
+
auto_editor/exports/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
22
|
+
auto_editor/exports/fcp11.py,sha256=3HKkTv65J3NZohAyuc08tuHk4fqgEGN8RAMQNzrNFrY,5340
|
23
|
+
auto_editor/exports/fcp7.py,sha256=6ZP9EtVc8nPZu-2zZn1IZP4I5gYedzZ6TJFRM36XDWc,13480
|
24
|
+
auto_editor/exports/json.py,sha256=Z7RKtD5-OB3saOtWG9qfI9OrLtylhU9VyfpnVRNcuU8,768
|
25
|
+
auto_editor/exports/shotcut.py,sha256=J2Myi9fu37fUVqr5mzlWcfHJ9LVKu3f4Pz3tEq2onCc,4811
|
26
|
+
auto_editor/imports/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
27
|
+
auto_editor/imports/fcp7.py,sha256=hWh78sDmMSsf7RhteDCbyz_aS8QYwY2fUg-BB-FchZg,8653
|
28
|
+
auto_editor/imports/json.py,sha256=gsWtlLl26Y7BeOaIAngWH_I0innqp8bFmew0qzQWZB8,7024
|
27
29
|
auto_editor/lang/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
28
30
|
auto_editor/lang/libintrospection.py,sha256=6H1rGp0wqaCud5IPaoEmzULGnYt6ec7_0h32ATcw2oY,261
|
29
31
|
auto_editor/lang/libmath.py,sha256=z33A161Oe6vYYK7R6pgYjdZZe63dQkN38Qf36TL3prg,847
|
30
|
-
auto_editor/lang/palet.py,sha256=
|
31
|
-
auto_editor/lang/stdenv.py,sha256=
|
32
|
+
auto_editor/lang/palet.py,sha256=VS_G_-czy9epsBrqUa0dhEPKWJMGaj3Q5Q49l7mp2so,24121
|
33
|
+
auto_editor/lang/stdenv.py,sha256=ndxkNTFl6QbcgGdgoQtvAfjZhRiqDn6z_-Ad427bcNo,44285
|
32
34
|
auto_editor/lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
33
|
-
auto_editor/lib/contracts.py,sha256=
|
35
|
+
auto_editor/lib/contracts.py,sha256=VWLERPFmf6Lb_3yZoMeqF7pyBTWfAMChIVUVpzN9tz0,7593
|
34
36
|
auto_editor/lib/data_structs.py,sha256=Hnzl5gWvo-geTU0g-lGejj6HQW3VvPv0NBEj2XoGskY,7089
|
35
37
|
auto_editor/lib/err.py,sha256=UlszQJdzMZwkbT8x3sY4GkCV_5x9yrd6uVVUzvA8iiI,35
|
36
38
|
auto_editor/render/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
37
|
-
auto_editor/render/audio.py,sha256=
|
39
|
+
auto_editor/render/audio.py,sha256=OsvUXJD_qmv2xHivLD6skEmK8vdmPyLMhV7mBFdMLQM,17411
|
38
40
|
auto_editor/render/subtitle.py,sha256=F27T8OsAojUIGTGBWqTdH36h0BnHXSExxIqzOtqyZoE,6129
|
39
41
|
auto_editor/render/video.py,sha256=uIrYzF4bDZ3vwfX2F6TdR6F73GI4yruGssto9xEQ-AA,11999
|
40
42
|
auto_editor/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -45,10 +47,10 @@ auto_editor/utils/container.py,sha256=CNHChHbhzIrjmDdWw6UzMqscrr9u7A-ZqKWejGjJwY
|
|
45
47
|
auto_editor/utils/func.py,sha256=ODyjXnzSDatEu08w398K8_xBKYdXMY3IPHiJpGRZDyQ,3250
|
46
48
|
auto_editor/utils/log.py,sha256=wPNf6AabV-0cnoS_bPLv1Lh7llQBtNqPKeh07einOuc,3701
|
47
49
|
auto_editor/utils/types.py,sha256=j2hd4zMQ9EftDy41Ji2_PFru_7HEZObd9yKA0BJxFaY,7616
|
48
|
-
auto_editor-
|
50
|
+
auto_editor-28.0.0.dist-info/licenses/LICENSE,sha256=yiq99pWITHfqS0pbZMp7cy2dnbreTuvBwudsU-njvIM,1210
|
49
51
|
docs/build.py,sha256=g1uc1H9T_naGaermUiVMMwUpbT0IWElRhjgT0fvCh8w,1914
|
50
|
-
auto_editor-
|
51
|
-
auto_editor-
|
52
|
-
auto_editor-
|
53
|
-
auto_editor-
|
54
|
-
auto_editor-
|
52
|
+
auto_editor-28.0.0.dist-info/METADATA,sha256=5hrS0TC7CGSbN5GyOatgqq8svTg9nWNiHw_9fSvHGms,6176
|
53
|
+
auto_editor-28.0.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
54
|
+
auto_editor-28.0.0.dist-info/entry_points.txt,sha256=UAsTc7qJQbnAzHd7KWg-ALo_X9Hj2yDs3M9I2DV3eyI,212
|
55
|
+
auto_editor-28.0.0.dist-info/top_level.txt,sha256=jBV5zlbWRbKOa-xaWPvTD45QL7lGExx2BDzv-Ji4dTw,17
|
56
|
+
auto_editor-28.0.0.dist-info/RECORD,,
|
auto_editor/formats/utils.py
DELETED
@@ -1,56 +0,0 @@
|
|
1
|
-
from __future__ import annotations
|
2
|
-
|
3
|
-
from typing import TYPE_CHECKING
|
4
|
-
from xml.etree.ElementTree import Element
|
5
|
-
|
6
|
-
if TYPE_CHECKING:
|
7
|
-
from auto_editor.utils.log import Log
|
8
|
-
|
9
|
-
|
10
|
-
def show(ele: Element, limit: int, depth: int = 0) -> None:
|
11
|
-
print(
|
12
|
-
f"{' ' * (depth * 4)}<{ele.tag} {ele.attrib}> {ele.text.strip() if ele.text is not None else ''}"
|
13
|
-
)
|
14
|
-
for child in ele:
|
15
|
-
if isinstance(child, Element) and depth < limit:
|
16
|
-
show(child, limit, depth + 1)
|
17
|
-
|
18
|
-
|
19
|
-
class Validator:
|
20
|
-
def __init__(self, log: Log):
|
21
|
-
self.log = log
|
22
|
-
|
23
|
-
def parse(self, ele: Element, schema: dict) -> dict:
|
24
|
-
new: dict = {}
|
25
|
-
|
26
|
-
for key, val in schema.items():
|
27
|
-
if isinstance(val, dict) and "__arr" in val:
|
28
|
-
new[key] = []
|
29
|
-
|
30
|
-
is_arr = False
|
31
|
-
for child in ele:
|
32
|
-
if child.tag not in schema:
|
33
|
-
continue
|
34
|
-
|
35
|
-
if schema[child.tag] is None:
|
36
|
-
new[child.tag] = child
|
37
|
-
continue
|
38
|
-
|
39
|
-
if isinstance(schema[child.tag], dict):
|
40
|
-
val = self.parse(child, schema[child.tag])
|
41
|
-
is_arr = "__arr" in schema[child.tag]
|
42
|
-
else:
|
43
|
-
val = schema[child.tag](child.text)
|
44
|
-
|
45
|
-
if child.tag in new:
|
46
|
-
if not is_arr:
|
47
|
-
self.log.error(f"<{child.tag}> can only occur once")
|
48
|
-
new[child.tag].append(val)
|
49
|
-
else:
|
50
|
-
new[child.tag] = [val] if is_arr else val
|
51
|
-
|
52
|
-
return new
|
53
|
-
|
54
|
-
def check(self, ele: Element, tag: str) -> None:
|
55
|
-
if tag != ele.tag:
|
56
|
-
self.log.error(f"Expected '{tag}' tag, got '{ele.tag}'")
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|