backcaster 0.3.0__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.
- backcaster-0.3.0/LICENSE +21 -0
- backcaster-0.3.0/PKG-INFO +237 -0
- backcaster-0.3.0/README.md +207 -0
- backcaster-0.3.0/pyproject.toml +89 -0
- backcaster-0.3.0/setup.cfg +4 -0
- backcaster-0.3.0/src/backcaster/__init__.py +4 -0
- backcaster-0.3.0/src/backcaster/cli.py +161 -0
- backcaster-0.3.0/src/backcaster/data.py +246 -0
- backcaster-0.3.0/src/backcaster/marcel.py +202 -0
- backcaster-0.3.0/src/backcaster/normalize.py +13 -0
- backcaster-0.3.0/src/backcaster/outputs.py +24 -0
- backcaster-0.3.0/src/backcaster/schemas.py +34 -0
- backcaster-0.3.0/src/backcaster.egg-info/PKG-INFO +237 -0
- backcaster-0.3.0/src/backcaster.egg-info/SOURCES.txt +23 -0
- backcaster-0.3.0/src/backcaster.egg-info/dependency_links.txt +1 -0
- backcaster-0.3.0/src/backcaster.egg-info/entry_points.txt +2 -0
- backcaster-0.3.0/src/backcaster.egg-info/requires.txt +10 -0
- backcaster-0.3.0/src/backcaster.egg-info/top_level.txt +1 -0
- backcaster-0.3.0/tests/test_cli.py +259 -0
- backcaster-0.3.0/tests/test_cli_player_lookup.py +60 -0
- backcaster-0.3.0/tests/test_data.py +412 -0
- backcaster-0.3.0/tests/test_marcel_math.py +360 -0
- backcaster-0.3.0/tests/test_normalize.py +37 -0
- backcaster-0.3.0/tests/test_outputs.py +29 -0
- backcaster-0.3.0/tests/test_player_lookup.py +89 -0
backcaster-0.3.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 backcaster contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: backcaster
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Marcel-style MLB projection CLI built on pybaseball
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
Project-URL: Homepage, https://github.com/jeffreywevans/backcaster
|
|
7
|
+
Project-URL: Repository, https://github.com/jeffreywevans/backcaster
|
|
8
|
+
Project-URL: Issues, https://github.com/jeffreywevans/backcaster/issues
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
|
+
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
17
|
+
Requires-Python: >=3.13
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
License-File: LICENSE
|
|
20
|
+
Requires-Dist: pandas>=2.0
|
|
21
|
+
Requires-Dist: pybaseball>=2.2
|
|
22
|
+
Provides-Extra: dev
|
|
23
|
+
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
24
|
+
Requires-Dist: pytest-cov>=5.0; extra == "dev"
|
|
25
|
+
Requires-Dist: ruff>=0.11.0; extra == "dev"
|
|
26
|
+
Requires-Dist: mypy>=1.10; extra == "dev"
|
|
27
|
+
Requires-Dist: pandas-stubs>=2.2; extra == "dev"
|
|
28
|
+
Requires-Dist: build>=1.2; extra == "dev"
|
|
29
|
+
Dynamic: license-file
|
|
30
|
+
|
|
31
|
+
# Backcaster
|
|
32
|
+
|
|
33
|
+
Backcaster is a Python CLI that produces **Marcel-style MLB projections** from the prior three seasons of data using [`pybaseball`](https://github.com/jldbc/pybaseball) and `pandas`.
|
|
34
|
+
|
|
35
|
+
It supports:
|
|
36
|
+
- **Single player projections** (`player`)
|
|
37
|
+
- **Single team projections** (`team`)
|
|
38
|
+
- **League-wide batch projections** (`batch`)
|
|
39
|
+
- Output as terminal table, CSV, or HTML
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Installation
|
|
44
|
+
|
|
45
|
+
### Requirements
|
|
46
|
+
- Python **3.13+**
|
|
47
|
+
- Internet access for first-time stat fetches (data is cached locally afterward)
|
|
48
|
+
|
|
49
|
+
### Install from source (recommended for contributors)
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
# from repo root
|
|
53
|
+
uv sync
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
This installs runtime dependencies and the `backcaster` CLI entrypoint defined in `pyproject.toml`.
|
|
57
|
+
|
|
58
|
+
### Install in editable/dev mode
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
uv sync --extra dev
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
This adds test/lint/type-check/build tooling (`pytest`, `pytest-cov`, `ruff`, `mypy`, `pandas-stubs`, `build`).
|
|
65
|
+
|
|
66
|
+
### Build/install as a package
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
python -m build
|
|
70
|
+
pip install dist/backcaster-*.whl
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Quickstart CLI usage
|
|
76
|
+
|
|
77
|
+
All commands require:
|
|
78
|
+
- `--year` target projection year
|
|
79
|
+
- `--kind` one of `batting` or `pitching`
|
|
80
|
+
|
|
81
|
+
Subcommand-specific required options:
|
|
82
|
+
- `player` requires `--name`
|
|
83
|
+
- `team` requires `--team`
|
|
84
|
+
- `batch` requires no additional required option
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
backcaster <player|team|batch> [subcommand-options] --year <YEAR> --kind <batting|pitching> [--format cli|csv|html] [--out PATH]
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### 1) Player projection
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
backcaster player --name "Mookie Betts" --year 2026 --kind batting
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### 2) Team projection
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
backcaster team --team LAD --year 2026 --kind pitching
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### 3) Batch projection (all players returned by source data)
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
backcaster batch --year 2026 --kind batting
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### File outputs
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
backcaster player --name "Mookie Betts" --year 2026 --kind batting --format csv --out ./out/mookie_2026.csv
|
|
112
|
+
backcaster team --team LAD --year 2026 --kind pitching --format html --out ./out/lad_pitching_2026.html
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
> `--out` is required for `csv` and `html` formats.
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Output examples
|
|
120
|
+
|
|
121
|
+
### CLI table output (`--format cli`, default)
|
|
122
|
+
|
|
123
|
+
Example shape (columns vary by batting vs pitching):
|
|
124
|
+
|
|
125
|
+
```text
|
|
126
|
+
PA AB H 2B 3B HR BB SO HBP SF AVG OBP SLG OPS Reliability Name Year
|
|
127
|
+
610.2 545.1 162.4 34.1 2.8 32.6 67.9 119.3 5.6 4.7 0.298 0.384 0.531 0.915 0.89 Mookie Betts 2026
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### CSV output (`--format csv`)
|
|
131
|
+
A single-row CSV for `player`; multi-row CSV for `team` and `batch`.
|
|
132
|
+
|
|
133
|
+
### HTML output (`--format html`)
|
|
134
|
+
A basic HTML table (no custom CSS) suitable for quick sharing or embedding.
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## Cache behavior
|
|
139
|
+
|
|
140
|
+
Backcaster caches season stat pulls under:
|
|
141
|
+
|
|
142
|
+
```text
|
|
143
|
+
~/.cache/backcaster/
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Cache details:
|
|
147
|
+
- Key pattern: `<kind>_<year>.parquet` (preferred) or `<kind>_<year>.csv` (fallback)
|
|
148
|
+
- Read order: Parquet first, then CSV
|
|
149
|
+
- Write behavior: atomic temp-file write + rename to reduce corruption risk
|
|
150
|
+
- Parquet write failures automatically fall back to CSV
|
|
151
|
+
|
|
152
|
+
Practical implications:
|
|
153
|
+
- First run for a season may be slower (network fetch).
|
|
154
|
+
- Re-runs are typically faster (local cache hit).
|
|
155
|
+
- If upstream data changes and you need a refresh, delete the relevant cache file(s) and rerun.
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## Dependency notes
|
|
160
|
+
|
|
161
|
+
Runtime dependencies are intentionally minimal:
|
|
162
|
+
- `pandas` for tabular data processing and projection output
|
|
163
|
+
- `pybaseball` for MLB player/team seasonal stat retrieval and player ID lookup
|
|
164
|
+
|
|
165
|
+
Development dependencies (`--extra dev`) include:
|
|
166
|
+
- `pytest`, `pytest-cov`
|
|
167
|
+
- `ruff`
|
|
168
|
+
- `mypy`, `pandas-stubs`
|
|
169
|
+
|
|
170
|
+
### Lockfile policy (`uv.lock`)
|
|
171
|
+
|
|
172
|
+
`uv.lock` pins transitive versions for reproducible environments when working from a Git checkout.
|
|
173
|
+
|
|
174
|
+
Release/source ZIP archives may not include `uv.lock`. If it is missing in your environment, regenerate it locally:
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
uv lock
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Do not hand-edit `uv.lock`; regenerate it when dependencies change.
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## What this projection does and does not claim
|
|
185
|
+
|
|
186
|
+
### What it does
|
|
187
|
+
- Implements a **Marcel-style** weighted/regressed projection over prior seasons.
|
|
188
|
+
- Uses configurable reliability/regression/playing-time assumptions in code defaults.
|
|
189
|
+
- Produces transparent, table-based outputs for downstream analysis.
|
|
190
|
+
|
|
191
|
+
### What it does **not** claim
|
|
192
|
+
- It is **not** an official MLB/club forecasting system.
|
|
193
|
+
- It does **not** model injuries, role changes, park effects, coaching strategy, or transaction context in a comprehensive way.
|
|
194
|
+
- It does **not** guarantee predictive superiority versus commercial/public projection systems.
|
|
195
|
+
- It should be treated as a **baseline projection tool**, not a betting or financial decision engine.
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## Development and quality checks
|
|
200
|
+
|
|
201
|
+
For release preparation and PyPI Trusted Publishing, see [RELEASING.md](RELEASING.md).
|
|
202
|
+
Changes for the next release are recorded in [CHANGELOG.md](CHANGELOG.md).
|
|
203
|
+
|
|
204
|
+
### Run tests
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
pytest
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### Coverage + JUnit reports
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
pytest --junitxml=pytest.xml --cov=src --cov-report=xml:coverage.xml
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### Lint and types
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
ruff check .
|
|
220
|
+
mypy
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### SonarScanner
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
sonar-scanner -Dsonar.projectVersion=$(PYTHONPATH=src python -c "from backcaster import __version__; print(__version__)")
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
Sonar consumes:
|
|
230
|
+
- `coverage.xml`
|
|
231
|
+
- `pytest.xml`
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## Security and responsible use
|
|
236
|
+
|
|
237
|
+
Please review `SECURITY.md` for reporting guidance. Backcaster is an analytical utility and should be validated independently before use in production pipelines.
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# Backcaster
|
|
2
|
+
|
|
3
|
+
Backcaster is a Python CLI that produces **Marcel-style MLB projections** from the prior three seasons of data using [`pybaseball`](https://github.com/jldbc/pybaseball) and `pandas`.
|
|
4
|
+
|
|
5
|
+
It supports:
|
|
6
|
+
- **Single player projections** (`player`)
|
|
7
|
+
- **Single team projections** (`team`)
|
|
8
|
+
- **League-wide batch projections** (`batch`)
|
|
9
|
+
- Output as terminal table, CSV, or HTML
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
### Requirements
|
|
16
|
+
- Python **3.13+**
|
|
17
|
+
- Internet access for first-time stat fetches (data is cached locally afterward)
|
|
18
|
+
|
|
19
|
+
### Install from source (recommended for contributors)
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# from repo root
|
|
23
|
+
uv sync
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
This installs runtime dependencies and the `backcaster` CLI entrypoint defined in `pyproject.toml`.
|
|
27
|
+
|
|
28
|
+
### Install in editable/dev mode
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
uv sync --extra dev
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
This adds test/lint/type-check/build tooling (`pytest`, `pytest-cov`, `ruff`, `mypy`, `pandas-stubs`, `build`).
|
|
35
|
+
|
|
36
|
+
### Build/install as a package
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
python -m build
|
|
40
|
+
pip install dist/backcaster-*.whl
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Quickstart CLI usage
|
|
46
|
+
|
|
47
|
+
All commands require:
|
|
48
|
+
- `--year` target projection year
|
|
49
|
+
- `--kind` one of `batting` or `pitching`
|
|
50
|
+
|
|
51
|
+
Subcommand-specific required options:
|
|
52
|
+
- `player` requires `--name`
|
|
53
|
+
- `team` requires `--team`
|
|
54
|
+
- `batch` requires no additional required option
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
backcaster <player|team|batch> [subcommand-options] --year <YEAR> --kind <batting|pitching> [--format cli|csv|html] [--out PATH]
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### 1) Player projection
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
backcaster player --name "Mookie Betts" --year 2026 --kind batting
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### 2) Team projection
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
backcaster team --team LAD --year 2026 --kind pitching
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### 3) Batch projection (all players returned by source data)
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
backcaster batch --year 2026 --kind batting
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### File outputs
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
backcaster player --name "Mookie Betts" --year 2026 --kind batting --format csv --out ./out/mookie_2026.csv
|
|
82
|
+
backcaster team --team LAD --year 2026 --kind pitching --format html --out ./out/lad_pitching_2026.html
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
> `--out` is required for `csv` and `html` formats.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Output examples
|
|
90
|
+
|
|
91
|
+
### CLI table output (`--format cli`, default)
|
|
92
|
+
|
|
93
|
+
Example shape (columns vary by batting vs pitching):
|
|
94
|
+
|
|
95
|
+
```text
|
|
96
|
+
PA AB H 2B 3B HR BB SO HBP SF AVG OBP SLG OPS Reliability Name Year
|
|
97
|
+
610.2 545.1 162.4 34.1 2.8 32.6 67.9 119.3 5.6 4.7 0.298 0.384 0.531 0.915 0.89 Mookie Betts 2026
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### CSV output (`--format csv`)
|
|
101
|
+
A single-row CSV for `player`; multi-row CSV for `team` and `batch`.
|
|
102
|
+
|
|
103
|
+
### HTML output (`--format html`)
|
|
104
|
+
A basic HTML table (no custom CSS) suitable for quick sharing or embedding.
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Cache behavior
|
|
109
|
+
|
|
110
|
+
Backcaster caches season stat pulls under:
|
|
111
|
+
|
|
112
|
+
```text
|
|
113
|
+
~/.cache/backcaster/
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Cache details:
|
|
117
|
+
- Key pattern: `<kind>_<year>.parquet` (preferred) or `<kind>_<year>.csv` (fallback)
|
|
118
|
+
- Read order: Parquet first, then CSV
|
|
119
|
+
- Write behavior: atomic temp-file write + rename to reduce corruption risk
|
|
120
|
+
- Parquet write failures automatically fall back to CSV
|
|
121
|
+
|
|
122
|
+
Practical implications:
|
|
123
|
+
- First run for a season may be slower (network fetch).
|
|
124
|
+
- Re-runs are typically faster (local cache hit).
|
|
125
|
+
- If upstream data changes and you need a refresh, delete the relevant cache file(s) and rerun.
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## Dependency notes
|
|
130
|
+
|
|
131
|
+
Runtime dependencies are intentionally minimal:
|
|
132
|
+
- `pandas` for tabular data processing and projection output
|
|
133
|
+
- `pybaseball` for MLB player/team seasonal stat retrieval and player ID lookup
|
|
134
|
+
|
|
135
|
+
Development dependencies (`--extra dev`) include:
|
|
136
|
+
- `pytest`, `pytest-cov`
|
|
137
|
+
- `ruff`
|
|
138
|
+
- `mypy`, `pandas-stubs`
|
|
139
|
+
|
|
140
|
+
### Lockfile policy (`uv.lock`)
|
|
141
|
+
|
|
142
|
+
`uv.lock` pins transitive versions for reproducible environments when working from a Git checkout.
|
|
143
|
+
|
|
144
|
+
Release/source ZIP archives may not include `uv.lock`. If it is missing in your environment, regenerate it locally:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
uv lock
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Do not hand-edit `uv.lock`; regenerate it when dependencies change.
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## What this projection does and does not claim
|
|
155
|
+
|
|
156
|
+
### What it does
|
|
157
|
+
- Implements a **Marcel-style** weighted/regressed projection over prior seasons.
|
|
158
|
+
- Uses configurable reliability/regression/playing-time assumptions in code defaults.
|
|
159
|
+
- Produces transparent, table-based outputs for downstream analysis.
|
|
160
|
+
|
|
161
|
+
### What it does **not** claim
|
|
162
|
+
- It is **not** an official MLB/club forecasting system.
|
|
163
|
+
- It does **not** model injuries, role changes, park effects, coaching strategy, or transaction context in a comprehensive way.
|
|
164
|
+
- It does **not** guarantee predictive superiority versus commercial/public projection systems.
|
|
165
|
+
- It should be treated as a **baseline projection tool**, not a betting or financial decision engine.
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## Development and quality checks
|
|
170
|
+
|
|
171
|
+
For release preparation and PyPI Trusted Publishing, see [RELEASING.md](RELEASING.md).
|
|
172
|
+
Changes for the next release are recorded in [CHANGELOG.md](CHANGELOG.md).
|
|
173
|
+
|
|
174
|
+
### Run tests
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
pytest
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### Coverage + JUnit reports
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
pytest --junitxml=pytest.xml --cov=src --cov-report=xml:coverage.xml
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### Lint and types
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
ruff check .
|
|
190
|
+
mypy
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### SonarScanner
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
sonar-scanner -Dsonar.projectVersion=$(PYTHONPATH=src python -c "from backcaster import __version__; print(__version__)")
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Sonar consumes:
|
|
200
|
+
- `coverage.xml`
|
|
201
|
+
- `pytest.xml`
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## Security and responsible use
|
|
206
|
+
|
|
207
|
+
Please review `SECURITY.md` for reporting guidance. Backcaster is an analytical utility and should be validated independently before use in production pipelines.
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "backcaster"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
description = "Marcel-style MLB projection CLI built on pybaseball"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
license-files = ["LICENSE"]
|
|
12
|
+
classifiers = [
|
|
13
|
+
"Programming Language :: Python :: 3",
|
|
14
|
+
"Programming Language :: Python :: 3.13",
|
|
15
|
+
"Programming Language :: Python :: 3.14",
|
|
16
|
+
"Operating System :: OS Independent",
|
|
17
|
+
"Environment :: Console",
|
|
18
|
+
"Development Status :: 4 - Beta",
|
|
19
|
+
"Intended Audience :: Science/Research",
|
|
20
|
+
"Topic :: Scientific/Engineering :: Information Analysis",
|
|
21
|
+
]
|
|
22
|
+
requires-python = ">=3.13"
|
|
23
|
+
dependencies = [
|
|
24
|
+
"pandas>=2.0",
|
|
25
|
+
"pybaseball>=2.2",
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
[project.urls]
|
|
29
|
+
Homepage = "https://github.com/jeffreywevans/backcaster"
|
|
30
|
+
Repository = "https://github.com/jeffreywevans/backcaster"
|
|
31
|
+
Issues = "https://github.com/jeffreywevans/backcaster/issues"
|
|
32
|
+
|
|
33
|
+
[project.optional-dependencies]
|
|
34
|
+
dev = [
|
|
35
|
+
"pytest>=8.0",
|
|
36
|
+
"pytest-cov>=5.0",
|
|
37
|
+
"ruff>=0.11.0",
|
|
38
|
+
"mypy>=1.10",
|
|
39
|
+
"pandas-stubs>=2.2",
|
|
40
|
+
"build>=1.2",
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
[project.scripts]
|
|
44
|
+
backcaster = "backcaster.cli:main"
|
|
45
|
+
|
|
46
|
+
[tool.setuptools]
|
|
47
|
+
package-dir = {"" = "src"}
|
|
48
|
+
|
|
49
|
+
[tool.setuptools.packages.find]
|
|
50
|
+
where = ["src"]
|
|
51
|
+
|
|
52
|
+
[tool.setuptools.dynamic]
|
|
53
|
+
version = {attr = "backcaster.__version__"}
|
|
54
|
+
|
|
55
|
+
[tool.pytest.ini_options]
|
|
56
|
+
pythonpath = ["src"]
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
[tool.ruff]
|
|
60
|
+
line-length = 100
|
|
61
|
+
src = ["src", "tests"]
|
|
62
|
+
|
|
63
|
+
[tool.ruff.lint]
|
|
64
|
+
select = ["E", "F", "I", "UP"]
|
|
65
|
+
ignore = ["E501"]
|
|
66
|
+
|
|
67
|
+
[tool.ruff.lint.per-file-ignores]
|
|
68
|
+
"tests/*" = ["F401"]
|
|
69
|
+
|
|
70
|
+
[tool.ruff.format]
|
|
71
|
+
quote-style = "double"
|
|
72
|
+
indent-style = "space"
|
|
73
|
+
|
|
74
|
+
[tool.mypy]
|
|
75
|
+
python_version = "3.13"
|
|
76
|
+
files = ["src"]
|
|
77
|
+
warn_unused_ignores = true
|
|
78
|
+
warn_redundant_casts = true
|
|
79
|
+
warn_unreachable = true
|
|
80
|
+
pretty = true
|
|
81
|
+
show_error_codes = true
|
|
82
|
+
disallow_untyped_defs = true
|
|
83
|
+
disallow_incomplete_defs = true
|
|
84
|
+
no_implicit_optional = true
|
|
85
|
+
check_untyped_defs = true
|
|
86
|
+
|
|
87
|
+
[[tool.mypy.overrides]]
|
|
88
|
+
module = ["pandas", "pandas.*", "pybaseball", "pybaseball.*"]
|
|
89
|
+
ignore_missing_imports = true
|