DNSocial/dnsocial/creds.py
2023-06-07 02:24:33 -07:00

14 lines
No EOL
334 B
Python

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)