Commit Graph

14 Commits

Author SHA1 Message Date
Liam Sy 68ca703ae0 updated WebVTT and SRT formatters 2022-10-20 17:25:31 -04:00
Liam Sy 69c5a46016 added class SRTFormatter 2022-10-02 20:39:15 -04:00
Scott Lin 5613b9ec6c fix: typo on formatter 'webvtt' 2021-11-25 12:02:24 +08:00
Jonas Depoix b12e67d903 fixed string formatting 2021-11-08 10:57:08 +01:00
Jonas Depoix 99dd9126fd improved readability of time conversion 2021-06-07 08:52:29 +02:00
esha71 6f4ab9decd
Update formatters.py
corrected hours calculation logic in class WebVTTFormatter  method _seconds_to_timestamp for transcripts with more than an hour length
2021-05-30 02:30:56 +05:30
Jonas Depoix 2f592a37a2 removed string formatting which is not supported in older python versions 2021-03-15 18:13:34 +01:00
Jonas Depoix cf585e2175 refactored formatters to use format_transcript and format_transcripts 2021-03-15 17:57:44 +01:00
Jonas Depoix d314139329 added FormatterLoader 2021-03-15 17:16:20 +01:00
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