color identity in pull sheet
This commit is contained in:
11
app/services/external_api/scryfall/scryfall_service.py
Normal file
11
app/services/external_api/scryfall/scryfall_service.py
Normal file
@ -0,0 +1,11 @@
|
||||
from app.services.external_api.base_external_service import BaseExternalService
|
||||
|
||||
class ScryfallService(BaseExternalService):
|
||||
def __init__(self):
|
||||
super().__init__(base_url="https://api.scryfall.com/")
|
||||
|
||||
async def get_color_identity(self, scryfall_id: str) -> str:
|
||||
"""Get the color identity of a card from Scryfall API"""
|
||||
endpoint = f"cards/{scryfall_id}"
|
||||
results = await self._make_request("GET", endpoint)
|
||||
return results['color_identity']
|
Reference in New Issue
Block a user