You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The parser.Parser class should provide a public method to access the defined keys of the underlying file format.
User Story
As a developer, I want to programmatically extract the defined identifiers of a given filename format, so I can know in advance which metadata is available before getting an actual filename or manually inspect the format.
Current Workaround(s)
Parse a valid filename and look at the result keys.
Use a string formatter: {field_name for literal_text, field_name, format_spec, conversion in string.Formatter().parse(fmt)}
The text was updated successfully, but these errors were encountered:
Your workaround and looking at the existing code makes me wonder if we should maybe update the Parser class to do some of the format string specific stuff on __init__ and use it in all sub-methods/functions as an optimization. Like the conversion dictionary. I'm not sure that would be something users would need access to, but could be a nice little optimization.
At this point I guess I'll say "pull requests welcome" 😉
Feature Request
Description
The
parser.Parser
class should provide a public method to access the defined keys of the underlying file format.User Story
As a developer, I want to programmatically extract the defined identifiers of a given filename format, so I can know in advance which metadata is available before getting an actual filename or manually inspect the format.
Current Workaround(s)
{field_name for literal_text, field_name, format_spec, conversion in string.Formatter().parse(fmt)}
The text was updated successfully, but these errors were encountered: