11 Commits

Author SHA1 Message Date
637f4ab9a4 tweaking rtd config 2025-12-18 16:00:25 -08:00
4cd635ff17 nudging docs python version 2025-12-18 15:54:48 -08:00
26e1e38320 nudging docs python version 2025-12-18 15:46:01 -08:00
0e97742336 added 3.14 to matrix, some dependency work 2025-12-18 13:30:52 -08:00
67ea12042f updated .flake8 path 2025-12-18 12:35:53 -08:00
6b910a0920 pyproject.toml now PEP 621 compliant
Update build system to uv
2025-12-18 12:27:21 -08:00
a8f35a9ffc twiddle, nudge version number 2025-12-18 10:18:04 -08:00
Jamie Hardt
242f2e08d5 Merge pull request #20 from iluvcapra/19-unusual-edl
Tolerant Parsing Mode
2025-12-18 10:06:07 -08:00
610d406e97 flake8 2025-12-17 15:13:49 -08:00
28307608fc Added raw ASC_SOP line method 2025-12-17 15:12:34 -08:00
9ab3804c89 Removed explicit imports of pycmx 2025-12-17 15:09:05 -08:00
17 changed files with 71 additions and 50 deletions

View File

@@ -1,5 +1,5 @@
[flake8]
per-file-ignores =
pycmx/__init__.py: F401
src/pycmx/__init__.py: F401
tests/__init__.py: F401

View File

@@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
@@ -26,8 +26,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
python -m pip install -e .
python -m pip install -e .[dev]
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names

1
.python-version Normal file
View File

@@ -0,0 +1 @@
3.13

View File

@@ -9,11 +9,11 @@ version: 2
build:
os: ubuntu-20.04
tools:
python: "3.10"
# You can also specify other tool versions:
# nodejs: "16"
# rust: "1.55"
# golang: "1.17"
python: "3.13"
jobs:
install:
- pip install --upgrade pip
- pip install --group 'doc'
# Build documentation in the docs/ directory with Sphinx
sphinx:
@@ -28,5 +28,3 @@ python:
install:
- method: pip
path: .
extra_requirements:
- doc

View File

@@ -14,7 +14,7 @@ The `pycmx` package parses a CMX 3600 EDL and its most most common variations.
read. Event number field and source name field sizes are determined
dynamically for each statement for a high level of compliance at the expense
of strictness.
* An more relaxed "tolerant" mode allows parsing of an EDL file where columns
* A more relaxed "tolerant" mode allows parsing of an EDL file where columns
use non-standard widths.
* Preserves relationship between events and individual edits/clips.
* Remark or comment fields with common recognized forms are read and

View File

