Skip to main content

Closed caption converter

Project description

Build Status pre-commit

pycaption is a caption reading/writing module. Use one of the given Readers to read content into a CaptionSet object, and then use one of the Writers to output the CaptionSet into captions of your desired format.

Tested with Python versions 3.6, 3.7, 3.8 and 3.9. (for Python 2 use pycaption < 1.0.0)

For details, see the documentation.

Changelog

2.0.2

  • Implemented Tab Offset commands for SCCReader

  • Implemented caption safe area limits (80% horizontally and 90% vertically)

  • Implemented SCC translator

2.0.1

  • Added newline between merged SRT captions with overlapping timestamps

  • Updated tests for SAMI format

  • Updated tests for SRT format

  • Added zero padding to 1-digit hours outputted by WebVTTWriter

2.0.0

  • Dropped support for Python 3.5

  • Updated tests to run using pytest

  • Added pre-commit config

1.0.7

  • Fixed issue with SCC paint-on buffer not being cleared after storing

  • Removed null DFXPReader captions from the resulting caption list

  • Updated SCCReader double command handling to include the positioning and tab offset case

1.0.6

  • Added MicroDVD format

  • Fix for missing end times when reading multiple SAMI paragraphs inside a SYNC

  • Fix for wrong order when multiple SRT captions have the same timestamp

  • Fix for DFXP timestamps adding leading zeros to 2-digit hours

  • Added support for BeautifulSoup 4.9

  • Added tests for SCC to DFXP conversion when the source contains ampersands

  • Added support for Python 3.9

1.0.5

  • Added language parameter to WebVTTWriter

  • Fix for TranscriptWriter merging words at caption boundary

  • Updated documentation with positioning information

  • Updated DFXP reader to fallback to the document’s language if no language is present on individual <div>

  • Introduced PYCAPTION_DEFAULT_LANG environment variable and set it to default to ‘und’

  • Fixed DFXPReader timestamp validation to accept frames and frames conversion to microseconds

1.0.4

  • Included tests in PyPI tarball

  • Ignore WebVTT empty cues instead of raising an exception

  • Updated BeautifulSoup version to >=4.8.1,<4.9 and fixed failing tests

  • Handled index error when sending bad timestamp for DFXP format

1.0.3

  • Fixed issue with SCC reader including both special characters and their potential substitute

  • Modified enum34 dependency to versions under Python 3.4

  • Removed Python 3.4 and added 3.6, 3.7 and 3.8 to Travis tests

1.0.2

  • Fixed typos in SCC positioning codes

  • Added missing SCC positioning codes to positioning map

1.0.0

  • Added Python 3 support

0.5.x

  • Added positioning support

  • Created documentation

License

This module is Copyright 2012 PBS.org and is available under the Apache License, Version 2.0.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pycaption-2.0.2.tar.gz (377.1 kB view details)

Uploaded Source

Built Distribution

pycaption-2.0.2-py3-none-any.whl (535.2 kB view details)

Uploaded Python 3

File details

Details for the file pycaption-2.0.2.tar.gz.

File metadata

  • Download URL: pycaption-2.0.2.tar.gz
  • Upload date:
  • Size: 377.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.2

File hashes

Hashes for pycaption-2.0.2.tar.gz
Algorithm Hash digest
SHA256 7752ab7bf1a3ccad6fef582d8c22f29c63391e4503d359400b6d8b7892d9e288
MD5 4176799906a0d4d5f0bcf6e522452745
BLAKE2b-256 9aba977763b53ba322f47e21764edf5c1abbd20ca8f7741770cb6cbacb7bedbc

See more details on using hashes here.

File details

Details for the file pycaption-2.0.2-py3-none-any.whl.

File metadata

  • Download URL: pycaption-2.0.2-py3-none-any.whl
  • Upload date:
  • Size: 535.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.2

File hashes

Hashes for pycaption-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6f80b04e40323e4cb437626ef9f64cfb89a0459f274b3586148f2bc77ee37e23
MD5 fa75f01d86438bec9d543c1f3f4babf6
BLAKE2b-256 93ad2b9f5a59205c594c2d0b979c0101fc22e700473494e2143479dfa35f14e4

See more details on using hashes here.

Supported by

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