Task: Implement the eternal package and its card module to satisfy the tests
What to implement
Create a Python package at /app/eternal (i.e., a directory /app/eternal with init.py) and a submodule /app/eternal/card.py that the tests can import as eternal.card.
Required functionality
Class CardInfo
Location: eternal.card.CardInfo
Constructor signature: init(self, data: dict)
Behavior:
Validate input is a dict.
Validate that the provided dict contains exactly the following keys (no more, no less):
SetNumber
EternalID
Name
CardText
Cost
Influence
Attack
Health
Rarity
Type
UnitType
ImageUrl
DetailsUrl
DeckBuildable
If any key is missing or any extra key is present, raise AssertionError.
Compute and expose an id attribute as the string f"{SetNumber}-{EternalID}". For example, with SetNumber=3 and EternalID=2, id should be "3-2".
Optionally store the original data (not required by tests, but could be helpful for completeness).
The input is a string that may contain tokens like '{F}', '{J}', '{T}' (with surrounding quotes as seen in tests, e.g., "'{F}{F}{J}'").
Extract all faction letters inside braces (F, J, T, etc.). Return a string consisting of the unique faction letters, sorted alphabetically. If multiple of the same letter appear, only include it once.
If no faction letters are present, return the string "None".
Examples (as per tests):
influence_to_faction("''") -> "None"
influence_to_faction("'{F}{F}{J}'") -> "FJ"
influence_to_faction("'{J}{F}'") -> "FJ"
influence_to_faction("'{T}{T}{T}'") -> "T"
Notes
The implementation must be self-contained and rely only on the standard library.
The tests will import eternal.card and use CardInfo and influence_to_faction directly, e.g., isinstance(card_info, eternal.card.CardInfo) and eternal.card.influence_to_faction(...).
The code should reside in /app/eternal/ as a package (i.e., provide /app/eternal/init.py and /app/eternal/card.py).