Skip to main content

Bragir

Authors

License

Description

The bragir CLI is a command-line application built using Click. Its primary purpose is to handle and generate SubRip Subtitle (SRT) files using ChatGPT and Whisper from Openai.

Features

  • Translation: Translate the content of SRT files from one language to another using ChatGPT.
  • Transcription: Trancribe the content of video and audio files from one language to another using Whisper.
  • Batch Processing: Process a single file, multiple files, or an entire directory, providing flexibility and efficiency.
  • Easy-to-Use Interface: Utilize a user-friendly command-line interface powered by Click, making translation tasks straightforward.

Table of Contents

Installation

In order to use the full potential of Bragir, FFmpeg is needed to be installed on the system and you need to obtain an Openai key.

As a package

pip install bragir

Brew

NOTE: Currently bragir is not available on the homebrew-core repo, so you will need to tap our custom ArjanCodes repo

brew tap arjancodes/core

Then, you can run the following command:

brew update && brew install bragir

OpenAI

Currently, this tool relise on OpenAIs API. That means that an OpenAI api-key is crucial. See the following resource of how to get an OpenAI api-key

Bragir

Use pip to install Bragir

pip install bragir

Check if installation is complete

bragir --version

If a version is displayed, then Bragir is installed correctly.

Usage

Bragir comes with two commands, transcribe and translate. Transcribe will always generate an file with extension .srt. The translate command has only been tested with SRT-files, however other files would work. However, Bragir is not intended to translate other file types

In order to use bragir, the api key can be loaded into the session or saved in the config.ini file (Default at ~/.bragir/cli/config.ini).

Load Openai key as an enviroment variable into current session

export OPENAI_KEY=<VALUE>

Examples

Translate a single file to one language:

bragir translate <FILE_PATH> --language French

Translate one file to multiple languages:

bragir translate <FILE_PATH> --language French --language German

Translate files in a directory to multiple languages:

bragir translate <DIRECTORY_PATH> --language French --language German

Transcribe file:

bragir transcribe <FILE_PATH>

Transcribe files in a directory:

bragir transcribe <DIRECTORY_PATH>

Contributing

If you want to contribute to this project, please use the following steps:

  1. Fork the project.
  2. Create a new branch (git checkout -b feature/awesome-feature).
  3. Commit your changes (git commit -m 'Add some feature').
  4. Push to the branch (git push origin feature/awesome-feature).
  5. Open a pull request.

Commit Message Structure

This projects aims to follow the Conventional Commits guidelines.

When writing commit messages, use one of the following categories to clearly describe the purpose of your commit:

  • feat / feature: ✨ Introducing new features
  • fix / bugfix: 🐛 Addressing bug fixes
  • perf: 🚀 Enhancing performance
  • refactor: 🔄 Refactoring code - Not displayed in CHANGELOG
  • test / tests: ✅ Adding or updating tests - Not displayed in CHANGELOG
  • build / ci: 🛠️ Build system or CI/CD updates - Not displayed in CHANGELOG
  • doc / docs: 📚 Documentation changes - Not displayed in CHANGELOG
  • style: 🎨 Code style or formatting changes - Not displayed in CHANGELOG
  • chore: 🔧 Miscellaneous chores
  • other: 🌟 Other significant changes

Example Commit Messages

  • feat: Add cool new feature
  • fix: Resolve unexpected behavior with translation

License

This project is licensed under the MIT License.

Metadata

Release files for bragir 1.4.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bragir 1.4.7
File Size Uploaded Provenance
bragir-1.4.7.tar.gz 19.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for bragir 1.4.7
File Interpreter ABI Platform
bragir-1.4.7-py3-none-any.whl Python 3 none any Details

Total release size: 51.4 kB

Release files / bragir-1.4.7.tar.gz

Download URL bragir-1.4.7.tar.gz
Size 19.0 kB
Tags Source
SHA-256 checksum
How to use checksums
75031beb70cba07fba3303a426d96ec28e883d1abbb3e226ad08a66b521c8603
BLAKE2b-256 checksum
How to use checksums
1f6fc4776e5acf8d500c9c26e90929c6f8767309e5e873dddde2e3b89e21c201
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.5.25

Release files / bragir-1.4.7-py3-none-any.whl

Download URL bragir-1.4.7-py3-none-any.whl
Size 32.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8c943c039ea4bf0cc48ef8877f0de2105b3cc1315bdd9a8aa3066849b0686d0e
BLAKE2b-256 checksum
How to use checksums
83b00df6ba1f8db279cef837683f8e86d17d6fda080747188798776e5254ce86
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.5.25

Security for bragir 1.4.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page