Spaces:
Sleeping
Sleeping
| import zipfile | |
| import io | |
| def export_zip(results): | |
| buf = io.BytesIO() | |
| with zipfile.ZipFile(buf, "w") as z: | |
| for i, r in enumerate(results): | |
| z.writestr( | |
| f"{i}_{r['agency']}.txt", | |
| f"{r['title']}\n{r['url']}" | |
| ) | |
| buf.seek(0) | |
| return buf |