-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
31 lines (23 loc) · 839 Bytes
/
main.py
File metadata and controls
31 lines (23 loc) · 839 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import asyncio
from datetime import time
import json
import aiofiles
from data_weaver.main import load_config, process_entries, save_result_to_file
async def main():
"""
This function is the entry point of the program.
It reads the content of a JSON file, processes the entries,
and writes the final list to another JSON file.
"""
print('Starting...')
# start = time.time()
await load_config()
async with aiofiles.open('./data/test.json', 'r', encoding='utf8') as file:
content = await file.read()
json_entries = json.loads(content)
final_list = await process_entries(json_entries.get('data'))
await save_result_to_file(final_list, './data/result.json')
print('Done!')
# print(f'Time: {time.time() - start}')
if __name__ == "__main__":
asyncio.run(main())