recibos_izzi / crear.py
judith0's picture
agregando izzi 300 a 400
b23c9e4
import json
import os
# Ruta de la carpeta donde se guardarán los archivos JSON
folder_path = "./data/key"
# Verificar si la carpeta existe, de lo contrario, crearla
if not os.path.exists(folder_path):
os.makedirs(folder_path)
for i in range(350, 400):
data = {
"fullAddress": "",
"address": {
"street": "",
"colony": "",
"zipCode": "",
"city": "",
"state": ""
},
"barcode": "",
"phone": "",
"acount": "",
"reference": "",
"totalPaymentTop": "",
"totalPaymentLower": "",
"totalPaymentletter": "",
"name": "",
"caption1": "",
"caption2": "",
"caption3": "",
"type": "izzi"
}
file_name = f"{i}.json"
file_path = os.path.join(folder_path, file_name)
with open(file_path, 'w') as f:
json.dump(data, f, indent=4)
print(f"Archivo {file_name} creado en {folder_path}.")
print("Creación de archivos JSON completada.")