From d0da79b31b35bba3ee4fd84e543912a8c966a3f7 Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Sat, 2 Oct 2021 15:50:44 -0700 Subject: [PATCH 01/20] Create Export Items as Text.py --- reaper/Export Items as Text.py | 62 ++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 reaper/Export Items as Text.py diff --git a/reaper/Export Items as Text.py b/reaper/Export Items as Text.py new file mode 100644 index 0000000..fce6828 --- /dev/null +++ b/reaper/Export Items as Text.py @@ -0,0 +1,62 @@ +# Export Items as Text.py +# (c) 2021 Jamie Hardt. All rights reserved. +# +# + +import json +import os.path +import datetime + +item_records = list() + +for i in range(0, RPR_CountMediaItems(0) ): + this_item = RPR_GetMediaItem(0, i) + + item_record = {} + item_record["mute"] = True if RPR_GetMediaItemInfo_Value(this_item, "B_MUTE_ACTUAL") > 0. else False + + item_record["duration"] = RPR_GetMediaItemInfo_Value(this_item, "D_LENGTH") + _, item_record["duration_tc"], _, _, _ = RPR_format_timestr_len(item_record["duration"], "", 128, 0., 5) + + item_record["position"] = RPR_GetMediaItemInfo_Value(this_item, "D_POSITION") + _, item_record["position_tc"], _, _ = RPR_format_timestr_pos(item_record["position"], "", 128, 5) + + item_record["selected"] = True if RPR_GetMediaItemInfo_Value(this_item, "B_UISEL") > 0. else False + _, _, _, item_record["notes"], _ = RPR_GetSetMediaItemInfo_String(this_item, "P_NOTES", "", False) + _, _, _, item_record["item_guid"], _ = RPR_GetSetMediaItemInfo_String(this_item, "GUID", "", False) + + active_take = RPR_GetActiveTake(this_item) + _, _, _, item_record["active_take_name"], _ = RPR_GetSetMediaItemTakeInfo_String(active_take, "P_NAME", "", False) + _, _, _, item_record["active_take_guid"], _ = RPR_GetSetMediaItemTakeInfo_String(active_take, "GUID", "", False) + + item_track = RPR_GetMediaItemTrack(this_item) + _, _, _, item_record["track_name"], _ = RPR_GetSetMediaTrackInfo_String(item_track, "P_NAME", "", False) + _, _, _, item_record["track_guid"], _ = RPR_GetSetMediaTrackInfo_String(item_track, "GUID", "", False) + item_record["track_index"] = RPR_GetMediaTrackInfo_Value(item_track, "IP_TRACKNUMBER") + item_record["track_muted"] = True if RPR_GetMediaTrackInfo_Value(item_track, "B_MUTE") > 0. else False + + item_records = item_records + [item_record] + +output = dict() +output["items"] = item_records +_, output["project_title"], _ = RPR_GetProjectName(0, "", 1024) +_, _, output["project_author"], _ = RPR_GetSetProjectAuthor(0, False, "", 1024) +output["project_frame_rate"], _, output["project_drop_frame"] = RPR_TimeMap_curFrameRate(0, True) + +output_path, _ = RPR_GetProjectPath("", 1024) + +now = datetime.datetime.now() +output_title = output["project_title"] + +if output_title == "": + output_title = "unsaved project" + +output_file_name = "%s Text Export %s.txt" % (output_title, now.strftime('%Y%m%d_%H%M')) +output_path = output_path + "/" + output_file_name + +with open(output_path, "w") as f: + json.dump(output, f, allow_nan=True, indent=4) + +RPR_ShowMessageBox("Exported text file \"%s\" to project folder." % output_file_name, "Text Export Complete", 0) + +#RPR_ShowConsoleMsg(output_path) \ No newline at end of file From 68969e77e2a3c548a57a664375572d25a5a2366f Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Sat, 2 Oct 2021 16:26:56 -0700 Subject: [PATCH 02/20] Hard wrap text --- README.md | 76 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 43 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 8c83f3a..0d54784 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,9 @@ Read Pro Tools text exports and generate JSON, PDF reports. ## Notice! -At this time there are a lot of changes in the HEAD of this package and you should use the last posted Pypi package. -New features and much better reporting, including native PDF reports, are coming soon! +At this time there are a lot of changes in the HEAD of this package and you +should use the last posted Pypi package. New features and much better +reporting, including native PDF reports, are coming soon! ## Installation @@ -17,40 +18,43 @@ The easiest way to install on your site is to use `pip`: % pip3 install ptulsconv -This will install the necessary libraries on your host and gives you command-line access to the tool through an -entry-point `ptulsconv`. In a terminal window type `ptulsconv -h` for a list of available options. +This will install the necessary libraries on your host and gives you +command-line access to the tool through an entry-point `ptulsconv`. In a +terminal window type `ptulsconv -h` for a list of available options. ## Theory of Operation -[Avid Pro Tools][avp] exports a tab-delimited text file organized in multiple parts with an uneven syntax that usually -can't "drop in" to other tools like Excel or Filemaker. This tool accepts a text export from Pro Tools and produces an -XML file in the `FMPXMLRESULT` schema which Filemaker Pro can import directly into a new table. +[Avid Pro Tools][avp] exports a tab-delimited text file organized in multiple +parts with an uneven syntax that usually can't "drop in" to other tools like +Excel or Filemaker. This tool accepts a text export from Pro Tools and produces +an + +... -In the default mode, all of the clips are parsed and converted into a flat list of events, one Filemaker Pro row per -clip with a start and finish time, track name, session name, etc. Timecodes are parsed and converted into frame counts -and seconds. Text is then parsed for descriptive meta-tags and these are assigned to columns in the output list. [avp]: http://www.avid.com/pro-tools ### Fields in Clip Names -Track names, track comments, and clip names can also contain meta-tags, or "fields," to add additional columns to the -output. Thus, if a clip has the name: +Track names, track comments, and clip names can also contain meta-tags, or +"fields," to add additional columns to the output. Thus, if a clip has the +name: `Fireworks explosion {note=Replace for final} $V=1 [FX] [DESIGN]` The row output for this clip will contain columns for the values: -|...| PT.Clip.Name| note | V | FX | DESIGN | ...| -|---|------------|------|---|----|--------|----| +|...| PT.Clip.Name | note | V | FX | DESIGN | ... | +|---|--------------------|-------------------|---|----|--------|-----| |...| Fireworks explosion| Replace for final | 1 | FX | DESIGN | ... | These fields can be defined in the clip name in three ways: * `$NAME=VALUE` creates a field named `NAME` with a one-word value `VALUE`. -* `{NAME=VALUE}` creates a field named `NAME` with the value `VALUE`. `VALUE` in this case may contain spaces or any - character up to the closing bracket. -* `[NAME]` creates a field named `NAME` with a value `NAME`. This can be used to create a boolean-valued field; in the - output, clips with the field will have it, and clips without will have the column with an empty value. +* `{NAME=VALUE}` creates a field named `NAME` with the value `VALUE`. `VALUE` + in this case may contain spaces or any character up to the closing bracket. +* `[NAME]` creates a field named `NAME` with a value `NAME`. This can be used + to create a boolean-valued field; in the output, clips with the field will + have it, and clips without will have the column with an empty value. For example, if two clips are named: @@ -68,30 +72,36 @@ The output will contain the range: ### Fields in Track Names and Markers -Fields set in track names, and in track comments, will be applied to each clip on that track. If a track comment -contains the text `{Dept=Foley}` for example, every clip on that track will have a "Foley" value in a "Dept" column. +Fields set in track names, and in track comments, will be applied to each clip +on that track. If a track comment contains the text `{Dept=Foley}` for +example, every clip on that track will have a "Foley" value in a "Dept" column. Likewise, fields set on the session name will apply to all clips in the session. -Fields set in markers, and in marker comments, will be applied to all clips whose finish is *after* that marker. Fields -in markers are applied cumulatively from breakfast to dinner in the session. The latest marker applying to a clip has -precedence, so if one marker comes after the other, but both define a field, the value in the later marker +Fields set in markers, and in marker comments, will be applied to all clips +whose finish is *after* that marker. Fields in markers are applied cumulatively +from breakfast to dinner in the session. The latest marker applying to a clip +has precedence, so if one marker comes after the other, but both define a +field, the value in the later marker prevails. -An important note here is that, always, fields set on the clip name have the highest precedence. If a field is set in a clip -name, the same field set on the track, the value set on the clip will prevail. +An important note here is that, always, fields set on the clip name have the +highest precedence. If a field is set in a clip name, the same field set on the +track, the value set on the clip will prevail. ### Using `@` to Apply Fields to a Span of Clips -A clip name beginning with "@" will not be included in the CSV output, but its fields will be applied to clips within -its time range on lower tracks. +A clip name beginning with "@" will not be included in the CSV output, but its +fields will be applied to clips within its time range on lower tracks. -If track 1 has a clip named `@ {Sc=1- The House}`, any clips beginning within that range on lower tracks will have a -field `Sc` with that value. +If track 1 has a clip named `@ {Sc=1- The House}`, any clips beginning within +that range on lower tracks will have a field `Sc` with that value. ### Using `&` to Combine Clips -A clip name beginning with "&" will have its parsed clip name appended to the preceding cue, and the fields of following -cues will be applied (later clips having precedence). The clips need not be touching, and the clips will be combined -into a single row of the output. The start time of the first clip will become the start time of the row, and the finish -time of the last clip will become the finish time of the row. +A clip name beginning with "&" will have its parsed clip name appended to the +preceding cue, and the fields of following cues will be applied (later clips +having precedence). The clips need not be touching, and the clips will be +combined into a single row of the output. The start time of the first clip +will become the start time of the row, and the finish time of the last clip +will become the finish time of the row. From 81cdca5452fb02e733596b240ebd5fce7ff48b60 Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Sat, 2 Oct 2021 16:50:09 -0700 Subject: [PATCH 03/20] Added 3.9 to Travis tests --- .travis.yml | 3 ++- setup.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 118a290..9c79e42 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,8 @@ language: python python: - "3.7" - - "3.8 + - "3.8" + - "3.9" script: - "python -m unittest discover tests" install: diff --git a/setup.py b/setup.py index c05a291..f276f9b 100644 --- a/setup.py +++ b/setup.py @@ -25,9 +25,9 @@ setup(name='ptulsconv', 'Topic :: Multimedia :: Sound/Audio', "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.8", "Development Status :: 4 - Beta", - "Topic :: Text Processing :: Filters", - "Topic :: Text Processing :: Markup :: XML"], + "Topic :: Text Processing :: Filters"], packages=['ptulsconv'], keywords='text-processing parsers film tv editing editorial', install_requires=['parsimonious', 'tqdm', 'reportlab'], From 9043d28a21efbc211fff6576c6395b83a35fb9b7 Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Sat, 2 Oct 2021 16:53:19 -0700 Subject: [PATCH 04/20] Create python-package.yml --- .github/workflows/python-package.yml | 40 ++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/python-package.yml diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml new file mode 100644 index 0000000..b55b361 --- /dev/null +++ b/.github/workflows/python-package.yml @@ -0,0 +1,40 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Python package + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: [3.7, 3.8, 3.9] + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install flake8 pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + pytest From 02a96d71436f38f7993ab880abeb82557427c72a Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Sat, 2 Oct 2021 16:56:00 -0700 Subject: [PATCH 05/20] Update python-package.yml --- .github/workflows/python-package.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index b55b361..ed9d9b1 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -32,9 +32,9 @@ jobs: - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + flake8 ptulsconv tests --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + flake8 ptulsconv tests --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest run: | pytest From 7cd86332e891f392e6f4779b6d49174304e9338f Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Sat, 2 Oct 2021 17:00:35 -0700 Subject: [PATCH 06/20] Update python-package.yml --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index ed9d9b1..8af54bb 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -37,4 +37,4 @@ jobs: flake8 ptulsconv tests --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest run: | - pytest + PYTHONPATH=. pytest From a06b8c8aaa52ca3c26504373b25b0ffa422567e8 Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Sat, 2 Oct 2021 17:01:36 -0700 Subject: [PATCH 07/20] Delete .travis.yml --- .travis.yml | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 9c79e42..0000000 --- a/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: python -python: - - "3.7" - - "3.8" - - "3.9" -script: - - "python -m unittest discover tests" -install: - - "pip install setuptools" - - "pip install parsimonious tqdm" From ed2a916673a8c767c75e74b4caa68f99c4489397 Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Sat, 2 Oct 2021 17:06:45 -0700 Subject: [PATCH 08/20] Update python-package.yml --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 8af54bb..abcf070 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -1,7 +1,7 @@ # This workflow will install Python dependencies, run tests and lint with a variety of Python versions # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions -name: Python package +name: Lint and Test on: push: From 6f2ec325cf522b13c10b59fd66cef388978aaa49 Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Sat, 2 Oct 2021 17:16:57 -0700 Subject: [PATCH 09/20] Update README.md --- README.md | 52 ++++++++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 0d54784..0361381 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,33 @@ -[![Build Status](https://travis-ci.com/iluvcapra/ptulsconv.svg?branch=master)](https://travis-ci.com/iluvcapra/ptulsconv) - ![](https://img.shields.io/github/license/iluvcapra/ptulsconv.svg) ![](https://img.shields.io/pypi/pyversions/ptulsconv.svg) [![](https://img.shields.io/pypi/v/ptulsconv.svg)](https://pypi.org/project/ptulsconv/) ![](https://img.shields.io/pypi/wheel/ptulsconv.svg) - - ![Upload Python Package](https://github.com/iluvcapra/ptulsconv/workflows/Upload%20Python%20Package/badge.svg) - +![](https://img.shields.io/github/license/iluvcapra/ptulsconv.svg) +![](https://img.shields.io/pypi/pyversions/ptulsconv.svg) +[![](https://img.shields.io/pypi/v/ptulsconv.svg)][pypi] +![](https://img.shields.io/pypi/wheel/ptulsconv.svg) + +![Lint and Test](https://github.com/iluvcapra/ptulsconv/actions/workflows/python-package.yml/badge.svg) + +[pypi]: https://pypi.org/project/ptulsconv/ + + # ptulsconv -Read Pro Tools text exports and generate JSON, PDF reports. -## Notice! - -At this time there are a lot of changes in the HEAD of this package and you -should use the last posted Pypi package. New features and much better -reporting, including native PDF reports, are coming soon! +Read Pro Tools text exports and generate PDF reports, JSON output. + +## Theory of Operation + +[Avid Pro Tools][avp] can be used to make spotting notes for ADR recording +sessions by creating spotting regions with descriptive text and exporting the +session as text. This file can then be dropped into Excel or any CSV-reading +app like Filemaker Pro. + +**ptulsconv** accepts a text export from Pro Tools and automatically creates +PDF and CSV documents for use in ADR spotting, recording, editing and +reporting, and supplemental JSON documents can be output for use with other +workflows. + + +[avp]: http://www.avid.com/pro-tools + ## Installation The easiest way to install on your site is to use `pip`: @@ -22,19 +38,7 @@ This will install the necessary libraries on your host and gives you command-line access to the tool through an entry-point `ptulsconv`. In a terminal window type `ptulsconv -h` for a list of available options. -## Theory of Operation - -[Avid Pro Tools][avp] exports a tab-delimited text file organized in multiple -parts with an uneven syntax that usually can't "drop in" to other tools like -Excel or Filemaker. This tool accepts a text export from Pro Tools and produces -an - -... - - -[avp]: http://www.avid.com/pro-tools - -### Fields in Clip Names +### Adding Detailed Info to Clip Names with Fields Track names, track comments, and clip names can also contain meta-tags, or "fields," to add additional columns to the output. Thus, if a clip has the From ee407e9e622586f32dbb56653fd63c346433e2c7 Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Sat, 2 Oct 2021 17:17:45 -0700 Subject: [PATCH 10/20] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0361381..d71f163 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,6 @@ ![](https://img.shields.io/pypi/pyversions/ptulsconv.svg) [![](https://img.shields.io/pypi/v/ptulsconv.svg)][pypi] ![](https://img.shields.io/pypi/wheel/ptulsconv.svg) - ![Lint and Test](https://github.com/iluvcapra/ptulsconv/actions/workflows/python-package.yml/badge.svg) [pypi]: https://pypi.org/project/ptulsconv/ From 539cae15b77270b0f4e6f4b22209bfda7cb7cbae Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Sat, 2 Oct 2021 17:26:26 -0700 Subject: [PATCH 11/20] Update README.md --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index d71f163..8f80130 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,22 @@ PDF and CSV documents for use in ADR spotting, recording, editing and reporting, and supplemental JSON documents can be output for use with other workflows. +### Reports Generated by ptulsconv by Default + +1. "ADR Report" lists every line in an export with most useful fields, sorted + by time. +2. "Continuity" lists every scene sorted by time. +3. "Line Count" lists a count of every line, collated by reel number and by + effort/TV/optional line designation. +4. "CSV" is a folder of files of all lines collated by character and reel + as CSV files, for use by studio cueing workflows. +5. "Director Logs" is a folder of PDFs formatted like the "ADR Report" except + collated by character. +6. "Supervisor Logs" creates a PDF report for every character, with one line + per page, optimized for note-taking. +7. "Talent Scripts" is a minimal PDF layout of just timecode and line prompt, + collated by character. + [avp]: http://www.avid.com/pro-tools From e5f94bb506d9beb4d0955ccca9812d7f75c349f6 Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Sat, 2 Oct 2021 17:33:11 -0700 Subject: [PATCH 12/20] Reorganized README a little --- README.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 8f80130..0a358ec 100644 --- a/README.md +++ b/README.md @@ -43,15 +43,6 @@ workflows. [avp]: http://www.avid.com/pro-tools -## Installation - -The easiest way to install on your site is to use `pip`: - - % pip3 install ptulsconv - -This will install the necessary libraries on your host and gives you -command-line access to the tool through an entry-point `ptulsconv`. In a -terminal window type `ptulsconv -h` for a list of available options. ### Adding Detailed Info to Clip Names with Fields @@ -124,3 +115,13 @@ combined into a single row of the output. The start time of the first clip will become the start time of the row, and the finish time of the last clip will become the finish time of the row. + +## Installation + +The easiest way to install on your site is to use `pip`: + + % pip3 install ptulsconv + +This will install the necessary libraries on your host and gives you +command-line access to the tool through an entry-point `ptulsconv`. In a +terminal window type `ptulsconv -h` for a list of available options. \ No newline at end of file From 88d9aef92a5da1b3c9652ea54f243b487e6bd0b6 Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Sat, 2 Oct 2021 17:34:09 -0700 Subject: [PATCH 13/20] Update __init__.py Bumped version --- ptulsconv/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ptulsconv/__init__.py b/ptulsconv/__init__.py index 2fbdf43..285400a 100644 --- a/ptulsconv/__init__.py +++ b/ptulsconv/__init__.py @@ -1,5 +1,5 @@ from ptulsconv.docparser.ptuls_grammar import protools_text_export_grammar -__version__ = '0.8.0' +__version__ = '0.8.1' __author__ = 'Jamie Hardt' __license__ = 'MIT' From 1228e2adbe4faf352bb1ec9c0139a25c0c0dac9c Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Sat, 2 Oct 2021 17:42:09 -0700 Subject: [PATCH 14/20] Manpage 0.8.2 bump --- man/ptulsconv.1 | 24 ++---------------------- ptulsconv/__init__.py | 2 +- setup.py | 2 +- 3 files changed, 4 insertions(+), 24 deletions(-) diff --git a/man/ptulsconv.1 b/man/ptulsconv.1 index 70442b5..f02858c 100644 --- a/man/ptulsconv.1 +++ b/man/ptulsconv.1 @@ -1,38 +1,18 @@ .\" Manpage for ptulsconv .\" Contact https://github.com/iluvcapra/ptulsconv -.TH ptulsconv 1 "15 May 2020" "0.4.0" "ptulsconv man page" +.TH ptulsconv 1 "15 May 2020" "0.8.2" "ptulsconv man page" .SH NAME .BR "ptulsconv" " \- convert .IR "Avid Pro Tools" " text exports" .SH SYNOPSIS ptulsconv [OPTIONS] Export.txt .SH DESCRIPTION -Convert a Pro Tools text export into a flat list of clip names with timecodes. A tagging -language is interpreted to add columns and type the data. The default output format is -an XML file for import into Filemaker Pro. +Convert a Pro Tools text export into ADR reports. .SH OPTIONS .IP "-h, --help" show a help message and exit. -.TP -.RI "-i " "TC" -Drop events before this timecode. -.TP -.RI "-o " "TC" -Drop events after this timecode. -.TP -.RI "-m " -Include muted clips. -.TP -.RI "--json " -Output a JSON document instead of XML. (--xform will have no effect.) -.TP -.RI "--xform " "NAME" -Convert the output with a built-in output transform. .TP .RI "--show-available-tags" Print a list of tags that are interpreted and exit. -.TP -.RI "--show-available-transforms" -Print a list of built-in output transforms and exit. .SH AUTHOR Jamie Hardt (contact at https://github.com/iluvcapra/ptulsconv) diff --git a/ptulsconv/__init__.py b/ptulsconv/__init__.py index 285400a..8bb00ec 100644 --- a/ptulsconv/__init__.py +++ b/ptulsconv/__init__.py @@ -1,5 +1,5 @@ from ptulsconv.docparser.ptuls_grammar import protools_text_export_grammar -__version__ = '0.8.1' +__version__ = '0.8.2' __author__ = 'Jamie Hardt' __license__ = 'MIT' diff --git a/setup.py b/setup.py index f276f9b..4382a7c 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ setup(name='ptulsconv', 'Topic :: Multimedia :: Sound/Audio', "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", "Development Status :: 4 - Beta", "Topic :: Text Processing :: Filters"], packages=['ptulsconv'], From 6c76827f4266c031412b7e4384595bb620dd34e0 Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Sat, 2 Oct 2021 19:21:13 -0700 Subject: [PATCH 15/20] Update README.md --- README.md | 72 ------------------------------------------------------- 1 file changed, 72 deletions(-) diff --git a/README.md b/README.md index 0a358ec..f43ae87 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ ![](https://img.shields.io/github/license/iluvcapra/ptulsconv.svg) ![](https://img.shields.io/pypi/pyversions/ptulsconv.svg) [![](https://img.shields.io/pypi/v/ptulsconv.svg)][pypi] -![](https://img.shields.io/pypi/wheel/ptulsconv.svg) ![Lint and Test](https://github.com/iluvcapra/ptulsconv/actions/workflows/python-package.yml/badge.svg) [pypi]: https://pypi.org/project/ptulsconv/ @@ -44,77 +43,6 @@ workflows. [avp]: http://www.avid.com/pro-tools -### Adding Detailed Info to Clip Names with Fields - -Track names, track comments, and clip names can also contain meta-tags, or -"fields," to add additional columns to the output. Thus, if a clip has the -name: - -`Fireworks explosion {note=Replace for final} $V=1 [FX] [DESIGN]` - -The row output for this clip will contain columns for the values: - -|...| PT.Clip.Name | note | V | FX | DESIGN | ... | -|---|--------------------|-------------------|---|----|--------|-----| -|...| Fireworks explosion| Replace for final | 1 | FX | DESIGN | ... | - -These fields can be defined in the clip name in three ways: -* `$NAME=VALUE` creates a field named `NAME` with a one-word value `VALUE`. -* `{NAME=VALUE}` creates a field named `NAME` with the value `VALUE`. `VALUE` - in this case may contain spaces or any character up to the closing bracket. -* `[NAME]` creates a field named `NAME` with a value `NAME`. This can be used - to create a boolean-valued field; in the output, clips with the field will - have it, and clips without will have the column with an empty value. - -For example, if two clips are named: - -`"Squad fifty-one, what is your status?" [FUTZ] {Ch=Dispatcher} [ADR]` - -`"We are ten-eight at Rampart Hospital." {Ch=Gage} [ADR]` - -The output will contain the range: - -|...| PT.Clip.Name| Ch | FUTZ | ADR | ...| -|---|------------|------|---|----|-----| -|...| "Squad fifty-one, what is your status?"| Dispatcher | FUTZ | ADR | ... | -|...| "We are ten-eight at Rampart Hospital."| Gage | | ADR | ... | - - -### Fields in Track Names and Markers - -Fields set in track names, and in track comments, will be applied to each clip -on that track. If a track comment contains the text `{Dept=Foley}` for -example, every clip on that track will have a "Foley" value in a "Dept" column. - -Likewise, fields set on the session name will apply to all clips in the session. - -Fields set in markers, and in marker comments, will be applied to all clips -whose finish is *after* that marker. Fields in markers are applied cumulatively -from breakfast to dinner in the session. The latest marker applying to a clip -has precedence, so if one marker comes after the other, but both define a -field, the value in the later marker prevails. - -An important note here is that, always, fields set on the clip name have the -highest precedence. If a field is set in a clip name, the same field set on the -track, the value set on the clip will prevail. - -### Using `@` to Apply Fields to a Span of Clips - -A clip name beginning with "@" will not be included in the CSV output, but its -fields will be applied to clips within its time range on lower tracks. - -If track 1 has a clip named `@ {Sc=1- The House}`, any clips beginning within -that range on lower tracks will have a field `Sc` with that value. - -### Using `&` to Combine Clips - -A clip name beginning with "&" will have its parsed clip name appended to the -preceding cue, and the fields of following cues will be applied (later clips -having precedence). The clips need not be touching, and the clips will be -combined into a single row of the output. The start time of the first clip -will become the start time of the row, and the finish time of the last clip -will become the finish time of the row. - ## Installation From c1671f3656eebec9b8e15ffac36b23234e8064e5 Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Mon, 4 Oct 2021 10:47:14 -0700 Subject: [PATCH 16/20] Twiddles, testing Working Copy --- ptulsconv/pdf/__init__.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/ptulsconv/pdf/__init__.py b/ptulsconv/pdf/__init__.py index cb3aea3..4dfe528 100644 --- a/ptulsconv/pdf/__init__.py +++ b/ptulsconv/pdf/__init__.py @@ -71,14 +71,19 @@ def make_doc_template(page_size, filename, document_title, footer_box, page_box = page_box.split_y(0.25 * inch, direction='u') header_box, page_box = page_box.split_y(0.75 * inch, direction='d') title_box, report_box = header_box.split_x(3.5 * inch, direction='r') - + + on_page_lambda = lambda c, _: + draw_header_footer(c, report_box, title_box, + footer_box,title=title, + supervisor=supervisor, + document_subheader=document_subheader, + client=client, doc_title=document_header) + + frames = [Frame(page_box.min_x, page_box.min_y, page_box.width, page_box.height)] + page_template = PageTemplate(id="Main", - frames=[Frame(page_box.min_x, page_box.min_y, page_box.width, page_box.height)], - onPage=lambda c, _: draw_header_footer(c, report_box, title_box, footer_box, - title=title, supervisor=supervisor, - document_subheader=document_subheader, - client=client, - doc_title=document_header)) + frames=frames, + onPage=on_page_lambda) pdfmetrics.registerFont(TTFont('Futura', 'Futura.ttc')) doc = ADRDocTemplate(filename, From 80729443d1196d1ba4c6f1e99b0e1fe49a9d4538 Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Mon, 4 Oct 2021 10:54:43 -0700 Subject: [PATCH 17/20] Tweaked typo --- ptulsconv/pdf/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ptulsconv/pdf/__init__.py b/ptulsconv/pdf/__init__.py index 4dfe528..d9ca587 100644 --- a/ptulsconv/pdf/__init__.py +++ b/ptulsconv/pdf/__init__.py @@ -72,12 +72,12 @@ def make_doc_template(page_size, filename, document_title, header_box, page_box = page_box.split_y(0.75 * inch, direction='d') title_box, report_box = header_box.split_x(3.5 * inch, direction='r') - on_page_lambda = lambda c, _: + on_page_lambda = (lambda c, _: draw_header_footer(c, report_box, title_box, footer_box,title=title, supervisor=supervisor, document_subheader=document_subheader, - client=client, doc_title=document_header) + client=client, doc_title=document_header)) frames = [Frame(page_box.min_x, page_box.min_y, page_box.width, page_box.height)] From 961d68df214a748f1db40f255518e8278cba7f2f Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Tue, 11 Jan 2022 12:11:45 -0800 Subject: [PATCH 18/20] Update python-package.yml Added 3.10 to python versions --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index abcf070..d4ba2b0 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [3.7, 3.8, 3.9] + python-version: [3.7, 3.8, 3.9, 3.10] steps: - uses: actions/checkout@v2 From b80e59335065f2208067facdac4492b5b1d890e6 Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Tue, 11 Jan 2022 12:12:44 -0800 Subject: [PATCH 19/20] Update python-package.yml --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index d4ba2b0..c8dded9 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [3.7, 3.8, 3.9, 3.10] + python-version: [3.7, 3.8, 3.9, "3.10"] steps: - uses: actions/checkout@v2 From dc11a40530a8e5c6b7502f97d90a1c5ec8a2a2d8 Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Tue, 11 Jan 2022 12:14:11 -0800 Subject: [PATCH 20/20] Update setup.py Added 3.10 --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 4382a7c..a5220c7 100644 --- a/setup.py +++ b/setup.py @@ -26,6 +26,7 @@ setup(name='ptulsconv', "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", "Development Status :: 4 - Beta", "Topic :: Text Processing :: Filters"], packages=['ptulsconv'],