This repository generates an Microsoft® Excel® for Microsoft 365 MSO for keeping track of an X-Wing: The Miniature Game 2.0/2.5 collection.
As a command line interface (CLI), it gives you the ability to take your raw
yasb collection and dump it to a json
file that can be further processed with something jq
.
- Download the latest spreadsheet
from the
Releases
. - In the
Expansions
sheet, input the number of each expansion you own in theOwned
column. - In the other sheets,
Ships
,Pilots
,Upgrades
, add any loose ships, such as 1.0 models still in your collection to theSingles
column.
That's it. The Totals
column will update with your Singles
and Expansion
counts per-item summed.
- You will need a working
rust
toolchain. Refer to the installation and usage instructions for your platform. - Clone this repo and its submodules:
git submodule init
. - Log in to https://yasb.app, access your raw collection at https://login.yasb.app/collection, and save the
json
tocollection.json
. - Run the tool with
cargo run
. This will produce aninventory.json
, which will containships
,pilots
, andupgrades
lists. - Use something like
jq
to turn it into CSV (from StackOverflow):
cargo run -- --format json --collection collection.json
jq -r '.pilots | (map(keys) | add | unique) as $cols | map(. as $row | $cols | map($row[.])) as $rows | $cols, $rows[] | @csv' inventory.json > pilots.csv
jq -r '.upgrades | (map(keys) | add | unique) as $cols | map(. as $row | $cols | map($row[.])) as $rows | $cols, $rows[] | @csv' inventory.json > upgrades.csv
jq -r '.ships | (map(keys) | add | unique) as $cols | map(. as $row | $cols | map($row[.])) as $rows | $cols, $rows[] | @csv' inventory.json > ships.csv
- My collection is far from complete, but I still have over 1100+ pilot and upgrade cards that don't fit in a single organizer or box, so I need a way to more accurately count by type and restrictions to help me organize.
- How do I get X if I don't have it? What am I actually missing out on if I don't pick up an expansion?
- List building tools are focused on the list building, so inventory management is a much lower priority for them.
- I also couldn't find anyone keeping an updated Excel template or anything else of that sort.
- I like the idea of being able to keep a copy of my inventory list local and flexible.
- Hopefully this is useful to someone else, as either an exercise in working
xwing-data2
or as inspiration for something better.
Why rust?
- I'm not a JavaScript/coffee/typescript programmer and need an excuse
to use
rust
at all since it is not my day job currently. - I tried to use the pyxwb2 and immediately
ran into having to do multiple checks for optional items such as
restrictions
, and figured I may as well get the compiler's help when working with them.
-
XWS has a definitive definition of every item in the game, but
xwing-data2
lacks a listing of expansion contents, so expansions.json will need to continue to be updated. -
YASB uses names and not unique IDs in their collections and those change over time. YASB is pretty popular, so the goal will be to update to support importing from a YASB collection dump.
-
Windows and character encodings. Run the following nonsense in your PowerShell session before trying any of this:
> [System.Console]::OutputEncoding=[System.Text.Encoding]::UTF8
- YASB Collection Quirks
- If you used YASP pre-2.0, your 1.0 expansions are still there, but of won't be in YASB, except for the core sets and the ships that came with obstacles, so they will print out as warning.
- "First Edition VT-49 Decimator": Records appear to have been removed when the VT-49 was reprinted, so can't be imported like the other 1.0 obstacle sets.
Have a look at the issues.
This is a basic rust
project with some tests run in GitHub Actions, try to add
some tests for anything you are going to add.
- Update the
xwing-data2
submodule to a version that includes the expansion contents. - Add expansion to src/expansions/expansions.json.
- TODO
- Check if any ships can be removed from the
swzunreleased
placeholder.
Wave numbers are based on sku, which is mostly related to the release date. This is in contrast to the waves in the wiki which groups by announcement date and separates some expansions which I think are better grouped by theme.
See this terrible script.
All Star Wars and X-Wing: TMG content itself is copyright and trademark of its owners: FFG/AMG/LucasArts.
The initial content for expansions.json
and any yasb
related conversions
are from the yasb
project, copyright
2012 Geordan Rosario and others uses under an MIT style license.
This also would not be possible with xwing-data2
, also under an MIT license.
Other content fixes are from the X-Wing Miniatures: Second Edition Wiki, community content is covered by CC BY-SA.