14 lines
No EOL
334 B
Python
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) |