Skip to content

Commit

Permalink
Add pricing information to xlsx sheets
Browse files Browse the repository at this point in the history
  • Loading branch information
gwax committed Dec 18, 2022
1 parent 5058942 commit a3d0114
Show file tree
Hide file tree
Showing 22 changed files with 164 additions and 106 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ Changelog
Development
-----------

- ...
- Add card prices and totals

2.2.5
-----
Expand Down
2 changes: 1 addition & 1 deletion mtg_ssm/containers/counts.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from mtg_ssm.containers.indexes import Oracle


class CountType(enum.Enum):
class CountType(str, enum.Enum):
"""Enum for possible card printing types (nonfoil, foil)."""

NONFOIL = "nonfoil"
Expand Down
97 changes: 72 additions & 25 deletions mtg_ssm/serialization/xlsx.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from typing import Any, ClassVar, Dict, Iterable, List, Optional, Sequence, Set, Tuple

import openpyxl
from openpyxl.styles.numbers import FORMAT_CURRENCY_USD_SIMPLE
from openpyxl.workbook.workbook import Workbook
from openpyxl.worksheet.worksheet import Worksheet

Expand All @@ -27,10 +28,12 @@
"unique",
"playsets",
"count",
"value",
"nonbulk",
]

ALL_SETS_SHEET_TOTALS: Sequence[Optional[str]] = ["Total", None, None, None, None] + [
f"=SUM({c}3:{c}65535)" for c in "FGHI"
f"=SUM({c}3:{c}65535)" for c in "FGHIJK"
]


Expand Down Expand Up @@ -61,28 +64,34 @@ def create_all_sets(sheet: Worksheet, index: ScryfallDataIndex) -> None:
f"=COUNTIF('{setcode}'!A:A,\">0\")",
f"=COUNTIF('{setcode}'!A:A,\">=4\")",
f"=SUM('{setcode}'!A:A)",
f"=SUM('{setcode}'!B:B)",
f"=SUMIF('{setcode}'!B:B,\">=5\")",
]
sheet.append(row)


