Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Cargo1284/FantasyBaseballTrends
This library allows a user to see a players trends of a user specified period of time. Primarily, it allows a fantasy user to see their lineups trends over a certain period and trends between a hitter against a certain pitcher.
https://github.com/Cargo1284/FantasyBaseballTrends
fantasy-baseball mlb python
Last synced: 2 months ago
JSON representation
This library allows a user to see a players trends of a user specified period of time. Primarily, it allows a fantasy user to see their lineups trends over a certain period and trends between a hitter against a certain pitcher.
- Host: GitHub
- URL: https://github.com/Cargo1284/FantasyBaseballTrends
- Owner: Cargo1284
- License: apache-2.0
- Created: 2023-02-11T01:21:43.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-11T09:44:05.000Z (over 1 year ago)
- Last Synced: 2024-04-14T03:11:22.514Z (10 months ago)
- Topics: fantasy-baseball, mlb, python
- Language: Python
- Homepage:
- Size: 2.97 MB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
- jimsghstars - Cargo1284/FantasyBaseballTrends - This library allows a user to see a players trends of a user specified period of time. Primarily, it allows a fantasy user to see their lineups trends over a certain period and trends between a hitter (Python)
README
# FantasyBaseballTrends
[![Build Status](https://github.com/Cargo1284/FantasyBaseballTrends/workflows/Build%20Status/badge.svg?branch=main)](https://github.com/Cargo1284/FantasyBaseballTrends/actions?query=workflow%3A%22Build+Status%22)
![PyPI](https://img.shields.io/pypi/v/FantasyBaseballTrends?style=plastic)
[![codecov](https://codecov.io/gh/Cargo1284/FantasyBaseballTrends/branch/main/graph/badge.svg)](https://app.codecov.io/gh/Cargo1284/FantasyBaseballTrends)
![Crates.io](https://img.shields.io/crates/l/ap)
![GitHub issues](https://img.shields.io/github/issues/cargo1284/FantasyBaseballTrends)
[![Github Pages Docs](https://img.shields.io/badge/docs-gh--pages-blue)](https://cargo1284.github.io/FantasyBaseballTrends/index.html)## Overview
This library scrapes specific hitter stats from BaseballReference.
The purpose of this library is to provide fantasy owners a chance to see how the players in their lineup have been performing over a number of games and how they perform against a certain pitcher. This will help facilitate their daily lineup constuction and to see which players on the wire are having a hot streak as well as players that have been trending downwards.## Instalation
To install, run the following:
```
pip install FantasyBaseballTrends
```## Usage
### Projected Stats
This function will return a specific hitters projected offensive stats for the 2023 season.
```
get2023Projected(browser, player)
```
### Last Game Stats
This function will return all of offensive stats of a players most recent game.
```
getLastGame(browser, player)
```
### Current stats vs RHP
This function will return a players current season hitting stats against right handed pitchers.
```
getVsRhpCurrent(browser, player)
```
### Current stats vs LHP
This function will return a players current season hitting stats against left handed pitchers.
```
getVsLhpCurrent(browser, player)
```
### Career Splits
This function will return a hitter's carrer splits. The returning data frame is split up by the opposing pitchers handedness and if they are a starter or not.
```
getCareerSplits(browser, player)
```
### Stats over number of games
This funciton will return a hitter's stats over a user specified number of games.
```
getLastxGames(browser, player, gamesNum)
```## Example
A sample function can look like the code below. NOTE: when using this library you must first set up the browser by using the setUpWebsite() function. The function below returns Yadier Molina's career stats.
```python
import FantasyBaseballTrends as fbtbrowser = fbt.setUpWebsite()
print(getCareer(browser, "Yadier Molina"))
```