Skip to main content

Transcribe Media Files

Project description

ak_transcribe


Table of Contents

Getting Started

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 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

  pip install ak_transcribe

Check configs

  import ak_transcribe
  ak_transcribe.test_configs()

Usage

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

See LICENSE for more information.

Contact

Arun Kishore - @rpakishore

Project Link: https://github.com/rpakishore/ak_transcribe

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

ak_transcribe-0.0.7.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ak_transcribe-0.0.7-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file ak_transcribe-0.0.7.tar.gz.

File metadata

  • Download URL: ak_transcribe-0.0.7.tar.gz
  • Upload date:
  • Size: 14.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.3

File hashes

Hashes for ak_transcribe-0.0.7.tar.gz
Algorithm Hash digest
SHA256 f0574224cc24215b74e6eba2bcf927d9041e399b15971dd7c276c42233591be2
MD5 c89ad8413fafc9d9a825a1e15372c300
BLAKE2b-256 dd83b41f34be9972dde7c7e905134ab8516a3f910f13599013021152d1837d26

See more details on using hashes here.

File details

Details for the file ak_transcribe-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: ak_transcribe-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 13.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.3

File hashes

Hashes for ak_transcribe-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 9e92fbdba9da70f3ad27dc5a7bcd3be1db9a511561321908ffced8b2db5a53dc
MD5 8c8cd3e3f13f7eb631e7af08ca8803ae
BLAKE2b-256 fc0f76819364faecaa0907e7e6dfa3af5ff26c742af2f37454891e76e0a72de3

See more details on using hashes here.

Supported by

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