nfelodcm 0.1.16__tar.gz → 0.1.18__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/PKG-INFO +2 -2
  2. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/__init__.py +1 -0
  3. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm/Maps/coaches.json +1 -1
  4. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm/Maps/filmmargins.json +1 -1
  5. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm/Maps/games.json +2 -2
  6. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm/Maps/hfa.json +1 -1
  7. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm/Maps/logos.json +1 -1
  8. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm/Maps/market_data.json +1 -1
  9. nfelodcm-0.1.18/nfelodcm/Maps/nfelo_games.json +67 -0
  10. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm/Maps/participants.json +1 -1
  11. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm/Maps/pbp.json +2 -2
  12. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm/Maps/player_stats.json +2 -2
  13. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm/Maps/players.json +2 -2
  14. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm/Maps/qbelo.json +1 -1
  15. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm/Maps/qbr.json +2 -2
  16. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm/Maps/rosters.json +2 -2
  17. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm/Maps/srs_ratings.json +1 -1
  18. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm/Maps/stadiums.json +1 -1
  19. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm/Maps/team_stadiums.json +9 -5
  20. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm/Maps/wepa.json +1 -1
  21. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm/Maps/wt_ratings.json +1 -1
  22. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm/Utilities/__init__.py +2 -1
  23. nfelodcm-0.1.18/nfelodcm/Utilities/load_maps.py +30 -0
  24. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm/nfelodcm.py +48 -7
  25. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm.egg-info/PKG-INFO +2 -2
  26. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm.egg-info/SOURCES.txt +4 -0
  27. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/pyproject.toml +1 -1
  28. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/README.md +0 -0
  29. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm/Engine/Assignments/__init__.py +0 -0
  30. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm/Engine/Assignments/assignment.py +0 -0
  31. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm/Engine/Assignments/assignments/__init__.py +0 -0
  32. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm/Engine/Assignments/assignments/desc_based_plays.py +0 -0
  33. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm/Engine/Assignments/assignments/fastr_team_repl.py +0 -0
  34. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm/Engine/Assignments/assignments/format_player_file.py +0 -0
  35. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm/Engine/Assignments/assignments/format_qb_file.py +0 -0
  36. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm/Engine/Assignments/assignments/penalty_formatting.py +0 -0
  37. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm/Engine/Assignments/assignments/score_clean.py +0 -0
  38. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm/Engine/Assignments/assignments/temp_players_handle.py +0 -0
  39. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm/Engine/DCMTable.py +0 -0
  40. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm/Engine/Primatives/DataPull.py +0 -0
  41. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm/Engine/Primatives/Freshness.py +0 -0
  42. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm/Engine/Primatives/LocalIO.py +0 -0
  43. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm/Engine/Primatives/TableMap.py +0 -0
  44. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm/Engine/Primatives/__init__.py +0 -0
  45. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm/Engine/__init__.py +0 -0
  46. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm/Utilities/checks.py +0 -0
  47. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm/Utilities/extract_map.py +0 -0
  48. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm/Utilities/global_variables.json +0 -0
  49. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm/Utilities/retrieve_season_state.py +0 -0
  50. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm/Utilities/set_season_state.py +0 -0
  51. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm/tests.py +0 -0
  52. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm.egg-info/dependency_links.txt +0 -0
  53. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm.egg-info/requires.txt +0 -0
  54. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/nfelodcm.egg-info/top_level.txt +0 -0
  55. {nfelodcm-0.1.16 → nfelodcm-0.1.18}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: nfelodcm
3
- Version: 0.1.16
3
+ Version: 0.1.18
4
4
  Summary: Python package for loading and caching CSVs hosted on github into pandas dataframes
5
5
  Author-email: Robert Greer <nfl@robbygreer.com>
6
6
  Maintainer-email: Robert Greer <nfl@robbygreer.com>
@@ -2,4 +2,5 @@ from .nfelodcm.nfelodcm import get_df
2
2
  from .nfelodcm.nfelodcm import load
3
3
  from .nfelodcm.nfelodcm import get_map
4
4
  from .nfelodcm.nfelodcm import get_season_state
5
+ from .nfelodcm.nfelodcm import list_tables
5
6
  from .nfelodcm.tests import test_all_maps
@@ -10,7 +10,7 @@
10
10
  "gh_api_endpoint": "https://api.github.com/repos/greerreNFL/coaches/commits?path=coaches.csv",
11
11
  "gh_release_tag": null,
12
12
  "sla_seconds": 900,
13
- "last_freshness_check": "2025-02-16T22:16:46.766999+00:00"
13
+ "last_freshness_check": "2025-04-11T03:43:44.723569+00:00"
14
14
  },
15
15
  "iter": {
16
16
  "type": null,
@@ -10,7 +10,7 @@
10
10
  "gh_api_endpoint": "https://api.github.com/repos/greerreNFL/filmmargin/commits?path=film_margins.csv",
11
11
  "gh_release_tag": null,
12
12
  "sla_seconds": 900,
13
- "last_freshness_check": "2025-02-16T22:09:33.640711+00:00"
13
+ "last_freshness_check": "2025-04-11T03:40:13.559253+00:00"
14
14
  },
15
15
  "iter": {
16
16
  "type": null,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "games",
3
3
  "description": "nflgamedata games",
4
- "last_local_update": "2025-02-16T22:09:31.790994",
4
+ "last_local_update": "2025-02-21T21:36:03.065281",
5
5
  "download_url": "https://raw.githubusercontent.com/nflverse/nfldata/master/data/games.csv",
6
6
  "compression": null,
7
7
  "engine": "c",
@@ -10,7 +10,7 @@
10
10
  "gh_api_endpoint": "https://api.github.com/repos/nflverse/nfldata/commits",
11
11
  "gh_release_tag": null,
12
12
  "sla_seconds": 500,
13
- "last_freshness_check": "2025-02-16T22:09:31.154882+00:00"
13
+ "last_freshness_check": "2025-04-11T03:40:12.791636+00:00"
14
14
  },
15
15
  "iter": {
16
16
  "type": null,
@@ -10,7 +10,7 @@
10
10
  "gh_api_endpoint": "https://api.github.com/repos/greerreNFL/nfelohfa/commits?path=estimated_hfa.csv",
11
11
  "gh_release_tag": null,
12
12
  "sla_seconds": 900,
13
- "last_freshness_check": "2025-02-16T22:16:48.864737+00:00"
13
+ "last_freshness_check": "2025-04-11T03:43:45.669221+00:00"
14
14
  },
15
15
  "iter": {
16
16
  "type": null,
@@ -10,7 +10,7 @@
10
10
  "gh_api_endpoint": "https://api.github.com/repos/nflverse/nflverse-pbp/commits?path=teams_colors_logos.csv",
11
11
  "gh_release_tag": null,
12
12
  "sla_seconds": 900,
13
- "last_freshness_check": "2025-02-16T22:09:33.199326+00:00"
13
+ "last_freshness_check": "2025-04-11T03:40:13.189362+00:00"
14
14
  },
15
15
  "iter": {
16
16
  "type": null,
@@ -10,7 +10,7 @@
10
10
  "gh_api_endpoint": "https://api.github.com/repos/greerreNFL/nfelomarket_data/commits?path=Data/lines.csv",
11
11
  "gh_release_tag": null,
12
12
  "sla_seconds": 900,
13
- "last_freshness_check": "2025-02-16T22:16:00.686478+00:00"
13
+ "last_freshness_check": "2025-04-11T03:43:14.936702+00:00"
14
14
  },
15
15
  "iter": {
16
16
  "type": null,
@@ -0,0 +1,67 @@
1
+ {
2
+ "name": "nfelo_games",
3
+ "description": "nfelo projections and components by game",
4
+ "last_local_update": "2025-04-11T03:43:09.514955",
5
+ "download_url": "https://raw.githubusercontent.com/greerreNFL/nfelo/refs/heads/main/output_data/nfelo_games.csv",
6
+ "compression": null,
7
+ "engine": "c",
8
+ "freshness": {
9
+ "type": "gh_commit",
10
+ "gh_api_endpoint": "https://api.github.com/repos/greerreNFL/nfelo/commits?path=output_data/nfelo_games.csv",
11
+ "gh_release_tag": null,
12
+ "sla_seconds": 900,
13
+ "last_freshness_check": "2025-04-11T03:43:08.957068+00:00"
14
+ },
15
+ "iter": {
16
+ "type": null,
17
+ "start": null
18
+ },
19
+ "assignments": [],
20
+ "map": {
21
+ "game_id": "object",
22
+ "starting_nfelo_home": "float32",
23
+ "starting_nfelo_away": "float32",
24
+ "hfa_mod": "float32",
25
+ "home_bye_mod": "float32",
26
+ "away_bye_mod": "float32",
27
+ "div_game_mod": "float32",
28
+ "dif_surface_mod": "float32",
29
+ "home_time_advantage_mod": "float32",
30
+ "home_538_qb_adj": "float32",
31
+ "away_538_qb_adj": "float32",
32
+ "home_net_qb_mod": "float32",
33
+ "home_net_bye_mod": "float32",
34
+ "nfelo_dif_base": "float32",
35
+ "nfelo_dif_open": "float32",
36
+ "nfelo_dif_close": "float32",
37
+ "nfelo_home_line_open": "float32",
38
+ "nfelo_home_line_close": "float32",
39
+ "nfelo_home_probability_close": "float32",
40
+ "nfelo_home_probability_open": "float32",
41
+ "nfelo_home_cover_prob_close": "float32",
42
+ "nfelo_home_push_prob_close": "float32",
43
+ "nfelo_home_loss_prob_close": "float32",
44
+ "nfelo_away_cover_prob_close": "float32",
45
+ "nfelo_away_push_prob_close": "float32",
46
+ "nfelo_away_loss_prob_close": "float32",
47
+ "home_open_ev": "float32",
48
+ "away_open_ev": "float32",
49
+ "home_close_ev": "float32",
50
+ "away_close_ev": "float32",
51
+ "home_line_open": "float32",
52
+ "home_line_open_price": "float32",
53
+ "away_line_open_price": "float32",
54
+ "home_line_close": "float32",
55
+ "home_line_close_price": "float32",
56
+ "away_line_close_price": "float32",
57
+ "total_line_open": "float32",
58
+ "under_price_open": "float32",
59
+ "over_price_open": "float32",
60
+ "total_line_close": "float32",
61
+ "under_price_close": "float32",
62
+ "over_price_close": "float32",
63
+ "home_implied_win_probability_open": "float32",
64
+ "home_implied_win_probability_close": "float32",
65
+ "hfa_base_mod": "float32"
66
+ }
67
+ }
@@ -10,7 +10,7 @@
10
10
  "gh_api_endpoint": "https://api.github.com/repos/nflverse/nflverse-data/releases/tags",
11
11
  "gh_release_tag": "pbp_participation",
12
12
  "sla_seconds": 900,
13
- "last_freshness_check": "2025-02-16T22:16:40.111639+00:00"
13
+ "last_freshness_check": "2025-04-11T03:43:38.965336+00:00"
14
14
  },
15
15
  "iter": {
16
16
  "type": "season",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pbp",
3
3
  "description": "nflfastR play-by-play",
4
- "last_local_update": "2025-02-16T22:15:30.902710",
4
+ "last_local_update": "2025-04-11T03:42:49.815214",
5
5
  "download_url": "https://github.com/nflverse/nflverse-data/releases/download/pbp/play_by_play_{0}.csv.gz",
6
6
  "compression": "gzip",
7
7
  "engine": "c",
@@ -10,7 +10,7 @@
10
10
  "gh_api_endpoint": "https://api.github.com/repos/nflverse/nflverse-data/releases/tags",
11
11
  "gh_release_tag": "pbp",
12
12
  "sla_seconds": 900,
13
- "last_freshness_check": "2025-02-16T22:09:35.145636+00:00"
13
+ "last_freshness_check": "2025-04-11T03:40:14.186786+00:00"
14
14
  },
15
15
  "iter": {
16
16
  "type": "season",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "player_stats",
3
3
  "description": "nflfastR player stats",
4
- "last_local_update": "2025-02-16T22:15:53.903240",
4
+ "last_local_update": "2025-04-11T03:43:12.955364",
5
5
  "download_url": "https://github.com/nflverse/nflverse-data/releases/download/player_stats/player_stats.csv.gz",
6
6
  "compression": "gzip",
7
7
  "engine": "c",
@@ -10,7 +10,7 @@
10
10
  "gh_api_endpoint": "https://api.github.com/repos/nflverse/nflverse-data/releases/tags",
11
11
  "gh_release_tag": "player_stats",
12
12
  "sla_seconds": 900,
13
- "last_freshness_check": "2025-02-16T22:15:50.270905+00:00"
13
+ "last_freshness_check": "2025-04-11T03:43:10.220176+00:00"
14
14
  },
15
15
  "iter": {
16
16
  "type": null,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "players",
3
3
  "description": "nflfastR player meta data",
4
- "last_local_update": "2025-02-16T22:16:46.380017",
4
+ "last_local_update": "2025-04-11T03:43:44.328746",
5
5
  "download_url": "https://github.com/nflverse/nflverse-data/releases/download/players/players.csv",
6
6
  "compression": null,
7
7
  "engine": "c",
@@ -10,7 +10,7 @@
10
10
  "gh_api_endpoint": "https://api.github.com/repos/nflverse/nflverse-data/releases/tags",
11
11
  "gh_release_tag": "players",
12
12
  "sla_seconds": 900,
13
- "last_freshness_check": "2025-02-16T22:16:42.813778+00:00"
13
+ "last_freshness_check": "2025-04-11T03:43:41.668023+00:00"
14
14
  },
15
15
  "iter": {
16
16
  "type": null,
@@ -10,7 +10,7 @@
10
10
  "gh_api_endpoint": "https://api.github.com/repos/greerreNFL/nfeloqb/commits?path=qb_elos.csv",
11
11
  "gh_release_tag": null,
12
12
  "sla_seconds": 900,
13
- "last_freshness_check": "2025-02-16T22:15:57.129304+00:00"
13
+ "last_freshness_check": "2025-04-11T03:43:13.960461+00:00"
14
14
  },
15
15
  "iter": {
16
16
  "type": null,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "qbr",
3
3
  "description": "nflverse QBR",
4
- "last_local_update": "2025-02-16T22:09:30.769332",
4
+ "last_local_update": "2025-04-11T03:40:12.469427",
5
5
  "download_url": "https://github.com/nflverse/nflverse-data/releases/download/espn_data/qbr_season_level.csv",
6
6
  "compression": null,
7
7
  "engine": "c",
@@ -10,7 +10,7 @@
10
10
  "gh_api_endpoint": "https://api.github.com/repos/nflverse/nflverse-data/releases/tags",
11
11
  "gh_release_tag": "espn_data",
12
12
  "sla_seconds": 900,
13
- "last_freshness_check": "2025-02-16T22:09:29.563951+00:00"
13
+ "last_freshness_check": "2025-04-11T03:40:11.568916+00:00"
14
14
  },
15
15
  "iter": {
16
16
  "type": null,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rosters",
3
3
  "description": "nflfastR rosters",
4
- "last_local_update": "2025-02-16T22:16:39.581240",
4
+ "last_local_update": "2025-04-11T03:43:38.547563",
5
5
  "download_url": "https://github.com/nflverse/nflverse-data/releases/download/rosters/roster_{0}.csv",
6
6
  "compression": null,
7
7
  "engine": "c",
@@ -10,7 +10,7 @@
10
10
  "gh_api_endpoint": "https://api.github.com/repos/nflverse/nflverse-data/releases/tags",
11
11
  "gh_release_tag": "rosters",
12
12
  "sla_seconds": 900,
13
- "last_freshness_check": "2025-02-16T22:16:02.273228+00:00"
13
+ "last_freshness_check": "2025-04-11T03:43:15.395917+00:00"
14
14
  },
15
15
  "iter": {
16
16
  "type": "season",
@@ -10,7 +10,7 @@
10
10
  "gh_api_endpoint": "https://api.github.com/repos/greerreNFL/nfelosrs/commits?path=srs_ratings.csv",
11
11
  "gh_release_tag": null,
12
12
  "sla_seconds": 900,
13
- "last_freshness_check": "2025-02-16T22:15:59.563723+00:00"
13
+ "last_freshness_check": "2025-04-11T03:43:14.511337+00:00"
14
14
  },
15
15
  "iter": {
16
16
  "type": null,
@@ -10,7 +10,7 @@
10
10
  "gh_api_endpoint": "https://api.github.com/repos/greerreNFL/Stadiums/commits?path=data/stadiums.csv",
11
11
  "gh_release_tag": null,
12
12
  "sla_seconds": 900,
13
- "last_freshness_check": "2025-02-16T22:16:47.582418+00:00"
13
+ "last_freshness_check": "2025-04-11T03:43:45.025132+00:00"
14
14
  },
15
15
  "iter": {
16
16
  "type": null,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "team_stadiums",
3
3
  "description": "Metadata and analytics for NFL teams and their stadiums",
4
- "last_local_update": "2025-02-16T22:09:34.777661",
4
+ "last_local_update": "2025-02-21T21:36:04.215102",
5
5
  "download_url": "https://raw.githubusercontent.com/greerreNFL/Stadiums/refs/heads/main/data/team_stadiums.csv",
6
6
  "compression": null,
7
7
  "engine": "c",
@@ -10,7 +10,7 @@
10
10
  "gh_api_endpoint": "https://api.github.com/repos/greerreNFL/Stadiums/commits?path=data/team_stadiums.csv",
11
11
  "gh_release_tag": null,
12
12
  "sla_seconds": 900,
13
- "last_freshness_check": "2025-02-16T22:09:34.634198+00:00"
13
+ "last_freshness_check": "2025-04-11T03:40:13.883435+00:00"
14
14
  },
15
15
  "iter": {
16
16
  "type": null,
@@ -18,11 +18,15 @@
18
18
  },
19
19
  "assignments": [],
20
20
  "map": {
21
+ "team": "object",
22
+ "team_fastr": "object",
23
+ "stadium": "object",
24
+ "is_current": "bool",
21
25
  "stadium_name": "object",
22
26
  "lat": "float32",
23
27
  "lon": "float32",
24
28
  "altitude": "float32",
25
- "heading": "float32",
29
+ "heading": "int32",
26
30
  "first_game_date": "object",
27
31
  "last_game_date": "object",
28
32
  "surface_type": "object",
@@ -33,7 +37,7 @@
33
37
  "zipcode": "object",
34
38
  "country": "object",
35
39
  "tz": "object",
36
- "tz_offset": "float32",
40
+ "tz_offset": "int32",
37
41
  "wikipedia_url": "object",
38
42
  "img_sat_url": "object",
39
43
  "img_logo_url": "object",
@@ -44,7 +48,7 @@
44
48
  "operator": "object",
45
49
  "capacity": "float32",
46
50
  "broke_ground": "float32",
47
- "opened": "float32",
51
+ "opened": "int32",
48
52
  "closed": "float32",
49
53
  "demolished": "float32",
50
54
  "construction_cost": "float32",
@@ -10,7 +10,7 @@
10
10
  "gh_api_endpoint": "https://api.github.com/repos/greerreNFL/wepa/commits?path=data/wepa_by_game_pit.csv",
11
11
  "gh_release_tag": null,
12
12
  "sla_seconds": 900,
13
- "last_freshness_check": "2025-02-16T22:15:54.752364+00:00"
13
+ "last_freshness_check": "2025-04-11T03:43:13.566080+00:00"
14
14
  },
15
15
  "iter": {
16
16
  "type": null,
@@ -10,7 +10,7 @@
10
10
  "gh_api_endpoint": "https://api.github.com/repos/greerreNFL/nfelosrs/commits?path=wt_ratings.csv",
11
11
  "gh_release_tag": null,
12
12
  "sla_seconds": 900,
13
- "last_freshness_check": "2025-02-16T22:16:48.337189+00:00"
13
+ "last_freshness_check": "2025-04-11T03:43:45.314437+00:00"
14
14
  },
15
15
  "iter": {
16
16
  "type": null,
@@ -4,4 +4,5 @@ from .set_season_state import set_season_state
4
4
  from .checks import check_struc
5
5
  from .checks import check_map_type
6
6
  from .checks import check_data
7
- from .checks import check_data_folder
7
+ from .checks import check_data_folder
8
+ from .load_maps import load_maps
@@ -0,0 +1,30 @@
1
+ ## built-in ##
2
+ import pathlib
3
+ import json
4
+ from typing import Dict
5
+
6
+ def load_maps() -> Dict[str, Dict]:
7
+ '''
8
+ Loads all maps from the Maps folder
9
+
10
+ Parameters:
11
+ * None
12
+
13
+ Returns:
14
+ * Dict[str, Dict] - a dictionary of table names and their corresponding maps
15
+ '''
16
+ ## container for maps ##
17
+ maps = {}
18
+ ## get maps ##
19
+ maps_dir = pathlib.Path(__file__).parent.parent.resolve() / 'Maps'
20
+ existing_maps = list(maps_dir.glob('*.json'))
21
+ ## check that maps were found ##
22
+ if len(existing_maps) > 0:
23
+ for map_path in existing_maps:
24
+ ## parse the name ##
25
+ table = map_path.stem
26
+ ## load the map ##
27
+ with open(map_path, 'r') as map_json:
28
+ maps[table] = json.load(map_json)
29
+ ## return ##
30
+ return maps
@@ -1,8 +1,12 @@
1
- import pandas as pd
2
- import numpy
1
+ ## built-in ##
3
2
  import pathlib
4
3
  import json
4
+ from typing import List, Dict
5
+ ## external ##
6
+ import pandas as pd
7
+ import numpy
5
8
 
9
+ ## local ##
6
10
  from .Engine import DCMTable
7
11
  import nfelodcm.nfelodcm.Utilities as utils
8
12
 
@@ -14,19 +18,39 @@ utils.set_season_state()
14
18
  utils.check_data()
15
19
 
16
20
  ## wrappers and classes to interact with the package ##
17
- def get_df(table):
21
+ def get_df(table: str) -> pd.DataFrame:
18
22
  """
19
- gets a single table
23
+ Load a single dataframe
24
+
25
+ Parameters:
26
+ * table: str - the name of the table to load
27
+
28
+ Returns:
29
+ * pd.DataFrame - the dataframe loaded from the table
20
30
  """
21
31
  engine = DCMTable(table)
22
32
  return engine.localIO.df
23
33
 
24
- def load(tables):
34
+ def load(tables: List[str]) -> Dict[str, pd.DataFrame]:
25
35
  """
26
36
  loads an array of tables and returns a dictionary
37
+
38
+ Parameters:
39
+ * tables: List[str] - a list of table names to load
40
+
41
+ Returns:
42
+ * Dict[str, pd.DataFrame] - a dictionary of table names and their corresponding dataframes
27
43
  """
28
44
  ## init db structure ##
29
45
  db = {}
46
+ ## check that all passed tables have maps ##
47
+ map_data = utils.load_maps()
48
+ maps = list(map_data.keys()) if len(map_data) > 0 else []
49
+ missing_maps = [t for t in tables if t not in maps]
50
+ if len(missing_maps) > 0:
51
+ raise Exception('MAP ERROR: The following tables do not have maps: {0}'.format(
52
+ '\n '.join(missing_maps)
53
+ ))
30
54
  ## add tables ##
31
55
  for table in tables:
32
56
  db[table] = get_df(table)
@@ -49,7 +73,7 @@ def get_map(url):
49
73
  col, dtype
50
74
  ))
