Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enums for miscellaneous card parts #87

Merged
merged 17 commits into from
Aug 28, 2023
Merged

Enums for miscellaneous card parts #87

merged 17 commits into from
Aug 28, 2023

Conversation

fjork3
Copy link
Contributor

@fjork3 fjork3 commented Aug 27, 2023

Component
Frame
FrameEffect
ImageStatus
Language
Layout
SecurityStamp
SetType

@fjork3 fjork3 linked an issue Aug 27, 2023 that may be closed by this pull request
@iambroadband
Copy link
Contributor

Should the changes needed for Card and CardModel go in this PR too as part of the change?

@fjork3
Copy link
Contributor Author

fjork3 commented Aug 27, 2023

Should the changes needed for Card and CardModel go in this PR too as part of the change?

I was planning for that to be a separate PR after #80 is merged, as that's touching a whole lot of things in the same areas and I'd like to keep that merge clean.

@fjork3 fjork3 changed the title Enums for miscellaneous card parts [WIP] Enums for miscellaneous card parts Aug 28, 2023
@fjork3 fjork3 changed the title [WIP] Enums for miscellaneous card parts Enums for miscellaneous card parts Aug 28, 2023
set_name: str = "",
set_search_uri: str = "",
set_type: str = "",
set_type: SetType = "",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SetType.NONE as default?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made None accepted and the default.

@@ -55,6 +55,18 @@ class Color(ExtendedEnum, StrEnum):
GREEN = "G"


class Component(ExtendedEnum, StrEnum):
"""
A type of related object, used in Scryfall to link a card to other cards or tokens referenced by it.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line length

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -106,6 +162,75 @@ class Game(ExtendedEnum, StrEnum):
MTGO = auto()


class ImageStatus(ExtendedEnum, StrEnum):
"""
An indicator for whether a card's image exists on Scryfall, and how high quality the sourced image is.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line length.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -147,6 +272,50 @@ class ScryfallBulkFile(ExtendedEnum, StrEnum):
# TODO(#26): support for Rulings file


class SecurityStamp(ExtendedEnum, StrEnum):
"""
A holographic security stamp printed on the bottom of some Magic cards, generally rares and mythics.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line length

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

default=None,
description="Foil price in Euros, from Cardmarket."
)
eur_foil: float | None = Field(default=None, description="Foil price in Euros, from Cardmarket.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatting

@fjork3 fjork3 merged commit 570de47 into dev Aug 28, 2023
@fjork3 fjork3 deleted the fjork3-card-enums branch August 28, 2023 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Convert several fields in Card objects to enum
2 participants