1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 19:44:20 +00:00
royalnet/db.py
2016-11-21 08:48:35 +01:00

21 lines
364 B
Python

import json
import filemanager
db = json.loads(filemanager.readfile("db.json"))
def findbyname(name: str):
for player in db:
if player == name:
return db[player]
else:
return None
def findbykey(key, value):
for player in db:
if player[key] == value:
return db[player]
else:
return None