diff options
author | lexicade <jasonnlelong@gmail.com> | 2023-01-27 21:06:30 +0000 |
---|---|---|
committer | lexicade <jasonnlelong@gmail.com> | 2023-01-27 21:06:30 +0000 |
commit | 52801b4de1d63cd01191acf7fcee137977140ec0 (patch) | |
tree | 08271a1f1e3e8060486b6651c67c9934867c648e /ffxiv/pystone/character.py | |
parent | 8df873808c86805624851356f5dea76ec621de23 (diff) |
Diffstat (limited to 'ffxiv/pystone/character.py')
-rw-r--r-- | ffxiv/pystone/character.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/ffxiv/pystone/character.py b/ffxiv/pystone/character.py new file mode 100644 index 0000000..200baeb --- /dev/null +++ b/ffxiv/pystone/character.py @@ -0,0 +1,20 @@ +from typing import List, Optional, Tuple + +from requests import Session + +from pystone.definition import Definition + + +class Character: + def __init__(self, *, definitions: List[Definition]): + self.definitions = {(x.name): x for x in definitions} + + def __getattr__(self, name): + if name in self.definitions: + return self.definitions[name] + + def to_json(self): + json = {} + for definition in self.definitions.values(): + json.update(definition.to_json()) + return json |