Skip to content

Instantly share code, notes, and snippets.

@minimasoft
Created March 17, 2025 20:26
Show Gist options
  • Select an option

  • Save minimasoft/3c1571258ac5cc7a54f101cd2955caa1 to your computer and use it in GitHub Desktop.

Select an option

Save minimasoft/3c1571258ac5cc7a54f101cd2955caa1 to your computer and use it in GitHub Desktop.
misa capitulada
from pathlib import Path
from json import load as load_json
with open('misa.json', 'r', encoding='utf-8') as f:
dan = load_json(f)
cap_size = 256
i = 0
c = 0
l = len(dan)
while(i<l):
capitulo = dan[i:i+cap_size]
c += 1
i = cap_size * c
with open(f"misa_capitulo_{c}.csv", "w", encoding="utf-8") as cap_file:
headers = "'id','screen_name','name','description','profile_image_url'\n"
cap_file.write(headers)
for subnormal in capitulo:
cap_file.write(f"{subnormal['id']},{subnormal['screen_name']},{subnormal['name']},no fui a la ezcuela,{subnormal['profile_image_url']}\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment