mirror of
https://github.com/iluvcapra/pycmx.git
synced 2025-12-31 08:50:54 +00:00
Compare commits
17 Commits
a8f35a9ffc
...
4e81810584
| Author | SHA1 | Date | |
|---|---|---|---|
| 4e81810584 | |||
| faf2596a57 | |||
| 1e9fbe339c | |||
| a8d00470d4 | |||
| fe1e59e731 | |||
| ec8a08074d | |||
|
|
ef683a7683 | ||
|
|
d778f64230 | ||
| 1b0ccd4ef7 | |||
| 498d5c8fea | |||
| af5d937aeb | |||
| 637f4ab9a4 | |||
| 4cd635ff17 | |||
| 26e1e38320 | |||
| 0e97742336 | |||
| 67ea12042f | |||
| 6b910a0920 |
5
.flake8
5
.flake8
@@ -1,5 +0,0 @@
|
|||||||
[flake8]
|
|
||||||
per-file-ignores =
|
|
||||||
pycmx/__init__.py: F401
|
|
||||||
tests/__init__.py: F401
|
|
||||||
|
|
||||||
11
.github/workflows/python-package.yml
vendored
11
.github/workflows/python-package.yml
vendored
@@ -16,7 +16,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
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:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Set up Python ${{ matrix.python-version }}
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
@@ -26,13 +26,10 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
python -m pip install flake8 pytest
|
python -m pip install -e .[dev]
|
||||||
python -m pip install -e .
|
- name: Lint with ruff
|
||||||
- name: Lint with flake8
|
|
||||||
run: |
|
run: |
|
||||||
# stop the build if there are Python syntax errors or undefined names
|
ruff check src/
|
||||||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
|
||||||
flake8 . --count --max-line-length=79 --statistics
|
|
||||||
- name: Test with pytest
|
- name: Test with pytest
|
||||||
run: |
|
run: |
|
||||||
pytest
|
pytest
|
||||||
|
|||||||
1
.python-version
Normal file
1
.python-version
Normal file
@@ -0,0 +1 @@
|
|||||||
|
3.13
|
||||||
@@ -9,11 +9,11 @@ version: 2
|
|||||||
build:
|
build:
|
||||||
os: ubuntu-20.04
|
os: ubuntu-20.04
|
||||||
tools:
|
tools:
|
||||||
python: "3.10"
|
python: "3.13"
|
||||||
# You can also specify other tool versions:
|
jobs:
|
||||||
# nodejs: "16"
|
install:
|
||||||
# rust: "1.55"
|
- pip install --upgrade pip
|
||||||
# golang: "1.17"
|
- pip install --group 'doc' -e .
|
||||||
|
|
||||||
# Build documentation in the docs/ directory with Sphinx
|
# Build documentation in the docs/ directory with Sphinx
|
||||||
sphinx:
|
sphinx:
|
||||||
@@ -28,5 +28,3 @@ python:
|
|||||||
install:
|
install:
|
||||||
- method: pip
|
- method: pip
|
||||||
path: .
|
path: .
|
||||||
extra_requirements:
|
|
||||||
- doc
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ The `pycmx` package parses a CMX 3600 EDL and its most most common variations.
|
|||||||
### Opening and Parsing EDL Files
|
### Opening and Parsing EDL Files
|
||||||
```
|
```
|
||||||
>>> import pycmx
|
>>> import pycmx
|
||||||
>>> with open("tests/edls/TEST.edl") as f
|
>>> with open("tests/edls/TEST.edl") as f:
|
||||||
... edl = pycmx.parse_cmx3600(f)
|
... edl = pycmx.parse_cmx3600(f)
|
||||||
...
|
...
|
||||||
>>> edl.title
|
>>> edl.title
|
||||||
|
|||||||
@@ -16,7 +16,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
|
read. Event number field and source name field sizes are determined
|
||||||
dynamically for each statement for a high level of compliance at the expense
|
dynamically for each statement for a high level of compliance at the expense
|
||||||
of strictness.
|
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.
|
use non-standard widths.
|
||||||
* Preserves relationship between events and individual edits/clips.
|
* Preserves relationship between events and individual edits/clips.
|
||||||
* Remark or comment fields with common recognized forms are read and
|
* Remark or comment fields with common recognized forms are read and
|
||||||
|
|||||||
@@ -1,15 +1,16 @@
|
|||||||
[tool.poetry]
|
[project]
|
||||||
name = "pycmx"
|
name = "pycmx"
|
||||||
version = "1.5.0"
|
version = "1.5.0"
|
||||||
description = "Python CMX 3600 Edit Decision List Parser"
|
description = "Python CMX 3600 Edit Decision List Parser"
|
||||||
authors = ["Jamie Hardt <jamiehardt@me.com>"]
|
authors = [{name = "Jamie Hardt", email= "<jamiehardt@me.com>"}]
|
||||||
license = "MIT"
|
license-files = ["LICENSE"]
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
keywords = [
|
keywords = [
|
||||||
'parser',
|
'parser',
|
||||||
'film',
|
'film',
|
||||||
'broadcast'
|
'broadcast'
|
||||||
]
|
]
|
||||||
|
requires-python = '>3.8'
|
||||||
classifiers = [
|
classifiers = [
|
||||||
'Development Status :: 5 - Production/Stable',
|
'Development Status :: 5 - Production/Stable',
|
||||||
'License :: OSI Approved :: MIT License',
|
'License :: OSI Approved :: MIT License',
|
||||||
@@ -21,36 +22,59 @@ classifiers = [
|
|||||||
'Programming Language :: Python :: 3.10',
|
'Programming Language :: Python :: 3.10',
|
||||||
'Programming Language :: Python :: 3.11',
|
'Programming Language :: Python :: 3.11',
|
||||||
'Programming Language :: Python :: 3.12',
|
'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 = [
|
||||||
|
'pytest',
|
||||||
|
'ruff>=0.14.10'
|
||||||
|
]
|
||||||
|
|
||||||
|
[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]
|
||||||
|
dev = ['ruff', 'pytest']
|
||||||
doc = ['sphinx', 'sphinx_rtd_theme']
|
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]
|
[tool.pyright]
|
||||||
typeCheckingMode = "basic"
|
typeCheckingMode = "basic"
|
||||||
|
|
||||||
[tool.pylint]
|
[tool.ruff]
|
||||||
max-line-length = 88
|
line-length = 88
|
||||||
disable = [
|
indent-width = 4
|
||||||
"C0103", # (invalid-name)
|
|
||||||
"C0114", # (missing-module-docstring)
|
[tool.ruff.lint]
|
||||||
"C0115", # (missing-class-docstring)
|
select = ["E", "F", "W"]
|
||||||
"C0116", # (missing-function-docstring)
|
|
||||||
"R0903", # (too-few-public-methods)
|
[tool.ruff.format]
|
||||||
"R0913", # (too-many-arguments)
|
docstring-code-line-length = 88
|
||||||
"W0105", # (pointless-string-statement)
|
|
||||||
]
|
# [tool.pylint]
|
||||||
|
# max-line-length = 88
|
||||||
|
# disable = [
|
||||||
|
# "C0103", # (invalid-name)
|
||||||
|
# "C0114", # (missing-module-docstring)
|
||||||
|
# "C0115", # (missing-class-docstring)
|
||||||
|
# "C0116", # (missing-function-docstring)
|
||||||
|
# "R0903", # (too-few-public-methods)
|
||||||
|
# "R0913", # (too-many-arguments)
|
||||||
|
# "W0105", # (pointless-string-statement)
|
||||||
|
# ]
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["poetry-core"]
|
requires = ["uv_build>=0.9.18,<0.10.0"]
|
||||||
build-backend = "poetry.core.masonry.api"
|
build-backend = "uv_build"
|
||||||
|
|||||||
@@ -11,3 +11,5 @@ from .parse_cmx_events import parse_cmx3600
|
|||||||
from .transition import Transition
|
from .transition import Transition
|
||||||
from .event import Event
|
from .event import Event
|
||||||
from .edit import Edit
|
from .edit import Edit
|
||||||
|
|
||||||
|
__all__ = ("parse_cmx3600", "Transition", "Event", "Edit")
|
||||||
@@ -35,7 +35,6 @@ class Edit:
|
|||||||
asc_sat_statement: Optional[StmtCdlSat] = None,
|
asc_sat_statement: Optional[StmtCdlSat] = None,
|
||||||
frmc_statement: Optional[StmtFrmc] = None,
|
frmc_statement: Optional[StmtFrmc] = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
# Assigning types for the attributes explicitly
|
|
||||||
self._edit_statement: StmtEvent = edit_statement
|
self._edit_statement: StmtEvent = edit_statement
|
||||||
self._audio_ext: Optional[StmtAudioExt] = audio_ext_statement
|
self._audio_ext: Optional[StmtAudioExt] = audio_ext_statement
|
||||||
self._clip_name_statement: Optional[StmtClipName] = clip_name_statement
|
self._clip_name_statement: Optional[StmtClipName] = clip_name_statement
|
||||||
@@ -51,8 +50,8 @@ class Edit:
|
|||||||
def line_number(self) -> int:
|
def line_number(self) -> int:
|
||||||
"""
|
"""
|
||||||
Get the line number for the "standard form" statement associated with
|
Get the line number for the "standard form" statement associated with
|
||||||
this edit. Line numbers a zero-indexed, such that the
|
this edit. Line numbers a zero-indexed, such that the "TITLE:" record
|
||||||
"TITLE:" record is line zero.
|
is line zero.
|
||||||
"""
|
"""
|
||||||
return self._edit_statement.line_number
|
return self._edit_statement.line_number
|
||||||
|
|
||||||
@@ -180,7 +179,7 @@ class Edit:
|
|||||||
@property
|
@property
|
||||||
def asc_sop_raw(self) -> Optional[str]:
|
def asc_sop_raw(self) -> Optional[str]:
|
||||||
"""
|
"""
|
||||||
ASC CDL Slope-Offset-Power statement raw line
|
ASC CDL Slope-Offset-Power statement raw line.
|
||||||
"""
|
"""
|
||||||
if self._asc_sop_statement is None:
|
if self._asc_sop_statement is None:
|
||||||
return None
|
return None
|
||||||
@@ -190,7 +189,7 @@ class Edit:
|
|||||||
@property
|
@property
|
||||||
def asc_sat(self) -> Optional[float]:
|
def asc_sat(self) -> Optional[float]:
|
||||||
"""
|
"""
|
||||||
Get ASC CDL saturation value for clip, if present
|
Get ASC CDL saturation value for clip, if present.
|
||||||
"""
|
"""
|
||||||
if self._asc_sat_statement is None:
|
if self._asc_sat_statement is None:
|
||||||
return None
|
return None
|
||||||
@@ -12,7 +12,7 @@ from typing import Any, Generator
|
|||||||
class EditList:
|
class EditList:
|
||||||
"""
|
"""
|
||||||
Represents an entire edit decision list as returned by
|
Represents an entire edit decision list as returned by
|
||||||
:func:`~pycmx.parse_cmx3600()`.
|
:func:`~pycmx.parse_cmx_events.parse_cmx3600()`.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, statements: list):
|
def __init__(self, statements: list):
|
||||||
@@ -5,8 +5,6 @@ from typing import Any, NamedTuple
|
|||||||
|
|
||||||
from .cdl import AscSopComponents
|
from .cdl import AscSopComponents
|
||||||
|
|
||||||
# type str = str
|
|
||||||
|
|
||||||
|
|
||||||
class StmtTitle(NamedTuple):
|
class StmtTitle(NamedTuple):
|
||||||
title: str
|
title: str
|
||||||
@@ -24,7 +24,7 @@ class Transition:
|
|||||||
@property
|
@property
|
||||||
def kind(self) -> Optional[str]:
|
def kind(self) -> Optional[str]:
|
||||||
"""
|
"""
|
||||||
Return the kind of transition: Cut, Wipe, etc
|
Return the kind of transition: Cut, Wipe, etc.
|
||||||
"""
|
"""
|
||||||
if self.cut:
|
if self.cut:
|
||||||
return Transition.Cut
|
return Transition.Cut
|
||||||
@@ -56,7 +56,8 @@ class Transition:
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def effect_duration(self) -> int:
|
def effect_duration(self) -> int:
|
||||||
"""The duration of this transition, in frames of the record target.
|
"""
|
||||||
|
The duration of this transition, in frames of the record target.
|
||||||
|
|
||||||
In the event of a key event, this is the duration of the fade in.
|
In the event of a key event, this is the duration of the fade in.
|
||||||
"""
|
"""
|
||||||
Reference in New Issue
Block a user