Skip to main content

Access to subtitles from various file formats

Project description

Access to subtitles from various file formats

This library is not fundamentally different from established ones, but offers some helpful abstractions that those others don't. First and foremost, subtitles loaded from a file are represented as a linked list. This makes it possible to implement search patterns and sanitization strategies that take the preceding or following subtitle into account, for example to recognize a running sentence.

>>> import subsy
>>> subtitles = subsy.load('subtitles.srt')
>>> first = subtitles[0]
>>> first.text
'How are you?'
>>> second = first.next
>>> second.text
'great, thanks.'
>>> second.text = 'Great, thanks.'
>>> subtitles.save()

Subtitles can be loaded from and saved to these file formats:

  • Subrip (.srt)
  • Advanced Substation Alpha (.ass)
  • Substation Alpha (.ssa)
  • WebVTT (.vtt)
  • SubViewer (.sub)

The text encoding of input files is detected automatically.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page