---
name: baseball-trajectory
description: >
  Baseball trajectory modeling and visualization. Use when writing Python code that uses the baseball_trajectory package.
compatibility: Requires Python >=3.10.
---

# baseball_trajectory

Baseball trajectory modeling and visualization

## Installation

```bash
pip install baseball-trajectory
```

## API overview

### Data

Player search and per-player career queries against the MLB Stats API.

- `data.refresh_cache`
- `data.get_player_career_totals`
- `data.search_player`
- `data.get_batting_career`
- `data.get_pitching_career`

### Model

Weighted quadratic aging-curve fit and career summaries.

- `model.is_lower_better`
- `model.fit_player_curve`
- `model.fit_aging_curve`
- `model.predict_curve`
- `model.summarize_career`
- `model.BATTING_METRICS`
- `model.PITCHING_METRICS`

### Similarity

Bill James similarity scores.

- `similarity.position_value`
- `similarity.similarity_score`
- `similarity.find_similar_players`
- `similarity.POSITION_VALUE`

### Plots

Matplotlib trajectory charts.

- `plots.predict_curve`
- `plots.plot_trajectory`
- `plots.plot_empty`
- `plots.plot_trajectories_facet`
- `plots.plot_peak_vs_curvature`

## Resources

- [Full documentation](https://mjfrigaard.github.io/baseball-trajectory/)
- [llms.txt](llms.txt) — Indexed API reference for LLMs
- [llms-full.txt](llms-full.txt) — Comprehensive documentation for LLMs
