-1

I am trying to make a parser of file paths that follow an arbitrary naming convention.

I am wanting to take an arbitrary string.Template and get the re.Match.groupdict() corresponding to a string that follows the string.Template. I would also like to specify the delimiter of the string template such as $Name1-$Name2 or $Name1_$Name2 both returning {'Name1': 'foo', 'Name2': 'bar'} for the respective inputs.

It would also be nice to be able to have a syntax for specifying a non-capture group such as $[ignore]_$keep resulting in {'keep': 'foo'}.

1 Answers1

0

Found a package called lucidity that does exactly what I need.

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Feb 14 '23 at 04:44