@@ -1,15 +1,16 @@
[tool.poetry]
[project]
name = "pycmx"
version = "1.4.0"
version = "1.5.0"
description = "Python CMX 3600 Edit Decision List Parser"
authors = ["Jamie Hardt <jamiehardt@me.com>"]
license = "MIT"
authors = [{name = "Jamie Hardt", email= "<jamiehardt@me.com>"}]
license-files = ["LICENSE"]
readme = "README.md"
keywords = [
'parser',
'film',
'broadcast'
]
requires-python = '>3.8'
classifiers = [
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: MIT License',
@@ -21,20 +22,29 @@ classifiers = [
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13'
'Programming Language :: Python :: 3.13',
'Programming Language :: Python :: 3.14'
]
homepage = "https://github.com/iluvcapra/pycmx"
documentation = "https://pycmx.readthedocs.io/"
repository = "https://github.com/iluvcapra/pycmx.git"
urls.Tracker = "https://github.com/iluvcapra/pycmx/issues"
[tool.poetry.extras]
[project.optional-dependencies]
doc = [
'sphinx >= 5.3.0',
'sphinx_rtd_theme >= 1.1.1'
]
dev = [
'flake8',
'pytest'
]
[project.urls]
Homepage = "https://github.com/iluvcapra/pycmx"
Documentation = "https://pycmx.readthedocs.io/"
Repository = "https://github.com/iluvcapra/pycmx.git"
Tracker = "https://github.com/iluvcapra/pycmx/issues"
[dependency-groups]
doc = ['sphinx', 'sphinx_rtd_theme']
[tool.poetry.dependencies]
python = "^3.8"
sphinx = { version='>= 5.3.0', optional=true}
sphinx_rtd_theme = {version ='>= 1.1.1', optional=true}
[tool.pyright]
typeCheckingMode = "basic"
@@ -52,5 +62,5 @@ disable = [
]
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
requires = ["uv_build>=0.9.18,<0.10.0"]
build-backend = "uv_build"

View File

@@ -1,8 +1,8 @@
# pycmx
# (c) 2018-2025 Jamie Hardt
from pycmx.cdl import AscSopComponents, FramecountTriple
from pycmx.statements import (
from .cdl import AscSopComponents, FramecountTriple
from .statements import (
StmtCdlSat,
StmtCdlSop,
StmtFrmc,
@@ -177,6 +177,16 @@ class Edit:
return self._asc_sop_statement.cdl_sop
@property
def asc_sop_raw(self) -> Optional[str]:
"""
ASC CDL Slope-Offset-Power statement raw line
"""
if self._asc_sop_statement is None:
return None
return self._asc_sop_statement.line
@property
def asc_sat(self) -> Optional[float]:
"""

View File

@@ -1,8 +1,8 @@
# pycmx
# (c) 2018-2025 Jamie Hardt
from pycmx.statements import (StmtCorruptRemark, StmtTitle, StmtEvent,
StmtUnrecognized, StmtSourceUMID)
from .statements import (StmtCorruptRemark, StmtTitle, StmtEvent,
StmtUnrecognized, StmtSourceUMID)
from .event import Event
from .channel_map import ChannelMap

View File

@@ -1,10 +1,9 @@
# pycmx
# (c) 2023-2025 Jamie Hardt
from pycmx.statements import StmtFrmc
from .parse_cmx_statements import (
StmtEvent, StmtClipName, StmtSourceFile, StmtAudioExt, StmtUnrecognized,
StmtEffectsName, StmtCdlSop, StmtCdlSat)
from .statements import (StmtFrmc, StmtEvent, StmtClipName, StmtSourceFile,
StmtAudioExt, StmtUnrecognized, StmtEffectsName,
StmtCdlSop, StmtCdlSat)
from .edit import Edit
from typing import List, Generator, Optional, Tuple, Any

View File

@@ -4,7 +4,7 @@
import re
from typing import TextIO, List
from pycmx.cdl import AscSopComponents, Rgb
from .cdl import AscSopComponents, Rgb
from .statements import (StmtCdlSat, StmtCdlSop, StmtCorruptRemark, StmtFrmc,
StmtRemark, StmtTitle, StmtUnrecognized, StmtFCM,
@@ -60,9 +60,8 @@ def _parse_cmx3600_line(line: str, line_number: int,
source_field_len = len(line) - (event_field_len + 65)
try:
return _parse_columns_for_standard_form(line, event_field_len,
source_field_len,
line_number)
return _parse_columns_for_standard_form(
line, event_field_len, source_field_len, line_number)
except EventFormError:
if tolerant:
@@ -134,15 +133,19 @@ def _parse_remark(line, line_number) -> object:
else:
try:
return StmtCdlSop(cdl_sop=AscSopComponents(
slope=Rgb(red=float(v[0][0]), green=float(v[0][1]),
blue=float(v[0][2])),
offset=Rgb(red=float(v[1][0]), green=float(v[1][1]),
blue=float(v[1][2])),
power=Rgb(red=float(v[2][0]), green=float(v[2][1]),
blue=float(v[2][2]))
),
line_number=line_number)
return StmtCdlSop(line=line,
cdl_sop=AscSopComponents(
slope=Rgb(red=float(v[0][0]),
green=float(v[0][1]),
blue=float(v[0][2])),
offset=Rgb(red=float(v[1][0]),
green=float(v[1][1]),
blue=float(v[1][2])),
power=Rgb(red=float(v[2][0]),
green=float(v[2][1]),
blue=float(v[2][2]))
),
line_number=line_number)
except ValueError as e:
return StmtCorruptRemark('ASC_SOP', e, line_number)

View File

@@ -3,7 +3,7 @@
from typing import Any, NamedTuple
from pycmx.cdl import AscSopComponents
from .cdl import AscSopComponents
# type str = str
@@ -50,6 +50,7 @@ class StmtSourceFile(NamedTuple):
class StmtCdlSop(NamedTuple):
line: str
cdl_sop: AscSopComponents[float]
line_number: int