51
75
 
52
- def get_season_state(state_type='last_full_week'):
76
+ def get_season_state(state_type='last_full_week') -> tuple:
53
77
  '''
54
78
  Returns the season and week of the specified state type:
55
79
  'last_full_week' (default): the last week in which no games are still unplayed
@@ -67,4 +91,21 @@ def get_season_state(state_type='last_full_week'):
67
91
  state_type, '\n '.join(list(global_variables['season_states'].keys()))
68
92
  ))
69
93
  ## if state valid, return ##
70
- return global_variables['season_states'][state_type]['season'], global_variables['season_states'][state_type]['week']
94
+ return global_variables['season_states'][state_type]['season'], global_variables['season_states'][state_type]['week']
95
+
96
+ def list_tables() -> None:
97
+ '''
98
+ Lists all tables available to the package
99
+
100
+ Parameters:
101
+ * None
102
+
103
+ Returns:
104
+ * None (prints list of tables)
105
+ '''
106
+ ## get maps ##
107
+ maps = utils.load_maps()
108
+ ## print ##
109
+ print('Available tables:')
110
+ for table, table_map in maps.items():
111
+ print(' {0} - {1}'.format(table, table_map['description']))
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: nfelodcm
3
- Version: 0.1.16
3
+ Version: 0.1.18
4
4
  Summary: Python package for loading and caching CSVs hosted on github into pandas dataframes
5
5
  Author-email: Robert Greer <nfl@robbygreer.com>
6
6
  Maintainer-email: Robert Greer <nfl@robbygreer.com>
@@ -27,6 +27,7 @@ pyproject.toml
27
27
  ./nfelodcm/Maps/hfa.json
28
28
  ./nfelodcm/Maps/logos.json
29
29
  ./nfelodcm/Maps/market_data.json
30
+ ./nfelodcm/Maps/nfelo_games.json
30
31
  ./nfelodcm/Maps/participants.json
31
32
  ./nfelodcm/Maps/pbp.json
32
33
  ./nfelodcm/Maps/player_stats.json
@@ -43,6 +44,7 @@ pyproject.toml
43
44
  ./nfelodcm/Utilities/checks.py
44
45
  ./nfelodcm/Utilities/extract_map.py
45
46
  ./nfelodcm/Utilities/global_variables.json
47
+ ./nfelodcm/Utilities/load_maps.py
46
48
  ./nfelodcm/Utilities/retrieve_season_state.py
47
49
  ./nfelodcm/Utilities/set_season_state.py
48
50
  nfelodcm/nfelodcm.py
@@ -75,6 +77,7 @@ nfelodcm/Maps/games.json
75
77
  nfelodcm/Maps/hfa.json
76
78
  nfelodcm/Maps/logos.json
77
79
  nfelodcm/Maps/market_data.json
80
+ nfelodcm/Maps/nfelo_games.json
78
81
  nfelodcm/Maps/participants.json
79
82
  nfelodcm/Maps/pbp.json
80
83
  nfelodcm/Maps/player_stats.json
@@ -91,5 +94,6 @@ nfelodcm/Utilities/__init__.py
91
94
  nfelodcm/Utilities/checks.py
92
95
  nfelodcm/Utilities/extract_map.py
93
96
  nfelodcm/Utilities/global_variables.json
97
+ nfelodcm/Utilities/load_maps.py
94
98
  nfelodcm/Utilities/retrieve_season_state.py
95
99
  nfelodcm/Utilities/set_season_state.py
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "nfelodcm"
7
- version = "0.1.16"
7
+ version = "0.1.18"
8
8
  readme = "README.md"
9
9
  requires-python = ">=3.11"
10
10
  license = {text = "MIT"}
File without changes
File without changes
File without changes