2022-10-04 01:46:42 +00:00
|
|
|
"""
|
|
|
|
No, not the actual creds. and dont go lookin for em in the git history cuz they aint in there neither
|
|
|
|
"""
|
|
|
|
|
|
|
|
import json
|
|
|
|
from dataclasses import dataclass
|
|
|
|
from pathlib import Path
|
|
|
|
import typing
|
|
|
|
|
|
|
|
@dataclass
|
|
|
|
class Creds:
|
|
|
|
api_key: str
|
|
|
|
api_secret: str
|
|
|
|
bearer_token: str
|
|
|
|
access_token: typing.Optional[str]
|
|
|
|
access_secret: typing.Optional[str]
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def from_json(cls, path:Path) -> 'Creds':
|
|
|
|
with open(path, 'r') as jfile:
|
|
|
|
creds = json.load(jfile)
|
|
|
|
return Creds(**creds)
|
|
|
|
|
|
|
|
|
|
|
|
@dataclass
|
|
|
|
class Zenodo_Creds:
|
|
|
|
access_token:str
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def from_json(cls, path:Path) -> 'Zenodo_Creds':
|
|
|
|
with open(path, 'r') as jfile:
|
|
|
|
creds = json.load(jfile)
|
|
|
|
return Zenodo_Creds(**creds)
|
|
|
|
|
2022-10-12 02:40:33 +00:00
|
|
|
@dataclass
|
|
|
|
class Discord_Creds:
|
|
|
|
token:str
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def from_json(cls, path:Path) -> 'Discord_Creds':
|
|
|
|
with open(path, 'r') as jfile:
|
|
|
|
creds = json.load(jfile)
|
|
|
|
return Discord_Creds(**creds)
|
2022-10-16 03:15:33 +00:00
|
|
|
|
|
|
|
|
|
|
|
@dataclass
|
|
|
|
class Mediawiki_Creds:
|
|
|
|
user:str
|
|
|
|
password:str
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def from_json(cls, path:Path) -> 'Mediawiki_Creds':
|
|
|
|
with open(path, 'r') as jfile:
|
|
|
|
creds = json.load(jfile)
|
|
|
|
return Mediawiki_Creds(**creds)
|