Initial commit

This commit is contained in:
Nemika
2021-03-07 20:55:27 +02:00
commit 2ccb1e6bbc
13 changed files with 355 additions and 0 deletions

16
core/files.py Normal file
View File

@@ -0,0 +1,16 @@
from yaml import load as yload, FullLoader
from json import load as jload
class Data:
def __init__(self, filename:str):
self.file = filename
def yaml_read(self):
with open(f"data/{self.file}.yml", "r") as f:
return yload(f, Loader=FullLoader)
def json_read(self):
with open(f"data/{self.file}.json", "r") as f:
return jload(f)
def read(self):
return open(f"data/{self.file}.txt", "r").read()