brlib 0.0.1__tar.gz → 0.0.2__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.
- brlib-0.0.2/.github/workflows/publish.yml +50 -0
- brlib-0.0.2/.github/workflows/test.yml +32 -0
- {brlib-0.0.1 → brlib-0.0.2}/PKG-INFO +1 -1
- {brlib-0.0.1 → brlib-0.0.2}/pyproject.toml +0 -3
- {brlib-0.0.1 → brlib-0.0.2/src}/brlib/__init__.py +1 -1
- brlib-0.0.2/tests/abbreviations_manager/_helpers/test_abbreviations_manager.py +37 -0
- {brlib-0.0.1 → brlib-0.0.2}/.gitignore +0 -0
- {brlib-0.0.1 → brlib-0.0.2}/LICENSE.txt +0 -0
- {brlib-0.0.1 → brlib-0.0.2}/README.md +0 -0
- {brlib-0.0.1 → brlib-0.0.2/src}/brlib/_helpers/__init__.py +0 -0
- {brlib-0.0.1 → brlib-0.0.2/src}/brlib/_helpers/abbreviations_manager.py +0 -0
- {brlib-0.0.1 → brlib-0.0.2/src}/brlib/_helpers/constants.py +0 -0
- {brlib-0.0.1 → brlib-0.0.2/src}/brlib/_helpers/inputs.py +0 -0
- {brlib-0.0.1 → brlib-0.0.2/src}/brlib/_helpers/no_hitter_dicts.py +0 -0
- {brlib-0.0.1 → brlib-0.0.2/src}/brlib/_helpers/requests_manager.py +0 -0
- {brlib-0.0.1 → brlib-0.0.2/src}/brlib/_helpers/singleton.py +0 -0
- {brlib-0.0.1 → brlib-0.0.2/src}/brlib/_helpers/utils.py +0 -0
- {brlib-0.0.1 → brlib-0.0.2/src}/brlib/all_major_leaguers.py +0 -0
- {brlib-0.0.1 → brlib-0.0.2/src}/brlib/find_asg.py +0 -0
- {brlib-0.0.1 → brlib-0.0.2/src}/brlib/find_games.py +0 -0
- {brlib-0.0.1 → brlib-0.0.2/src}/brlib/find_teams.py +0 -0
- {brlib-0.0.1 → brlib-0.0.2/src}/brlib/game.py +0 -0
- {brlib-0.0.1 → brlib-0.0.2/src}/brlib/games.py +0 -0
- {brlib-0.0.1 → brlib-0.0.2/src}/brlib/get_games.py +0 -0
- {brlib-0.0.1 → brlib-0.0.2/src}/brlib/get_players.py +0 -0
- {brlib-0.0.1 → brlib-0.0.2/src}/brlib/get_teams.py +0 -0
- {brlib-0.0.1 → brlib-0.0.2/src}/brlib/options.py +0 -0
- {brlib-0.0.1 → brlib-0.0.2/src}/brlib/player.py +0 -0
- {brlib-0.0.1 → brlib-0.0.2/src}/brlib/players.py +0 -0
- {brlib-0.0.1 → brlib-0.0.2/src}/brlib/team.py +0 -0
- {brlib-0.0.1 → brlib-0.0.2/src}/brlib/teams.py +0 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
name: Publish Release to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
build:
|
|
9
|
+
name: Build distribution
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
|
|
12
|
+
steps:
|
|
13
|
+
- name: Checkout code
|
|
14
|
+
uses: actions/checkout@v6
|
|
15
|
+
|
|
16
|
+
- name: Set up Python
|
|
17
|
+
uses: actions/setup-python@v6
|
|
18
|
+
with:
|
|
19
|
+
python-version: "3.x"
|
|
20
|
+
|
|
21
|
+
- name: Install pypa/build
|
|
22
|
+
run: python3 -m pip install build --user
|
|
23
|
+
|
|
24
|
+
- name: Build a binary wheel and a source tarball
|
|
25
|
+
run: python3 -m build
|
|
26
|
+
|
|
27
|
+
- name: Store the distribution packages
|
|
28
|
+
uses: actions/upload-artifact@v5
|
|
29
|
+
with:
|
|
30
|
+
name: python-package-distributions
|
|
31
|
+
path: dist/
|
|
32
|
+
|
|
33
|
+
publish-to-pypi:
|
|
34
|
+
name: Publish distribution to PyPI
|
|
35
|
+
needs: build
|
|
36
|
+
runs-on: ubuntu-latest
|
|
37
|
+
environment:
|
|
38
|
+
name: pypi
|
|
39
|
+
url: https://pypi.org/p/brlib
|
|
40
|
+
permissions:
|
|
41
|
+
id-token: write
|
|
42
|
+
|
|
43
|
+
steps:
|
|
44
|
+
- name: Download the dists
|
|
45
|
+
uses: actions/download-artifact@v6
|
|
46
|
+
with:
|
|
47
|
+
name: python-package-distributions
|
|
48
|
+
path: dist/
|
|
49
|
+
- name: Publish distribution
|
|
50
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
name: Run Tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: '**'
|
|
6
|
+
schedule:
|
|
7
|
+
# run daily tests after the previous day's scores have hopefully been added
|
|
8
|
+
- cron: '0 12 * * *'
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
pytest:
|
|
12
|
+
runs-on: ${{ matrix.os }}
|
|
13
|
+
|
|
14
|
+
strategy:
|
|
15
|
+
matrix:
|
|
16
|
+
os: [ubuntu-latest, windows-latest]
|
|
17
|
+
python-version: [3.12, 3.13, 3.14]
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- name: Checkout code
|
|
21
|
+
uses: actions/checkout@v5
|
|
22
|
+
|
|
23
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
24
|
+
uses: actions/setup-python@v6
|
|
25
|
+
with:
|
|
26
|
+
python-version: ${{ matrix.python-version }}
|
|
27
|
+
|
|
28
|
+
- name: Install brlib
|
|
29
|
+
run: pip install -e .[dev]
|
|
30
|
+
|
|
31
|
+
- name: Run pytest
|
|
32
|
+
run: pytest
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: brlib
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.2
|
|
4
4
|
Summary: A library for collecting baseball statistics from Baseball Reference
|
|
5
5
|
Project-URL: Homepage, https://github.com/john-bieren/brlib
|
|
6
6
|
Project-URL: Documentation, https://github.com/john-bieren/brlib/tree/master/docs
|
|
@@ -41,9 +41,6 @@ Documentation = "https://github.com/john-bieren/brlib/tree/master/docs"
|
|
|
41
41
|
Repository = "https://github.com/john-bieren/brlib.git"
|
|
42
42
|
Issues = "https://github.com/john-bieren/brlib/issues"
|
|
43
43
|
|
|
44
|
-
[tool.hatch.build]
|
|
45
|
-
packages = ["src/brlib"]
|
|
46
|
-
|
|
47
44
|
[tool.hatch.version]
|
|
48
45
|
path = "src/brlib/__init__.py"
|
|
49
46
|
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Tests methods of the abbreviations_manager singleton."""
|
|
4
|
+
|
|
5
|
+
from brlib._helpers.abbreviations_manager import abv_man
|
|
6
|
+
|
|
7
|
+
def test_correct_abvs():
|
|
8
|
+
assert abv_man.correct_abvs("OAK", 2025, era_adjustment=True) == ["ATH"]
|
|
9
|
+
assert abv_man.correct_abvs("OAK", 2025, era_adjustment=False) == []
|
|
10
|
+
assert abv_man.correct_abvs("BAL", 1915, era_adjustment=True) == ["SLB", "BAL"]
|
|
11
|
+
assert abv_man.correct_abvs("BAL", 1915, era_adjustment=False) == ["BAL"]
|
|
12
|
+
assert abv_man.correct_abvs("LAA", 1977, era_adjustment=False) == ["CAL"]
|
|
13
|
+
assert abv_man.correct_abvs("LAA", 1907, era_adjustment=False) == []
|
|
14
|
+
assert abv_man.correct_abvs("SER", 2025, era_adjustment=False) == []
|
|
15
|
+
|
|
16
|
+
def test_franchise_abv():
|
|
17
|
+
assert abv_man.franchise_abv("ATH", 1876) == "ATH"
|
|
18
|
+
assert abv_man.franchise_abv("BAL", 1915) == "BLT"
|
|
19
|
+
assert abv_man.franchise_abv("OAK", 2025) == ""
|
|
20
|
+
assert abv_man.franchise_abv("SER", 2025) == ""
|
|
21
|
+
|
|
22
|
+
def test_all_team_abvs():
|
|
23
|
+
assert abv_man.all_team_abvs("ATH", 2025) == ["ATH", "KCA", "OAK", "PHA"]
|
|
24
|
+
assert abv_man.all_team_abvs("OAK", 2025) == []
|
|
25
|
+
assert abv_man.all_team_abvs("SER", 2025) == []
|
|
26
|
+
|
|
27
|
+
def test_to_alias():
|
|
28
|
+
assert abv_man.to_alias("SEA", 2025) == "SEA"
|
|
29
|
+
assert abv_man.to_alias("KCA", 1963) == "KC1"
|
|
30
|
+
assert abv_man.to_alias("PBS", 2025) == "PBS"
|
|
31
|
+
assert abv_man.to_alias("SER", 2025) == "SER"
|
|
32
|
+
|
|
33
|
+
def test_to_regular():
|
|
34
|
+
assert abv_man.to_regular("SEA", 2025) == "SEA"
|
|
35
|
+
assert abv_man.to_regular("KCA", 1999) == "KCR"
|
|
36
|
+
assert abv_man.to_regular("KC1", 2025) == "KC1"
|
|
37
|
+
assert abv_man.to_regular("SER", 2025) == "SER"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|