Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added otiotool --remove-metadata-key option #1642

Merged
merged 3 commits into from
Aug 25, 2023

Conversation

jminor
Copy link
Collaborator

@jminor jminor commented Jul 22, 2023

This PR adds a new --remove-metadata-key feature to otiotool. If specified, this option looks for the given metadata key(s) on all objects in the OTIO and removes it when found. This could be used to remove private, sensitive, or extraneous metadata from an OTIO.

  --remove-metadata-key KEY(s) [KEY(s) ...]
                        Remove one or more metadata keys from all objects.

This PR also improves the otiotool usage docs, adding some examples, clarifying some arguments, and making the short summary more readable by using the --long-options instead of single-letter options.

usage: otiotool [-h] [--input PATHs) [PATH(s) ...]] [--video-only] [--audio-only] [--only-tracks-with-name NAME(s) [NAME(s) ...]]
                [--only-tracks-with-index INDEX(es) [INDEX(es) ...]] [--only-clips-with-name NAME(s) [NAME(s) ...]]
                [--only-clips-with-name-regex REGEX(es) [REGEX(es) ...]] [--remove-transitions] [--trim START END] [--flatten TYPE] [--keep-flattened-tracks]
                [--stack] [--concat] [--relink-by-name FOLDER(s) [FOLDER(s) ...]] [--copy-media-to-folder FOLDER] [--remove-metadata-key KEY(s) [KEY(s) ...]]
                [--redact] [--stats] [--list-clips] [--list-tracks] [--list-media] [--verify-media] [--list-markers] [--inspect NAME(s) [NAME(s ...]]
                [--downgrade FAMILY:VERSION] [--list-versions] [--output PATH]

@codecov-commenter
Copy link

codecov-commenter commented Jul 22, 2023

Codecov Report

Merging #1642 (6c65bf2) into main (eaf8569) will decrease coverage by 0.08%.
The diff coverage is 9.09%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1642      +/-   ##
==========================================
- Coverage   79.91%   79.83%   -0.08%     
==========================================
  Files         197      197              
  Lines       21731    21753      +22     
  Branches     4339     4350      +11     
==========================================
+ Hits        17366    17367       +1     
- Misses       2213     2233      +20     
- Partials     2152     2153       +1     
Flag Coverage Δ
py-unittests 79.83% <9.09%> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
...-opentimelineio/opentimelineio/console/otiotool.py 66.21% <9.09%> (-3.65%) ⬇️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update eaf8569...6c65bf2. Read the comment docs.

Copy link
Contributor

@apetrynet apetrynet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I read this correctly it will only remove a key from the "top level" of a metadata dict.
I believe this will suffice in most cases, but we should perhaps mention this in the docs?

@ssteinbach ssteinbach added this to the Public Beta 16 milestone Jul 22, 2023
@jminor
Copy link
Collaborator Author

jminor commented Aug 23, 2023

@apetrynet I addressed your note about "top level" in the usage statement. Does that look good to you?

Copy link
Contributor

@apetrynet apetrynet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me @jminor
I also like the more verbose help strings in the other arguments.

@jminor jminor merged commit 8d099cc into AcademySoftwareFoundation:main Aug 25, 2023
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants