Paper Dynasty Card Creation - Baseball card generation system
Go to file
2026-04-04 03:13:34 +00:00
.claude
batters Merge branch 'main' into ai/paper-dynasty-card-creation-15 2026-03-23 12:12:18 +00:00
card-output
custom_cards feat: implement tweak_archetype() and manual_adjustments() (#12) 2026-03-23 07:41:46 -05:00
data-input
data-output
defenders
docs Merge branch 'main' into wip/refractor-card-art 2026-04-04 03:13:29 +00:00
html work
logs
pd_cards
pitchers fix: use logger.exception() in calculate_pitcher_ratings error handler 2026-03-23 07:35:31 -05:00
scouting
scripts
tests Merge branch 'main' into ai/paper-dynasty-card-creation#21 2026-03-23 13:24:40 +00:00
.env.example
.gitignore
analyze_cardset_rarity.py
automated_data_fetcher.py
batter-deltas.csv
batting_stats.csv
card_layout.py
check_cards_and_upload.py
check_cards.py
check_cardset_rarity.py
check_player_names.py
CLAUDE.md
create_kalin_young.py
create_sphealthamus_spheal.py
create_valerie_theolia.py
creation_helpers.py fix: replace wildcard import from db_calls_card_creation (#13) 2026-03-23 07:37:16 -05:00
db_calls_card_creation.py
db_calls.py fix: increase API timeouts to prevent bulk query failures 2026-03-30 07:53:58 -05:00
exceptions.py
fix_cardpositions.py
fix_player_names.py
fix_switch_hitters.py
generate_arm_ratings_csv.py
live_series_update.py
migrate_all_cards_to_s3.py
new-batters.csv
new-pitchers.csv
offense_col_resolver.py
pitcher-deltas.csv
pitching_stats.csv
pkmn.json
post_raw_player_csv.py
PROMO_CARD_FIX.md
pull_pitching_stats.py
pybaseball_doodling.py
pyproject.toml
pytest.ini
rank_pitching_staffs.py
RARITY_BUG_FIX_SUMMARY.md
rarity_thresholds.py
README.txt
REFACTORING_COMPLETE.md
REFACTORING_SUMMARY.md
refresh_cards.py
regenerate_lefty_cards.py
requirements.txt
RETROSHEET_2005_MIGRATION.md
retrosheet_data.py fix: derive SEASON_PCT from date range instead of hardcoding half-season (#9) 2026-03-23 07:40:35 -05:00
retrosheet_transformer.py
retrosheet.db
scouting_batters.py fix: increase API timeouts to prevent bulk query failures 2026-03-30 07:53:58 -05:00
scouting_pitchers.py
test_data_fetcher_demo.py
test_nan_handling.py
test_retrosheet_arms.py
upload_lefty_cards_to_s3.py
uv.lock
validate_negative_values.py











#######
CARD CREATION PROCESS
#######

1) Download stats
    FanGraphs / https://www.fangraphs.com/leaders/splits-leaderboards
    - Batting
        - vL Standard / vlhp-basic.csv
        - vL Batted Balls / vlhp-rate.csv
        - vR Standard / vrhp-basic.csv
        - vR Batted Balls / vrhp-rate.csv
    - Pitching
        - vL Standard / vlhh-basic.csv
        - vL Batted Balls / vlhh-rate.csv
        - vR Standard / vrhh-basic.csv
        - vR Batted Balls / vrhh-rate.csv
    Baseball Reference
    - running.csv
        - https://www.baseball-reference.com/leagues/majors/2023-baserunning-batting.shtml
        - Remove header lines
    - pitching.csv
        - https://www.baseball-reference.com/leagues/majors/2023-standard-pitching.shtml
2) Run Card Updates (Python Configuration)
3) Check Card Validity (Python Configuration)



























#######
OLD DATA REQUIREMENTS
#######

- Add any new players to players.csv for import
- Create directory in /data-input in format `XXXX Season Cardset`
- Upload the following csv files:
    - baserunning-data.csv
        - https://www.baseball-reference.com/leagues/majors/2023-baserunning-batting.shtml
        - Remove header lines
    - batter-stats.csv
        - https://www.fangraphs.com/leaders/splits-leaderboards
        - Remove header lines
        - 20 PA vL / 40 PA vR for Live || 50 PA vL / 75 PA vR for legacy seasons
    - defense-X.csv (each position)
        - https://www.baseball-reference.com/leagues/majors/2023-specialpos_p-fielding.shtml
        - replace the `p` in `p-fielding` with 1b/2b/lf
        - Column Changes (pre-2013)
            - Catchers: add column between Rgood and RsbC
            - 1b/2b/3b/ss: add 3 columns between Rgood and Rbnt
    - defense-of.csv (don't forget combined OF)
        - https://www.baseball-reference.com/leagues/majors/2023-specialpos_of-fielding.shtml
        - replace the `p` in `p-fielding` with of
    - pitcher-data.csv
        - https://www.baseball-reference.com/leagues/majors/2023-standard-pitching.shtml
    - pitcher-stats.csv
        - https://www.fangraphs.com/leaders/splits-leaderboards
        - Remove header lines
        - 20 TBF vL / 40 TBF vR for Live || 50 TBF vL / 75 TBF vR for legacy seasons

#######
OLD CARD CREATION PROCESS
#######

1) Import new players for sba_id with `1. Import Players`
2) Confirm cardset exists; if not, create now
3) Create cards with `3. Card Creation`
4) Generate csv output with `4. Card Output`
5) Upload output files into Sheets for Component Studio import
6) Upload ratings output files into Sheets for PD Ratings Guide
7) Import cards into Component Studio
8) Export -> Download All from Component Studio
9) Rename image files to <first>.<last>.png