Update requirements.txt, readme.md and .gitignore

now groups schedule in yaml format
This commit is contained in:
kr0sh512
2024-09-14 14:05:08 +03:00
parent 28b2640327
commit 653364b8a6
10 changed files with 352 additions and 357 deletions
+40
View File
@@ -0,0 +1,40 @@
import os
import json
import yaml
def convert_json_to_yaml(json_dir, yaml_dir):
# Iterate over all files in the directory
for filename in os.listdir(json_dir):
if filename.endswith(".json"):
json_path = os.path.join(json_dir, filename)
# Read JSON file
with open(json_path, "r", encoding="utf-8") as json_file:
data = json.load(json_file)
# Convert to YAML
yaml_data = yaml.dump(
data,
default_flow_style=None,
encoding="utf-8",
allow_unicode=True,
width=float("inf"),
sort_keys=False,
)
# Write YAML file
yaml_path = os.path.join(yaml_dir, filename.replace(".json", ".yaml"))
with open(yaml_path, "wb") as yaml_file:
yaml_file.write(yaml_data)
print("Conversion completed.")
if __name__ == "__main__":
json_dir = "json_remake"
yaml_dir = "yaml_groups"
convert_json_to_yaml(json_dir, yaml_dir)
pass