from pureframe import Pureframe
import glob, time
client = Pureframe(token="pf_...")
# 1. Create a collection
collection = client.collections.create_collection(name="Sales calls")
# 2. Upload every recording in a folder
job_ids = []
for path in glob.glob("recordings/*.mp4"):
job = client.upload.upload_video(collection_id=collection.data.id, file=open(path, "rb"))
job_ids.append(job.data.job_id)
# 3. Wait for every job to finish
for job_id in job_ids:
while True:
status = client.jobs.get_job(job_id)
if status.data.status in ("done", "failed"):
break
time.sleep(5)
# 4. Search across the whole collection
results = client.search.search(query="customer mentions renewal", collection_id=collection.data.id)
for video in results.data:
for seg in video.segments:
print(f"{video.filename} @ {seg.timestamp_start:.1f}s — {seg.score:.2f}")