podcastfy package
Submodules
podcastfy.text_to_speech module
Text-to-Speech Module
This module provides functionality to convert text into speech using various TTS models. It supports both ElevenLabs and OpenAI TTS services and handles the conversion process, including cleaning of input text and merging of audio files.
- class podcastfy.text_to_speech.TextToSpeech(model: str = 'openai', api_key: str | None = None)[source]
Bases:
object- clean_tss_markup(input_text: str, additional_tags: List[str] = ['Person1', 'Person2']) str[source]
Remove unsupported TSS markup tags from the input text while preserving supported SSML tags.
- Parameters:
input_text (str) – The input text containing TSS markup tags.
additional_tags (List[str]) – Optional list of additional tags to preserve. Defaults to [“Person1”, “Person2”].
- Returns:
Cleaned text with unsupported TSS markup tags removed.
- Return type:
str
- convert_to_speech(text: str, output_file: str) None[source]
Convert input text to speech and save as an audio file.
- Parameters:
text (str) – Input text to convert to speech.
output_file (str) – Path to save the output audio file.
- Raises:
Exception – If there’s an error in converting text to speech.
podcastfy.content_generator module
Content Generator Module
This module is responsible for generating Q&A content based on input texts using LangChain and Google’s Generative AI (Gemini). It handles the interaction with the AI model and provides methods to generate and save the generated content.
- class podcastfy.content_generator.ContentGenerator(api_key: str, conversation_config: Dict[str, Any] | None = None)[source]
Bases:
object- generate_qa_content(input_texts: str = '', image_file_paths: List[str] = [], output_filepath: str | None = None) str[source]
Generate Q&A content based on input texts.
- Parameters:
input_texts (str) – Input texts to generate content from.
output_filepath (Optional[str]) – Filepath to save the response content. Defaults to None.
- Returns:
Formatted Q&A content.
- Return type:
str
- Raises:
Exception – If there’s an error in generating content.
podcastfy.content_parser.content_extractor module
Content Extractor Module
This module provides functionality to extract content from various sources including websites, YouTube videos, and PDF files. It serves as a central hub for content extraction, delegating to specialized extractors based on the source type.
- class podcastfy.content_parser.content_extractor.ContentExtractor(jina_api_key: str)[source]
Bases:
object