Generating plausible Strat-O-Matic cards from MLB data
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
2016-batting-pitching.json
2016-standard-batting.json
2016-standard-fielding.json
2016-standard-pitching.json
LICENSE
README.md
app.js
baseball.jpg
card.js
computerfont.ttf
jake_arrieta.pdf
kris_bryant.pdf
notes.txt
package.json
player.js
team.js

README.md

strat-o-rama

DISCLAIMER: I am not affiliated with Strat-O-Matic Media, LLC. The cards and statistics generated by this application are not compatible with the official Strat-O-Matic game and are for academic purposes only.

PROPOSITION: Using the formulas found on Bruce Bundy's site, and data from Baseball Reference, try to create plausible SOM cards.

INSTRUCTIONS: Download or clone this repository. Navigate to the directory and run

npm install

If there are no errors, run the app file, passing in a player's name as an argument. Note: The name must be spelled and capitalized exactly as it is in the json files or on Baseball Reference. E.g.:

node app "Kris Bryant"

A pdf will be generated with that player's stats interpreted into plausible results. The card will not be the same as the official card, but should have a relatively accurate distribution of at-bat outcomes.

If a pitcher's name is supplied, a pitcher's card will be generated. If you'd prefer to output the pitcher's batting card instead, just pass in the optional -b flag. E.g.:

node app "Jake Arrieta" -b

You can also generate an entire team at once. Pass in the team's capitalized three-letter abbreviation as found on Baseball Reference and it will create a directory with each player in it. E.g.:

node app "CHC"

If you'd like to generate cards for a different year, modify the fs.readFileSync function calls towards the beginning of the player.js file to accept new files. You'll need to make four new json files -- standard pitching, standard batting, standard fielding, and batting-pitching. You can export this data on Baseball Reference. You'll need to transform the .csv files into .json files. The convertcsv site works well for this. In the new json files, find and replace all the FIELD1, FIELD2, etc. headings with the correct value. See the included 2016 json files for an example.

No Warranty

"As-Is". The Software is provided "as is," with all faults, defects and errors, and without warranty of any kind.

No Liability. Licensor does not warrant that the Software will be free of bugs, errors, viruses or other defects, and Licensor shall have no liability of any kind for the use of or inability to use the software, the software content or any associated service.