Paper Dynasty Card Creation - Baseball card generation system
Go to file
2026-03-23 12:12:18 +00:00
.claude Remove hardcoded secrets, load API token from environment 2026-03-20 12:38:01 -05:00
batters Merge branch 'main' into ai/paper-dynasty-card-creation-15 2026-03-23 12:12:18 +00:00
card-output August '23 PotM Cards 2023-09-07 13:14:15 -05:00
custom_cards Run black and ruff across entire codebase 2026-03-08 14:24:33 -05:00
data-input Update scouting data and card creation scripts 2025-12-02 16:25:42 -06:00
data-output Card Creation Automation 2025-11-23 01:28:33 -06:00
defenders Remove unused defenders/creation.py stub 2026-03-08 14:24:33 -05:00
docs docs: update Phase 0 status with PR references 2026-03-17 10:13:18 -05:00
html work fielding and batting functional 2023-09-24 18:58:44 -05:00
logs Card Creation Automation 2025-11-23 01:28:33 -06:00
pd_cards feat: configurable API URL for local high-concurrency card rendering 2026-03-16 10:27:16 -05:00
pitchers Merge branch 'main' into ai/paper-dynasty-card-creation-15 2026-03-23 12:12:18 +00:00
scouting Add card generation pipeline agents and refresh scouting data 2026-02-16 14:16:50 -06:00
scripts Merge branch 'main' into fix/2-3-security-hardcoded-secrets 2026-03-23 03:50:00 +00:00
tests fix: remove test_positions_df non-test that always passes (#16) 2026-03-21 02:02:10 -05:00
.env.example Remove hardcoded secrets, load API token from environment 2026-03-20 12:38:01 -05:00
.gitignore Batter stat generation complete 2024-10-19 01:05:23 -05:00
analyze_cardset_rarity.py Run black and ruff across entire codebase 2026-03-08 14:24:33 -05:00
automated_data_fetcher.py Run black and ruff across entire codebase 2026-03-08 14:24:33 -05:00
batter-deltas.csv Update 2005 Live cardset through mid-August (73% season) 2026-02-15 18:56:19 -06:00
batting_stats.csv Update 2005 Live cardset through mid-August (73% season) 2026-02-15 18:56:19 -06:00
card_layout.py Add FullCard/CardColumn/CardResult models and card builder pipeline 2026-02-25 16:21:26 -06:00
check_cards_and_upload.py feat: configurable API URL for local high-concurrency card rendering 2026-03-16 10:27:16 -05:00
check_cards.py Run black and ruff across entire codebase 2026-03-08 14:24:33 -05:00
check_cardset_rarity.py Run black and ruff across entire codebase 2026-03-08 14:24:33 -05:00
check_player_names.py Run black and ruff across entire codebase 2026-03-08 14:24:33 -05:00
CLAUDE.md feat: configurable API URL for local high-concurrency card rendering 2026-03-16 10:27:16 -05:00
create_kalin_young.py Run black and ruff across entire codebase 2026-03-08 14:24:33 -05:00
create_sphealthamus_spheal.py Run black and ruff across entire codebase 2026-03-08 14:24:33 -05:00
create_valerie_theolia.py Run black and ruff across entire codebase 2026-03-08 14:24:33 -05:00
creation_helpers.py Merge branch 'main' into ai/paper-dynasty-card-creation#10 2026-03-23 03:53:10 +00:00
db_calls_card_creation.py Run black and ruff across entire codebase 2026-03-08 14:24:33 -05:00
db_calls.py Remove hardcoded secrets, load API token from environment 2026-03-20 12:38:01 -05:00
exceptions.py Run black and ruff across entire codebase 2026-03-08 14:24:33 -05:00
fix_cardpositions.py Run black and ruff across entire codebase 2026-03-08 14:24:33 -05:00
fix_player_names.py Run black and ruff across entire codebase 2026-03-08 14:24:33 -05:00
fix_switch_hitters.py Run black and ruff across entire codebase 2026-03-08 14:24:33 -05:00
generate_arm_ratings_csv.py Run black and ruff across entire codebase 2026-03-08 14:24:33 -05:00
live_series_update.py Run black and ruff across entire codebase 2026-03-08 14:24:33 -05:00
migrate_all_cards_to_s3.py Run black and ruff across entire codebase 2026-03-08 14:24:33 -05:00
new-batters.csv Update 2005 Live cardset through mid-August (73% season) 2026-02-15 18:56:19 -06:00
new-pitchers.csv Update 2005 Live cardset through mid-August (73% season) 2026-02-15 18:56:19 -06:00
offense_col_resolver.py Add offense_col resolver for retrosheet pipeline to fix 883 silent KeyErrors 2026-02-26 15:37:59 -06:00
pitcher-deltas.csv Update 2005 Live cardset through mid-August (73% season) 2026-02-15 18:56:19 -06:00
pitching_stats.csv Update 2005 Live cardset through mid-August (73% season) 2026-02-15 18:56:19 -06:00
pkmn.json 1996 Data 2024-12-23 09:57:51 -06:00
post_raw_player_csv.py Run black and ruff across entire codebase 2026-03-08 14:24:33 -05:00
PROMO_CARD_FIX.md CLAUDE: Refactor to reduce code fragility - extract business logic and add constants 2025-10-31 22:03:22 -05:00
pull_pitching_stats.py Run black and ruff across entire codebase 2026-03-08 14:24:33 -05:00
pybaseball_doodling.py Run black and ruff across entire codebase 2026-03-08 14:24:33 -05:00
pyproject.toml Remove hardcoded secrets, load API token from environment 2026-03-20 12:38:01 -05:00
pytest.ini Moving older scripts into holding cell 2024-10-17 09:28:02 -05:00
rank_pitching_staffs.py Run black and ruff across entire codebase 2026-03-08 14:24:33 -05:00
RARITY_BUG_FIX_SUMMARY.md Code stabilization & retrosheet functionality 2025-11-08 16:57:35 -06:00
rarity_thresholds.py Run black and ruff across entire codebase 2026-03-08 14:24:33 -05:00
README.txt Migrate db calls to aiohttp 2023-11-19 12:27:40 -06:00
REFACTORING_COMPLETE.md CLAUDE: Add comprehensive documentation for refactoring session 2025-10-31 23:44:32 -05:00
REFACTORING_SUMMARY.md CLAUDE: Refactor to reduce code fragility - extract business logic and add constants 2025-10-31 22:03:22 -05:00
refresh_cards.py Run black and ruff across entire codebase 2026-03-08 14:24:33 -05:00
regenerate_lefty_cards.py Run black and ruff across entire codebase 2026-03-08 14:24:33 -05:00
requirements.txt chore: pin peewee and polars to exact versions (#24) 2026-03-20 16:33:00 -05:00
RETROSHEET_2005_MIGRATION.md Code stabilization & retrosheet functionality 2025-11-08 16:57:35 -06:00
retrosheet_data.py fix: remove dead LAST_WEEK_RATIO ternary — both branches are 0.0 (#19) 2026-03-21 07:03:38 -05:00
retrosheet_transformer.py Run black and ruff across entire codebase 2026-03-08 14:24:33 -05:00
retrosheet.db Add retrosheet db 2024-10-17 09:28:59 -05:00
scouting_batters.py Run black and ruff across entire codebase 2026-03-08 14:24:33 -05:00
scouting_pitchers.py Run black and ruff across entire codebase 2026-03-08 14:24:33 -05:00
test_data_fetcher_demo.py Run black and ruff across entire codebase 2026-03-08 14:24:33 -05:00
test_nan_handling.py Run black and ruff across entire codebase 2026-03-08 14:24:33 -05:00
test_retrosheet_arms.py Run black and ruff across entire codebase 2026-03-08 14:24:33 -05:00
upload_lefty_cards_to_s3.py Run black and ruff across entire codebase 2026-03-08 14:24:33 -05:00
uv.lock Update 2005 Live cardset through mid-August (73% season) 2026-02-15 18:56:19 -06:00
validate_negative_values.py Run black and ruff across entire codebase 2026-03-08 14:24:33 -05:00











#######
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