Metadata-Version: 2.3
Name: ak_transcribe
Version: 0.0.7
Summary: Transcribe Media Files
Author-email: Arun Kishore <pypi@rpakishore.co.in>
Requires-Python: >=3.11.0
Description-Content-Type: text/markdown
Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
Requires-Dist: groq>=0.18.0
Requires-Dist: requests
Requires-Dist: rich
Requires-Dist: openai-whisper ; extra == "cpu"
Requires-Dist: ipykernel ; extra == "dev"
Requires-Dist: ipywidgets ; extra == "dev"
Requires-Dist: pytest ; extra == "dev"
Project-URL: Home, https://github.com/rpakishore/ak_transcribe
Provides-Extra: cpu
Provides-Extra: dev

<!--- Heading --->
<div align="center">
  <h1>ak_transcribe</h1>
</div>
<br />

<!-- Table of Contents -->
<h2>Table of Contents</h2>

- [Getting Started](#getting-started)
  - [Prerequisites](#prerequisites)
  - [Installation](#installation)
- [Usage](#usage)
- [License](#license)
- [Contact](#contact)

<!-- Getting Started -->
## Getting Started

<!-- Prerequisites -->
### Prerequisites

Python 3.11 or above

**Note for Ubuntu/Debian:**
This project uses `python-magic` to identify file types. So the libmagic C library needs to be installed need to be installed. See [python-magic](https://pypi.org/project/python-magic/) for more information.

For Debian/Ubuntu systems:

- `sudo apt-get install libmagic1`

For OSX:

- When using Homebrew: `brew install libmagic`
- When using macports: `port install file`

For Windows:

- _No additional requirements_

<!-- Installation -->
### Installation

```bash
  pip install ak_transcribe
```

Check configs

```python
  import ak_transcribe
  ak_transcribe.test_configs()
```
<!-- Usage -->
## Usage


```python
from ak_transcribe import Transcriber
from pathlib import Path
res = Transcriber.process(filepath=Path("path/to/media/file"))

# Write Json to file
with open(filepath.with_suffix('.json'), 'w', encoding='utf-8') as f:
    f.write(res.json)

# Return Srt file contents
res.srt

# Embed subtitle file into the video
res.embed_srt(filepath=Path("path/to/media/file"))

# Return Transcript text
res.txt

# Extract txt from srt file
from ak_transcribe import converter
converter.srt_to_txt("path/to/srt/file")

# Read existing srt
from ak_transcribe import TranscribedContent
TranscribedContent(Path("path/to/JSON/file"))

## Alternatively, pass dictionary from json file
import json
with open(Path("path/to/JSON/file"), "r", encoding="utf-8") as f:
    return TranscribedContent(results=json.load(f))
```

<!-- License -->
## License

See [LICENSE](/LICENSE) for more information.

<!-- Contact -->
## Contact

Arun Kishore - [@rpakishore](mailto:pypi@rpakishore.co.in)

Project Link: [https://github.com/rpakishore/ak_transcribe](https://github.com/rpakishore/ak_transcribe)

