Skip to main content

A lightweight Python module to convert VTT and SRT caption files into plain text transcripts.

Project description

Certainly! I'll help you update the README.md file for the caption2text project. Based on the current content and the project structure, I'll provide an expanded version of the README that includes more information about the project, its usage, and other relevant details.

Here's an updated version of the README.md:

# caption2text

A lightweight Python module that converts VTT and SRT caption files into plain text transcripts.

## Features

- Convert WebVTT (.vtt) files to plain text transcripts
- Convert SubRip (.srt) files to plain text transcripts
- Easy-to-use Python API
- Command-line interface (CLI) for quick conversions

## Installation

You can install caption2text using pip:

```bash
pip install caption2text

Usage

Python API

from caption2text import vtt_to_transcript, srt_to_transcript

# Convert VTT file to transcript
vtt_transcript = vtt_to_transcript('path/to/your/file.vtt')
print(vtt_transcript)

# Convert SRT file to transcript
srt_transcript = srt_to_transcript('path/to/your/file.srt')
print(srt_transcript)

Command-line Interface

# Convert VTT file
caption2text convert path/to/your/file.vtt

# Convert SRT file
caption2text convert path/to/your/file.srt

# Specify output file
caption2text convert path/to/your/file.vtt -o output.txt

Development

To set up the development environment:

  1. Clone the repository
  2. Create a virtual environment: python -m venv venv
  3. Activate the virtual environment:
    • On Windows: venv\Scripts\activate
    • On macOS and Linux: source venv/bin/activate
  4. Install development dependencies: pip install -e .[dev]

Running Tests

To run the tests, use the following command:

python -m unittest discover tests

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Support

If you encounter any problems or have any questions, please open an issue on the GitHub repository.


This updated README.md provides a more comprehensive overview of the project, including installation instructions, usage examples for both the Python API and command-line interface, development setup, testing instructions, license information, and contribution guidelines.

You can further customize this README by adding more specific details about your project, such as:

1. Requirements or dependencies
2. More detailed examples or use cases
3. Troubleshooting section
4. Changelog or version history
5. Acknowledgements or credits

Let me know if you'd like to make any changes or additions to this updated README.

Project details


Download files

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

Source Distribution

caption2text-0.1.1.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

caption2text-0.1.1-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file caption2text-0.1.1.tar.gz.

File metadata

  • Download URL: caption2text-0.1.1.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for caption2text-0.1.1.tar.gz
Algorithm Hash digest
SHA256 eedda5c43837740356647e23c05e14496dadc574295f09508b795e711ee43d86
MD5 ebde068dd4928ac9c6151e92e9543761
BLAKE2b-256 cee09d66c9993623029ecaf2b8eeb66e43561fa06c49737516535577d9a30a5b

See more details on using hashes here.

File details

Details for the file caption2text-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for caption2text-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b8ccff82aaeb1127e3c5fedd1447cd7a92578f0e1825dcde2d6f82b2ea59f280
MD5 090d5c31369df878b370fe0a2f8f2b7e
BLAKE2b-256 d8e6b0042eb97403728babf359cb681abbef257623e3b54906dd7ae69bffe461

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