DNSocial/dnsocial/creds.py

14 lines
334 B
Python
Raw Permalink Normal View History

2023-06-07 09:24:33 +00:00
from pathlib import Path
import json
from dataclasses import dataclass
@dataclass
class GoDaddyCreds:
key: str
secret: str
@classmethod
def from_json(cls, path:Path=Path('creds.json')) -> 'GoDaddyCreds':
with open(path, 'r') as jfile:
creds = json.load(jfile)
return GoDaddyCreds(**creds)