Commit Graph

5 Commits

Author SHA1 Message Date
Chris Howell f3dc6f508f Add new formatters.py module 2020-09-01 15:21:47 -07:00
Chris Howell 1e9b2c7727 Revert "Add formatters module"
Reverting again, apparently I had a misunderstanding of how to revert. Trying again.
This reverts commit dca4021dd7.
2020-08-21 12:21:12 -07:00
Chris Howell c4b8b5b18d formatters.py python 2 compliant and misc.
Remove use of ABC, not part of Python 2 and implementing ABCMeta changes between Python 2 and 3 so left it out entirely. Base class now raises NotImplementedError manually.

Fix parse_timecode issue with start and end times being identical

Replaced uses of F-strings with .format() also for compatibility.
2020-07-09 20:13:58 -07:00
Chris Howell 1c0d584959 Add more functionality to TranscriptFormatter base class
Due to the behavior of the CLI and API, needed more flexibility for combining 1 or many transcripts for a given formatter.

- Now can specify a DELIMITER to separate multiple transcripts on.
- Can also specify how those items are combine overriding the combine class method.

Remove unused imports
Fix adjust some lines to meet PEP
2020-07-09 00:04:08 -07:00
Chris Howell dca4021dd7 Add formatters module
Add formatters module that contains a few basic built-in formatters for JSON, SRT, and an arbitrary plain TEXT. Mainly for examples of implementing your own.

Module contains an abstract base class `TranscriptFormatter` so that anyone can create their own TranscriptFormatter class

Module contains at runtime a `formats` which is basically an instance of a factory of classes (not sure if that is the correct term to use). But it itself is an instance that folks can add custom formatter classes that the API can make use of.
2020-07-08 15:05:17 -07:00