def style_all_sets(sheet: Worksheet) -> None:
"""Apply styles to the all sets sheet."""
sheet.freeze_panes = sheet["C3"]
col_width_hidden = [
("A", 8, False),
("B", 30, False),
("C", 12, True),
("D", 22, True),
("E", 15, True),
("F", 6, False),
("G", 7, False),
("H", 8, False),
("I", 7, False),
col_width_hidden_format = [
("A", 8, False, None),
("B", 30, False, None),
("C", 12, True, None),
("D", 22, True, None),
("E", 15, True, None),
("F", 6, False, None),
("G", 7, False, None),
("H", 8, False, None),
("I", 7, False, None),
("J", 10, False, FORMAT_CURRENCY_USD_SIMPLE),
("K", 10, False, FORMAT_CURRENCY_USD_SIMPLE),
]
for col, width, hidden in col_width_hidden:
for col, width, hidden, number_format in col_width_hidden_format:
cdim = sheet.column_dimensions[col]
cdim.width = width
cdim.hidden = hidden
if number_format is not None:
cdim.number_format = number_format


def create_haverefs(index: ScryfallDataIndex, cards: Sequence[ScryCard]) -> str:
Expand Down Expand Up @@ -150,14 +159,44 @@ def style_all_cards(sheet: Worksheet) -> None:


SET_SHEET_HEADER = (
["have", "name", "scryfall_id", "collector_number", "artist"]
[
"have",
"value",
"name",
"scryfall_id",
"collector_number",
"artist",
"price",
"foil_price",
]
+ [ct.value for ct in counts.CountType]
+ ["others"]
)
COUNT_COLS = [
string.ascii_uppercase[SET_SHEET_HEADER.index(ct.value)] for ct in counts.CountType
]
HAVE_TMPL = "=" + "+".join(c + "{rownum}" for c in COUNT_COLS)
HAVE_TMPL = (
"="
+ string.ascii_uppercase[SET_SHEET_HEADER.index(counts.CountType.NONFOIL)]
+ "{rownum}"
+ "+"
+ string.ascii_uppercase[SET_SHEET_HEADER.index(counts.CountType.FOIL)]
+ "{rownum}"
)
VALUE_TMPL = (
"="
+ string.ascii_uppercase[SET_SHEET_HEADER.index(counts.CountType.NONFOIL)]
+ "{rownum}"
+ "*"
+ string.ascii_uppercase[SET_SHEET_HEADER.index("price")]
+ "{rownum}"
+ "+"
+ string.ascii_uppercase[SET_SHEET_HEADER.index(counts.CountType.FOIL)]
+ "{rownum}"
+ "*"
+ string.ascii_uppercase[SET_SHEET_HEADER.index("foil_price")]
+ "{rownum}"
)
ROW_OFFSET = 2


Expand All @@ -174,10 +213,13 @@ def create_set_sheet(
rownum = ROW_OFFSET + index.id_to_setindex[card.id]
row: List[Optional[Any]] = [
HAVE_TMPL.format(rownum=rownum),
VALUE_TMPL.format(rownum=rownum),
card.name,
str(card.id),
card.collector_number,
card.artist,
(card.prices or {}).get("usd", None),
(card.prices or {}).get("usd_foil", None),
]
card_counts = collection.counts.get(card.id, {})
for count_type in counts.CountType:
Expand All @@ -189,20 +231,25 @@ def create_set_sheet(
def style_set_sheet(sheet: Worksheet) -> None:
"""Apply styles to a set sheet."""
sheet.freeze_panes = sheet["C2"]
col_width_hidden = [
("A", 5, False),
("B", 24, False),
("C", 10, True),
("D", 8, True),
("E", 20, True),
("F", 8, False),
("G", 6, False),
("H", 10, False),
col_width_hidden_format = [
("A", 5, False, None),
("B", 9, False, FORMAT_CURRENCY_USD_SIMPLE),
("C", 24, False, None),
("D", 10, True, None),
("E", 8, True, None),
("F", 20, True, None),
("G", 9, True, FORMAT_CURRENCY_USD_SIMPLE),
("H", 9, True, FORMAT_CURRENCY_USD_SIMPLE),
("I", 8, False, None),
("J", 6, False, None),
("K", 10, False, None),
]
for col, width, hidden in col_width_hidden:
for col, width, hidden, number_format in col_width_hidden_format:
cdim = sheet.column_dimensions[col]
cdim.width = width
cdim.hidden = hidden
if number_format is not None:
cdim.number_format = number_format


def rows_from_sheet(sheet: Worksheet) -> Iterable[Dict[str, str]]:
Expand All @@ -212,7 +259,7 @@ def rows_from_sheet(sheet: Worksheet) -> Iterable[Dict[str, str]]:
for row in rows:
values = [cell.value for cell in row]
if any(v is not None for v in values):
yield dict(zip(header, values), set=sheet.title)
yield dict(zip(header, values), set=str(sheet.title))


def rows_for_workbook(
Expand Down
1 change: 1 addition & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

[mypy]
python_version = 3.8
plugins = pydantic.mypy

ignore_missing_imports = True
follow_imports = normal
Expand Down
2 changes: 2 additions & 0 deletions test_requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ freezegun
isort
lxml
mypy
openpyxl-stubs
pip
pip-tools
py
Expand All @@ -22,5 +23,6 @@ pytest-cov
pytest-snapshot
responses
setuptools
types-freezegun
types-requests
wheel
10 changes: 9 additions & 1 deletion test_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ mccabe==0.7.0
# flake8
# pylint
mypy==0.991
# via -r test_requirements.in
# via
# -r test_requirements.in
# openpyxl-stubs
mypy-extensions==0.4.3
# via
# black
Expand All @@ -82,6 +84,9 @@ openpyxl==3.0.10
# via
# -c requirements.txt
# -r requirements.txt
# openpyxl-stubs
openpyxl-stubs==0.1.24
# via -r test_requirements.in
packaging==22.0
# via
# build
Expand Down Expand Up @@ -161,6 +166,8 @@ tomli==2.0.1
# pytest
tomlkit==0.11.6
# via pylint
types-freezegun==1.1.10
# via -r test_requirements.in
types-requests==2.28.11.5
# via -r test_requirements.in
types-toml==0.10.8.1
Expand All @@ -172,6 +179,7 @@ typing-extensions==4.4.0
# astroid
# black
# mypy
# openpyxl-stubs
# pydantic
# pylint
urllib3==1.26.13
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
code,name,release,block,type,cards,unique,playsets,count
Total,,,,,=SUM(F3:F65535),=SUM(G3:G65535),=SUM(H3:H65535),=SUM(I3:I65535)
LEA,Limited Edition Alpha,1993-08-05,Core Set,core,4,"=COUNTIF('LEA'!A:A,"">0"")","=COUNTIF('LEA'!A:A,"">=4"")",=SUM('LEA'!A:A)
FEM,Fallen Empires,1994-11-01,,expansion,4,"=COUNTIF('FEM'!A:A,"">0"")","=COUNTIF('FEM'!A:A,"">=4"")",=SUM('FEM'!A:A)
ICE,Ice Age,1995-06-03,Ice Age,expansion,5,"=COUNTIF('ICE'!A:A,"">0"")","=COUNTIF('ICE'!A:A,"">=4"")",=SUM('ICE'!A:A)
S00,Starter 2000,2000-04-01,,starter,1,"=COUNTIF('S00'!A:A,"">0"")","=COUNTIF('S00'!A:A,"">=4"")",=SUM('S00'!A:A)
CHK,Champions of Kamigawa,2004-10-01,Kamigawa,expansion,2,"=COUNTIF('CHK'!A:A,"">0"")","=COUNTIF('CHK'!A:A,"">=4"")",=SUM('CHK'!A:A)
BOK,Betrayers of Kamigawa,2005-02-04,Kamigawa,expansion,1,"=COUNTIF('BOK'!A:A,"">0"")","=COUNTIF('BOK'!A:A,"">=4"")",=SUM('BOK'!A:A)
SOK,Saviors of Kamigawa,2005-06-03,Kamigawa,expansion,1,"=COUNTIF('SOK'!A:A,"">0"")","=COUNTIF('SOK'!A:A,"">=4"")",=SUM('SOK'!A:A)
HOP,Planechase,2009-09-04,,planechase,2,"=COUNTIF('HOP'!A:A,"">0"")","=COUNTIF('HOP'!A:A,"">=4"")",=SUM('HOP'!A:A)
PMBS,Mirrodin Besieged Promos,2011-02-03,Scars of Mirrodin,promo,2,"=COUNTIF('PMBS'!A:A,"">0"")","=COUNTIF('PMBS'!A:A,"">=4"")",=SUM('PMBS'!A:A)
MBS,Mirrodin Besieged,2011-02-04,Scars of Mirrodin,expansion,2,"=COUNTIF('MBS'!A:A,"">0"")","=COUNTIF('MBS'!A:A,"">=4"")",=SUM('MBS'!A:A)
NEO,Kamigawa: Neon Dynasty,2022-02-18,,expansion,3,"=COUNTIF('NEO'!A:A,"">0"")","=COUNTIF('NEO'!A:A,"">=4"")",=SUM('NEO'!A:A)
PNEO,Kamigawa: Neon Dynasty Promos,2022-02-18,,promo,2,"=COUNTIF('PNEO'!A:A,"">0"")","=COUNTIF('PNEO'!A:A,"">=4"")",=SUM('PNEO'!A:A)
code,name,release,block,type,cards,unique,playsets,count,value,nonbulk
Total,,,,,=SUM(F3:F65535),=SUM(G3:G65535),=SUM(H3:H65535),=SUM(I3:I65535),=SUM(J3:J65535),=SUM(K3:K65535)
LEA,Limited Edition Alpha,1993-08-05,Core Set,core,4,"=COUNTIF('LEA'!A:A,"">0"")","=COUNTIF('LEA'!A:A,"">=4"")",=SUM('LEA'!A:A),=SUM('LEA'!B:B),"=SUMIF('LEA'!B:B,"">=5"")"
FEM,Fallen Empires,1994-11-01,,expansion,4,"=COUNTIF('FEM'!A:A,"">0"")","=COUNTIF('FEM'!A:A,"">=4"")",=SUM('FEM'!A:A),=SUM('FEM'!B:B),"=SUMIF('FEM'!B:B,"">=5"")"
ICE,Ice Age,1995-06-03,Ice Age,expansion,5,"=COUNTIF('ICE'!A:A,"">0"")","=COUNTIF('ICE'!A:A,"">=4"")",=SUM('ICE'!A:A),=SUM('ICE'!B:B),"=SUMIF('ICE'!B:B,"">=5"")"
S00,Starter 2000,2000-04-01,,starter,1,"=COUNTIF('S00'!A:A,"">0"")","=COUNTIF('S00'!A:A,"">=4"")",=SUM('S00'!A:A),=SUM('S00'!B:B),"=SUMIF('S00'!B:B,"">=5"")"
CHK,Champions of Kamigawa,2004-10-01,Kamigawa,expansion,2,"=COUNTIF('CHK'!A:A,"">0"")","=COUNTIF('CHK'!A:A,"">=4"")",=SUM('CHK'!A:A),=SUM('CHK'!B:B),"=SUMIF('CHK'!B:B,"">=5"")"
BOK,Betrayers of Kamigawa,2005-02-04,Kamigawa,expansion,1,"=COUNTIF('BOK'!A:A,"">0"")","=COUNTIF('BOK'!A:A,"">=4"")",=SUM('BOK'!A:A),=SUM('BOK'!B:B),"=SUMIF('BOK'!B:B,"">=5"")"
SOK,Saviors of Kamigawa,2005-06-03,Kamigawa,expansion,1,"=COUNTIF('SOK'!A:A,"">0"")","=COUNTIF('SOK'!A:A,"">=4"")",=SUM('SOK'!A:A),=SUM('SOK'!B:B),"=SUMIF('SOK'!B:B,"">=5"")"
HOP,Planechase,2009-09-04,,planechase,2,"=COUNTIF('HOP'!A:A,"">0"")","=COUNTIF('HOP'!A:A,"">=4"")",=SUM('HOP'!A:A),=SUM('HOP'!B:B),"=SUMIF('HOP'!B:B,"">=5"")"
PMBS,Mirrodin Besieged Promos,2011-02-03,Scars of Mirrodin,promo,2,"=COUNTIF('PMBS'!A:A,"">0"")","=COUNTIF('PMBS'!A:A,"">=4"")",=SUM('PMBS'!A:A),=SUM('PMBS'!B:B),"=SUMIF('PMBS'!B:B,"">=5"")"
MBS,Mirrodin Besieged,2011-02-04,Scars of Mirrodin,expansion,2,"=COUNTIF('MBS'!A:A,"">0"")","=COUNTIF('MBS'!A:A,"">=4"")",=SUM('MBS'!A:A),=SUM('MBS'!B:B),"=SUMIF('MBS'!B:B,"">=5"")"
NEO,Kamigawa: Neon Dynasty,2022-02-18,,expansion,3,"=COUNTIF('NEO'!A:A,"">0"")","=COUNTIF('NEO'!A:A,"">=4"")",=SUM('NEO'!A:A),=SUM('NEO'!B:B),"=SUMIF('NEO'!B:B,"">=5"")"
PNEO,Kamigawa: Neon Dynasty Promos,2022-02-18,,promo,2,"=COUNTIF('PNEO'!A:A,"">0"")","=COUNTIF('PNEO'!A:A,"">=4"")",=SUM('PNEO'!A:A),=SUM('PNEO'!B:B),"=SUMIF('PNEO'!B:B,"">=5"")"
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
have,name,scryfall_id,collector_number,artist,nonfoil,foil,others
=F2+G2,Dark Ritual,4ebcd681-1871-4914-bcd7-6bd95829f6e0,120,Justin Hampton,,,"=IF('LEA'!A3>0,""LEA: ""&'LEA'!A3&"", "","""")&IF('HOP'!A3>0,""HOP: ""&'HOP'!A3&"", "","""")"
=F3+G3,Forest,fbdcbd97-90a9-45ea-94f6-2a1c6faaf965,380,Pat Morrissey,1,,
=F4+G4,Forest,b346b784-7bde-49d0-bfa9-56236cbe19d9,381,Pat Morrissey,,2,
=F5+G5,Forest,768c4d8f-5700-4f0a-9ff2-58422aeb1dac,382,Pat Morrissey,3,4,
=F6+G6,Snow-Covered Forest,4c0ad95c-d62c-4138-ada0-fa39a63a449e,383,Pat Morrissey,,,
have,value,name,scryfall_id,collector_number,artist,price,foil_price,nonfoil,foil,others
=I2+J2,=I2*G2+J2*H2,Dark Ritual,4ebcd681-1871-4914-bcd7-6bd95829f6e0,120,Justin Hampton,0.98,,,,"=IF('LEA'!A3>0,""LEA: ""&'LEA'!A3&"", "","""")&IF('HOP'!A3>0,""HOP: ""&'HOP'!A3&"", "","""")"
=I3+J3,=I3*G3+J3*H3,Forest,fbdcbd97-90a9-45ea-94f6-2a1c6faaf965,380,Pat Morrissey,0.8,,1,,
=I4+J4,=I4*G4+J4*H4,Forest,b346b784-7bde-49d0-bfa9-56236cbe19d9,381,Pat Morrissey,1.02,,,2,
=I5+J5,=I5*G5+J5*H5,Forest,768c4d8f-5700-4f0a-9ff2-58422aeb1dac,382,Pat Morrissey,0.36,,3,4,
=I6+J6,=I6*G6+J6*H6,Snow-Covered Forest,4c0ad95c-d62c-4138-ada0-fa39a63a449e,383,Pat Morrissey,1.65,,,,
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
code,name,release,block,type,cards,unique,playsets,count
Total,,,,,=SUM(F3:F65535),=SUM(G3:G65535),=SUM(H3:H65535),=SUM(I3:I65535)
LEA,Limited Edition Alpha,1993-08-05 00:00:00,Core Set,core,4,"=COUNTIF('LEA'!A:A,"">0"")","=COUNTIF('LEA'!A:A,"">=4"")",=SUM('LEA'!A:A)
FEM,Fallen Empires,1994-11-01 00:00:00,,expansion,4,"=COUNTIF('FEM'!A:A,"">0"")","=COUNTIF('FEM'!A:A,"">=4"")",=SUM('FEM'!A:A)
ICE,Ice Age,1995-06-03 00:00:00,Ice Age,expansion,5,"=COUNTIF('ICE'!A:A,"">0"")","=COUNTIF('ICE'!A:A,"">=4"")",=SUM('ICE'!A:A)
S00,Starter 2000,2000-04-01 00:00:00,,starter,1,"=COUNTIF('S00'!A:A,"">0"")","=COUNTIF('S00'!A:A,"">=4"")",=SUM('S00'!A:A)
CHK,Champions of Kamigawa,2004-10-01 00:00:00,Kamigawa,expansion,2,"=COUNTIF('CHK'!A:A,"">0"")","=COUNTIF('CHK'!A:A,"">=4"")",=SUM('CHK'!A:A)
BOK,Betrayers of Kamigawa,2005-02-04 00:00:00,Kamigawa,expansion,1,"=COUNTIF('BOK'!A:A,"">0"")","=COUNTIF('BOK'!A:A,"">=4"")",=SUM('BOK'!A:A)
SOK,Saviors of Kamigawa,2005-06-03 00:00:00,Kamigawa,expansion,1,"=COUNTIF('SOK'!A:A,"">0"")","=COUNTIF('SOK'!A:A,"">=4"")",=SUM('SOK'!A:A)
HOP,Planechase,2009-09-04 00:00:00,,planechase,2,"=COUNTIF('HOP'!A:A,"">0"")","=COUNTIF('HOP'!A:A,"">=4"")",=SUM('HOP'!A:A)
PMBS,Mirrodin Besieged Promos,2011-02-03 00:00:00,Scars of Mirrodin,promo,2,"=COUNTIF('PMBS'!A:A,"">0"")","=COUNTIF('PMBS'!A:A,"">=4"")",=SUM('PMBS'!A:A)
MBS,Mirrodin Besieged,2011-02-04 00:00:00,Scars of Mirrodin,expansion,2,"=COUNTIF('MBS'!A:A,"">0"")","=COUNTIF('MBS'!A:A,"">=4"")",=SUM('MBS'!A:A)
NEO,Kamigawa: Neon Dynasty,2022-02-18 00:00:00,,expansion,3,"=COUNTIF('NEO'!A:A,"">0"")","=COUNTIF('NEO'!A:A,"">=4"")",=SUM('NEO'!A:A)
PNEO,Kamigawa: Neon Dynasty Promos,2022-02-18 00:00:00,,promo,2,"=COUNTIF('PNEO'!A:A,"">0"")","=COUNTIF('PNEO'!A:A,"">=4"")",=SUM('PNEO'!A:A)
code,name,release,block,type,cards,unique,playsets,count,value,nonbulk
Total,,,,,=SUM(F3:F65535),=SUM(G3:G65535),=SUM(H3:H65535),=SUM(I3:I65535),=SUM(J3:J65535),=SUM(K3:K65535)
LEA,Limited Edition Alpha,1993-08-05 00:00:00,Core Set,core,4,"=COUNTIF('LEA'!A:A,"">0"")","=COUNTIF('LEA'!A:A,"">=4"")",=SUM('LEA'!A:A),=SUM('LEA'!B:B),"=SUMIF('LEA'!B:B,"">=5"")"
FEM,Fallen Empires,1994-11-01 00:00:00,,expansion,4,"=COUNTIF('FEM'!A:A,"">0"")","=COUNTIF('FEM'!A:A,"">=4"")",=SUM('FEM'!A:A),=SUM('FEM'!B:B),"=SUMIF('FEM'!B:B,"">=5"")"
ICE,Ice Age,1995-06-03 00:00:00,Ice Age,expansion,5,"=COUNTIF('ICE'!A:A,"">0"")","=COUNTIF('ICE'!A:A,"">=4"")",=SUM('ICE'!A:A),=SUM('ICE'!B:B),"=SUMIF('ICE'!B:B,"">=5"")"
S00,Starter 2000,2000-04-01 00:00:00,,starter,1,"=COUNTIF('S00'!A:A,"">0"")","=COUNTIF('S00'!A:A,"">=4"")",=SUM('S00'!A:A),=SUM('S00'!B:B),"=SUMIF('S00'!B:B,"">=5"")"
CHK,Champions of Kamigawa,2004-10-01 00:00:00,Kamigawa,expansion,2,"=COUNTIF('CHK'!A:A,"">0"")","=COUNTIF('CHK'!A:A,"">=4"")",=SUM('CHK'!A:A),=SUM('CHK'!B:B),"=SUMIF('CHK'!B:B,"">=5"")"
BOK,Betrayers of Kamigawa,2005-02-04 00:00:00,Kamigawa,expansion,1,"=COUNTIF('BOK'!A:A,"">0"")","=COUNTIF('BOK'!A:A,"">=4"")",=SUM('BOK'!A:A),=SUM('BOK'!B:B),"=SUMIF('BOK'!B:B,"">=5"")"
SOK,Saviors of Kamigawa,2005-06-03 00:00:00,Kamigawa,expansion,1,"=COUNTIF('SOK'!A:A,"">0"")","=COUNTIF('SOK'!A:A,"">=4"")",=SUM('SOK'!A:A),=SUM('SOK'!B:B),"=SUMIF('SOK'!B:B,"">=5"")"
HOP,Planechase,2009-09-04 00:00:00,,planechase,2,"=COUNTIF('HOP'!A:A,"">0"")","=COUNTIF('HOP'!A:A,"">=4"")",=SUM('HOP'!A:A),=SUM('HOP'!B:B),"=SUMIF('HOP'!B:B,"">=5"")"
PMBS,Mirrodin Besieged Promos,2011-02-03 00:00:00,Scars of Mirrodin,promo,2,"=COUNTIF('PMBS'!A:A,"">0"")","=COUNTIF('PMBS'!A:A,"">=4"")",=SUM('PMBS'!A:A),=SUM('PMBS'!B:B),"=SUMIF('PMBS'!B:B,"">=5"")"
MBS,Mirrodin Besieged,2011-02-04 00:00:00,Scars of Mirrodin,expansion,2,"=COUNTIF('MBS'!A:A,"">0"")","=COUNTIF('MBS'!A:A,"">=4"")",=SUM('MBS'!A:A),=SUM('MBS'!B:B),"=SUMIF('MBS'!B:B,"">=5"")"
NEO,Kamigawa: Neon Dynasty,2022-02-18 00:00:00,,expansion,3,"=COUNTIF('NEO'!A:A,"">0"")","=COUNTIF('NEO'!A:A,"">=4"")",=SUM('NEO'!A:A),=SUM('NEO'!B:B),"=SUMIF('NEO'!B:B,"">=5"")"
PNEO,Kamigawa: Neon Dynasty Promos,2022-02-18 00:00:00,,promo,2,"=COUNTIF('PNEO'!A:A,"">0"")","=COUNTIF('PNEO'!A:A,"">=4"")",=SUM('PNEO'!A:A),=SUM('PNEO'!B:B),"=SUMIF('PNEO'!B:B,"">=5"")"
10 changes: 5 additions & 5 deletions tests/serialization/snapshots/test_xlsx/test_write/02 - LEA.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
have,name,scryfall_id,collector_number,artist,nonfoil,foil,others
=F2+G2,Air Elemental,69c3b2a3-0daa-4d42-832d-fcdfda6555ea,46,Richard Thomas,,,
=F3+G3,Dark Ritual,ebb6664d-23ca-456e-9916-afcd6f26aa7f,98,Sandra Everingham,,,"=IF('ICE'!A2>0,""ICE: ""&'ICE'!A2&"", "","""")&IF('HOP'!A3>0,""HOP: ""&'HOP'!A3&"", "","""")"
=F4+G4,Forest,6f1c8cb0-38eb-408b-94e8-16db83999b3b,294,Christopher Rush,,,
=F5+G5,Forest,f20c89d9-71c9-45f5-a9cb-6e253b0a7cca,295,Christopher Rush,,,
have,value,name,scryfall_id,collector_number,artist,price,foil_price,nonfoil,foil,others
=I2+J2,=I2*G2+J2*H2,Air Elemental,69c3b2a3-0daa-4d42-832d-fcdfda6555ea,46,Richard Thomas,,,,,
=I3+J3,=I3*G3+J3*H3,Dark Ritual,ebb6664d-23ca-456e-9916-afcd6f26aa7f,98,Sandra Everingham,,,,,"=IF('ICE'!A2>0,""ICE: ""&'ICE'!A2&"", "","""")&IF('HOP'!A3>0,""HOP: ""&'HOP'!A3&"", "","""")"
=I4+J4,=I4*G4+J4*H4,Forest,6f1c8cb0-38eb-408b-94e8-16db83999b3b,294,Christopher Rush,63.38,,,,
=I5+J5,=I5*G5+J5*H5,Forest,f20c89d9-71c9-45f5-a9cb-6e253b0a7cca,295,Christopher Rush,84.35,,,,
10 changes: 5 additions & 5 deletions tests/serialization/snapshots/test_xlsx/test_write/03 - FEM.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
have,name,scryfall_id,collector_number,artist,nonfoil,foil,others
=F2+G2,Thallid,4caaf31b-86a9-485b-8da7-d5b526ed1233,74a,"Edward P. Beard, Jr.",,,
=F3+G3,Thallid,80f8f778-ae31-45cd-b27f-f93a07853ede,74b,Jesper Myrfors,,,
=F4+G4,Thallid,2cf2f3da-9101-439d-8caa-910ff40bfbb3,74c,Ron Spencer,,,
=F5+G5,Thallid,01827286-b104-41c5-bac9-7c38414bc40e,74d,Daniel Gelon,,,
have,value,name,scryfall_id,collector_number,artist,price,foil_price,nonfoil,foil,others
=I2+J2,=I2*G2+J2*H2,Thallid,4caaf31b-86a9-485b-8da7-d5b526ed1233,74a,"Edward P. Beard, Jr.",0.24,,,,
=I3+J3,=I3*G3+J3*H3,Thallid,80f8f778-ae31-45cd-b27f-f93a07853ede,74b,Jesper Myrfors,0.19,,,,
=I4+J4,=I4*G4+J4*H4,Thallid,2cf2f3da-9101-439d-8caa-910ff40bfbb3,74c,Ron Spencer,0.24,,,,
=I5+J5,=I5*G5+J5*H5,Thallid,01827286-b104-41c5-bac9-7c38414bc40e,74d,Daniel Gelon,0.17,,,,
12 changes: 6 additions & 6 deletions tests/serialization/snapshots/test_xlsx/test_write/04 - ICE.csv
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
have,name,scryfall_id,collector_number,artist,nonfoil,foil,others
=F2+G2,Dark Ritual,4ebcd681-1871-4914-bcd7-6bd95829f6e0,120,Justin Hampton,,,"=IF('LEA'!A3>0,""LEA: ""&'LEA'!A3&"", "","""")&IF('HOP'!A3>0,""HOP: ""&'HOP'!A3&"", "","""")"
=F3+G3,Forest,fbdcbd97-90a9-45ea-94f6-2a1c6faaf965,380,Pat Morrissey,,,
=F4+G4,Forest,b346b784-7bde-49d0-bfa9-56236cbe19d9,381,Pat Morrissey,,,
=F5+G5,Forest,768c4d8f-5700-4f0a-9ff2-58422aeb1dac,382,Pat Morrissey,,,
=F6+G6,Snow-Covered Forest,4c0ad95c-d62c-4138-ada0-fa39a63a449e,383,Pat Morrissey,,,
have,value,name,scryfall_id,collector_number,artist,price,foil_price,nonfoil,foil,others
=I2+J2,=I2*G2+J2*H2,Dark Ritual,4ebcd681-1871-4914-bcd7-6bd95829f6e0,120,Justin Hampton,0.98,,,,"=IF('LEA'!A3>0,""LEA: ""&'LEA'!A3&"", "","""")&IF('HOP'!A3>0,""HOP: ""&'HOP'!A3&"", "","""")"
=I3+J3,=I3*G3+J3*H3,Forest,fbdcbd97-90a9-45ea-94f6-2a1c6faaf965,380,Pat Morrissey,0.8,,,,
=I4+J4,=I4*G4+J4*H4,Forest,b346b784-7bde-49d0-bfa9-56236cbe19d9,381,Pat Morrissey,1.02,,,,
=I5+J5,=I5*G5+J5*H5,Forest,768c4d8f-5700-4f0a-9ff2-58422aeb1dac,382,Pat Morrissey,0.36,,,,
=I6+J6,=I6*G6+J6*H6,Snow-Covered Forest,4c0ad95c-d62c-4138-ada0-fa39a63a449e,383,Pat Morrissey,1.65,,,,
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
have,name,scryfall_id,collector_number,artist,nonfoil,foil,others
=F2+G2,Rhox,5d5f3f57-410f-4ee2-b93c-f5051a068828,43,Mark Zug,7,12,
have,value,name,scryfall_id,collector_number,artist,price,foil_price,nonfoil,foil,others
=I2+J2,=I2*G2+J2*H2,Rhox,5d5f3f57-410f-4ee2-b93c-f5051a068828,43,Mark Zug,,0.78,7,12,
Loading

0 comments on commit a3d0114

Please sign in to comment.