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.2.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: caption2text-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 37d00bea944b39808cd2bdb9577bf5a11a4f7b799f5ccc0279721433cc415cd9
MD5 4cff613b4d50f638a67abef59236bd10
BLAKE2b-256 8a31de797f33db05958642aebe74bdeb182c0f2662a49696fc86df964e1e9d72

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for caption2text-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b4c91e8fd08f688ed604d2f37541f9f2aa02107400a3973db740cd50ad07bbee
MD5 f59ac6bf87215738a70cc90b4f3061a3
BLAKE2b-256 5cb16418649a6ed191ba5a85c9962cd8cce4bcd7d9b368623e50d40fead720d9

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