Python API
Use Augent directly in Python scripts and applications.
Core Functions
Transcribe
from augent import transcribe_audio
result = transcribe_audio("podcast.mp3", model_size="tiny")
print(result["text"])
print(result["duration"])
print(result["segments"])Search
from augent import search_audio
matches = search_audio("podcast.mp3", ["funding", "revenue"])
for keyword, hits in matches.items():
for hit in hits:
print(f"[{hit['timestamp']}] {hit['snippet']}")Proximity Search
from augent import search_audio_proximity
matches = search_audio_proximity(
"interview.mp3",
keyword1="problem",
keyword2="solution",
max_distance=30
)Batch Search
from augent import search_audio
files = ["ep1.mp3", "ep2.mp3", "ep3.mp3"]
for f in files:
results = search_audio(f, ["keyword"])Cache Management
from augent import get_cache_stats, clear_cache, list_cached
# View stats
stats = get_cache_stats()
# List all cached transcriptions
entries = list_cached()
for e in entries:
print(f"{e['title']} - {e['duration_formatted']}")
# Clear cache
cleared = clear_cache()Export
from augent import export_matches, export_transcription
# Export search results
csv_output = export_matches(matches, format="csv")
srt_output = export_matches(matches, format="srt")
# Export full transcription as subtitles
srt = export_transcription(result["segments"], format="srt")Clip Extraction
from augent import export_clips
clips = export_clips(
"podcast.mp3",
matches,
output_dir="./clips",
padding=5.0
)Streaming
from augent import transcribe_audio_streaming
for progress in transcribe_audio_streaming("podcast.mp3"):
print(f"{progress.progress:.0%} - {progress.message}")Last updated on