Skip to content

Commit fcdddac

Browse files
Added README, LICENSE, and Github workflow
1 parent d071d3f commit fcdddac

4 files changed

Lines changed: 158 additions & 1 deletion

File tree

.github/workflows/workflow.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI
2+
3+
on: push
4+
5+
jobs:
6+
build:
7+
name: Build distribution 📦
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v4
12+
with:
13+
persist-credentials: false
14+
- name: Set up Python
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: "3.12"
18+
- name: Install uv
19+
uses: astral-sh/setup-uv@v6
20+
- name: Install dependencies
21+
run: uv sync
22+
- name: Build distribution
23+
run: uv build
24+
- name: Store the distribution as an artifact
25+
uses: actions/upload-artifact@v4
26+
with:
27+
name: dist
28+
path: dist/
29+
30+
publish-to-testpypi:
31+
name: Publish Python 🐍 distribution 📦 to TestPyPI
32+
needs:
33+
- build
34+
runs-on: ubuntu-latest
35+
36+
environment:
37+
name: testpypi
38+
url: https://test.pypi.org/p/mlbrecaps
39+
40+
permissions:
41+
id-token: write # IMPORTANT: mandatory for trusted publishing
42+
43+
steps:
44+
- name: Download all the dists
45+
uses: actions/download-artifact@v4
46+
with:
47+
name: python-package-distributions
48+
path: dist/
49+
- name: Publish distribution 📦 to TestPyPI
50+
uses: pypa/gh-action-pypi-publish@release/v1
51+
with:
52+
repository-url: https://test.pypi.org/legacy/
53+
54+
publish-to-pypi:
55+
name: >-
56+
Publish Python 🐍 distribution 📦 to PyPI
57+
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
58+
needs:
59+
- build
60+
runs-on: ubuntu-latest
61+
environment:
62+
name: pypi
63+
url: https://pypi.org/p/mlbrecaps
64+
permissions:
65+
id-token: write # IMPORTANT: mandatory for trusted publishing
66+
67+
steps:
68+
- name: Download all the dists
69+
uses: actions/download-artifact@v4
70+
with:
71+
name: python-package-distributions
72+
path: dist/
73+
- name: Publish distribution 📦 to PyPI
74+
uses: pypa/gh-action-pypi-publish@release/v1

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Karsten Larson
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.

README.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# mlbrecaps
2+
3+
mlbrecaps is a Python library for querying and retrieving highlight videos and play information from Major League Baseball (MLB) games. It provides a simple interface to access game recaps, top plays, and player highlights programmatically.
4+
5+
## Features
6+
7+
- Query highlight videos for specific MLB games
8+
- Retrieve top plays for a given day, month, or year
9+
- Get player-specific highlight clips
10+
- Easily integrate with your own Python scripts
11+
12+
## Installation
13+
14+
You can install mlbrecaps directly from PyPI using pip:
15+
16+
```bash
17+
pip install mlbrecaps
18+
```
19+
20+
### Install from Source
21+
22+
1. **Clone the repository:**
23+
24+
```bash
25+
git clone https://github.com/yourusername/mlbrecaps.git
26+
cd mlbrecaps
27+
```
28+
29+
2. **Install dependencies with uv:**
30+
31+
```bash
32+
uv pip install -e .
33+
```
34+
35+
This will install the package in editable mode along with all required dependencies.
36+
37+
## Example Scripts
38+
39+
The `examples/` directory contains ready-to-run scripts:
40+
41+
- `examples/top_player_plays.py` — Get top plays for a player
42+
- `examples/top_plays_of_month.py` — Get top plays for a month
43+
- `examples/top_plays_of_year.py` — Get top plays for a year
44+
45+
Run an example with:
46+
47+
```bash
48+
python examples/top_player_plays.py
49+
```
50+
51+
## Contributing
52+
53+
Contributions are welcome! To contribute:
54+
55+
1. Fork the repository and create your branch.
56+
2. Make your changes and add tests if applicable.
57+
3. Ensure code style and formatting are consistent.
58+
4. Submit a pull request with a clear description of your changes.
59+
60+
## License
61+
62+
This project is open source and available under the MIT License.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "mlb-recaps"
3-
version = "1.0.0"
3+
version = "0.1.0"
44
description = "Package that gathers information on given MLB games and allows downloading of video clips of plays."
55
readme = "README.md"
66
requires-python = ">=3.12"

0 commit comments

Comments
 (0)