hockey-blast-common-lib 0.1.8__tar.gz → 0.1.10__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.
- {hockey_blast_common_lib-0.1.8 → hockey_blast_common_lib-0.1.10}/PKG-INFO +1 -1
- {hockey_blast_common_lib-0.1.8 → hockey_blast_common_lib-0.1.10}/hockey_blast_common_lib/aggregate_goalie_stats.py +9 -6
- {hockey_blast_common_lib-0.1.8 → hockey_blast_common_lib-0.1.10}/hockey_blast_common_lib/aggregate_human_stats.py +10 -6
- {hockey_blast_common_lib-0.1.8 → hockey_blast_common_lib-0.1.10}/hockey_blast_common_lib/aggregate_referee_stats.py +6 -1
- {hockey_blast_common_lib-0.1.8 → hockey_blast_common_lib-0.1.10}/hockey_blast_common_lib/aggregate_skater_stats.py +5 -1
- {hockey_blast_common_lib-0.1.8 → hockey_blast_common_lib-0.1.10}/hockey_blast_common_lib/stats_models.py +1 -1
- {hockey_blast_common_lib-0.1.8 → hockey_blast_common_lib-0.1.10}/hockey_blast_common_lib/utils.py +28 -1
- {hockey_blast_common_lib-0.1.8 → hockey_blast_common_lib-0.1.10}/hockey_blast_common_lib.egg-info/PKG-INFO +1 -1
- {hockey_blast_common_lib-0.1.8 → hockey_blast_common_lib-0.1.10}/hockey_blast_common_lib.egg-info/SOURCES.txt +0 -1
- {hockey_blast_common_lib-0.1.8 → hockey_blast_common_lib-0.1.10}/setup.py +1 -1
- hockey_blast_common_lib-0.1.8/hockey_blast_common_lib/db_utils.py +0 -26
- {hockey_blast_common_lib-0.1.8 → hockey_blast_common_lib-0.1.10}/README.md +0 -0
- {hockey_blast_common_lib-0.1.8 → hockey_blast_common_lib-0.1.10}/hockey_blast_common_lib/__init__.py +0 -0
- {hockey_blast_common_lib-0.1.8 → hockey_blast_common_lib-0.1.10}/hockey_blast_common_lib/db_connection.py +0 -0
- {hockey_blast_common_lib-0.1.8 → hockey_blast_common_lib-0.1.10}/hockey_blast_common_lib/models.py +0 -0
- {hockey_blast_common_lib-0.1.8 → hockey_blast_common_lib-0.1.10}/hockey_blast_common_lib/options.py +0 -0
- {hockey_blast_common_lib-0.1.8 → hockey_blast_common_lib-0.1.10}/hockey_blast_common_lib/wsgi.py +0 -0
- {hockey_blast_common_lib-0.1.8 → hockey_blast_common_lib-0.1.10}/hockey_blast_common_lib.egg-info/dependency_links.txt +0 -0
- {hockey_blast_common_lib-0.1.8 → hockey_blast_common_lib-0.1.10}/hockey_blast_common_lib.egg-info/requires.txt +0 -0
- {hockey_blast_common_lib-0.1.8 → hockey_blast_common_lib-0.1.10}/hockey_blast_common_lib.egg-info/top_level.txt +0 -0
- {hockey_blast_common_lib-0.1.8 → hockey_blast_common_lib-0.1.10}/setup.cfg +0 -0
@@ -1,13 +1,16 @@
|
|
1
1
|
import sys, os
|
2
|
+
|
3
|
+
# Add the package directory to the Python path
|
4
|
+
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
5
|
+
|
2
6
|
from datetime import datetime, timedelta
|
3
7
|
import sqlalchemy
|
4
|
-
from
|
5
|
-
from
|
6
|
-
from
|
7
|
-
from db_connection import create_session
|
8
|
+
from hockey_blast_common_lib.models import Game, GameRoster
|
9
|
+
from hockey_blast_common_lib.stats_models import OrgStatsGoalie, DivisionStatsGoalie, OrgStatsWeeklyGoalie, OrgStatsDailyGoalie, DivisionStatsWeeklyGoalie, DivisionStatsDailyGoalie
|
10
|
+
from hockey_blast_common_lib.db_connection import create_session
|
8
11
|
from sqlalchemy.sql import func, case
|
9
|
-
from options import parse_args, MIN_GAMES_FOR_ORG_STATS, MIN_GAMES_FOR_DIVISION_STATS
|
10
|
-
from utils import get_org_id_from_alias, get_human_ids_by_names, get_division_ids_for_last_season_in_all_leagues, get_all_division_ids_for_org
|
12
|
+
from hockey_blast_common_lib.options import not_human_names, parse_args, MIN_GAMES_FOR_ORG_STATS, MIN_GAMES_FOR_DIVISION_STATS
|
13
|
+
from hockey_blast_common_lib.utils import get_org_id_from_alias, get_human_ids_by_names, get_division_ids_for_last_season_in_all_leagues, get_all_division_ids_for_org
|
11
14
|
|
12
15
|
def aggregate_goalie_stats(session, aggregation_type, aggregation_id, names_to_filter_out, aggregation_window=None):
|
13
16
|
human_ids_to_filter = get_human_ids_by_names(session, names_to_filter_out)
|
@@ -1,13 +1,17 @@
|
|
1
1
|
import sys, os
|
2
|
+
|
3
|
+
# Add the package directory to the Python path
|
4
|
+
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
5
|
+
|
6
|
+
|
2
7
|
from datetime import datetime, timedelta
|
3
8
|
import sqlalchemy
|
4
|
-
from models import Game, GameRoster
|
5
|
-
from stats_models import OrgStatsHuman, DivisionStatsHuman, OrgStatsDailyHuman, OrgStatsWeeklyHuman, DivisionStatsDailyHuman, DivisionStatsWeeklyHuman
|
6
|
-
from db_connection import create_session
|
9
|
+
from hockey_blast_common_lib.models import Game, GameRoster
|
10
|
+
from hockey_blast_common_lib.stats_models import OrgStatsHuman, DivisionStatsHuman, OrgStatsDailyHuman, OrgStatsWeeklyHuman, DivisionStatsDailyHuman, DivisionStatsWeeklyHuman
|
11
|
+
from hockey_blast_common_lib.db_connection import create_session
|
7
12
|
from sqlalchemy.sql import func, case
|
8
|
-
from options import parse_args, MIN_GAMES_FOR_ORG_STATS, MIN_GAMES_FOR_DIVISION_STATS, not_human_names
|
9
|
-
from utils import get_org_id_from_alias, get_human_ids_by_names, get_division_ids_for_last_season_in_all_leagues
|
10
|
-
from db_utils import get_fake_human_for_stats
|
13
|
+
from hockey_blast_common_lib.options import parse_args, MIN_GAMES_FOR_ORG_STATS, MIN_GAMES_FOR_DIVISION_STATS, not_human_names
|
14
|
+
from hockey_blast_common_lib.utils import get_fake_human_for_stats, get_org_id_from_alias, get_human_ids_by_names, get_division_ids_for_last_season_in_all_leagues
|
11
15
|
|
12
16
|
def aggregate_human_stats(session, aggregation_type, aggregation_id, names_to_filter_out, human_id_filter=None, aggregation_window=None):
|
13
17
|
human_ids_to_filter = get_human_ids_by_names(session, names_to_filter_out)
|
@@ -1,7 +1,12 @@
|
|
1
1
|
import sys, os
|
2
|
+
|
3
|
+
# Add the package directory to the Python path
|
4
|
+
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
5
|
+
|
6
|
+
|
2
7
|
from datetime import datetime, timedelta
|
3
8
|
import sqlalchemy
|
4
|
-
from models import Game, Penalty
|
9
|
+
from hockey_blast_common_lib.models import Game, Penalty
|
5
10
|
from stats_models import OrgStatsReferee, DivisionStatsReferee,OrgStatsWeeklyReferee, OrgStatsDailyReferee, DivisionStatsWeeklyReferee, DivisionStatsDailyReferee
|
6
11
|
from db_connection import create_session
|
7
12
|
from sqlalchemy.sql import func, case
|
@@ -1,9 +1,13 @@
|
|
1
1
|
import sys, os
|
2
|
+
|
3
|
+
# Add the package directory to the Python path
|
4
|
+
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
5
|
+
|
2
6
|
from datetime import datetime, timedelta
|
3
7
|
import sqlalchemy
|
4
8
|
from options import not_human_names
|
5
9
|
|
6
|
-
from models import Game, Goal, Penalty, GameRoster
|
10
|
+
from hockey_blast_common_lib.models import Game, Goal, Penalty, GameRoster
|
7
11
|
from stats_models import OrgStatsSkater, DivisionStatsSkater, OrgStatsWeeklySkater, OrgStatsDailySkater, DivisionStatsWeeklySkater, DivisionStatsDailySkater
|
8
12
|
from db_connection import create_session
|
9
13
|
from sqlalchemy.sql import func, case
|
{hockey_blast_common_lib-0.1.8 → hockey_blast_common_lib-0.1.10}/hockey_blast_common_lib/utils.py
RENAMED
@@ -1,9 +1,13 @@
|
|
1
1
|
import sys
|
2
2
|
import os
|
3
|
+
|
4
|
+
# Add the package directory to the Python path
|
5
|
+
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
6
|
+
|
3
7
|
from datetime import datetime, timedelta
|
4
8
|
|
5
9
|
|
6
|
-
from models import Organization, Human, Division
|
10
|
+
from hockey_blast_common_lib.models import Organization, Human, Division
|
7
11
|
from sqlalchemy.sql import func
|
8
12
|
|
9
13
|
|
@@ -63,3 +67,26 @@ def get_division_ids_for_last_season_in_all_leagues(session, org_id):
|
|
63
67
|
def get_all_division_ids_for_org(session, org_id):
|
64
68
|
division_ids_for_org = session.query(Division.id).filter_by(org_id=org_id).all()
|
65
69
|
return [division_id.id for division_id in division_ids_for_org]
|
70
|
+
|
71
|
+
def get_fake_human_for_stats(session):
|
72
|
+
first_name = "Fake"
|
73
|
+
middle_name = "Stats"
|
74
|
+
last_name = "Human"
|
75
|
+
|
76
|
+
# Check if the human already exists
|
77
|
+
existing_human = session.query(Human).filter_by(first_name=first_name, middle_name=middle_name, last_name=last_name).first()
|
78
|
+
if existing_human:
|
79
|
+
return existing_human.id
|
80
|
+
|
81
|
+
# Create a new human
|
82
|
+
human = Human(first_name=first_name, middle_name=middle_name, last_name=last_name)
|
83
|
+
session.add(human)
|
84
|
+
session.commit() # Commit to get the human.id
|
85
|
+
|
86
|
+
return human.id
|
87
|
+
|
88
|
+
# TEST DB CONNECTION, PERMISSIONS...
|
89
|
+
# from hockey_blast_common_lib.db_connection import create_session
|
90
|
+
# session = create_session("hockey-blast-radonly")
|
91
|
+
# human_id = get_fake_human_for_stats(session)
|
92
|
+
# print(f"Human ID: {human_id}")
|
@@ -6,7 +6,6 @@ hockey_blast_common_lib/aggregate_human_stats.py
|
|
6
6
|
hockey_blast_common_lib/aggregate_referee_stats.py
|
7
7
|
hockey_blast_common_lib/aggregate_skater_stats.py
|
8
8
|
hockey_blast_common_lib/db_connection.py
|
9
|
-
hockey_blast_common_lib/db_utils.py
|
10
9
|
hockey_blast_common_lib/models.py
|
11
10
|
hockey_blast_common_lib/options.py
|
12
11
|
hockey_blast_common_lib/stats_models.py
|
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|
2
2
|
|
3
3
|
setup(
|
4
4
|
name='hockey-blast-common-lib', # The name of your package
|
5
|
-
version='0.1.
|
5
|
+
version='0.1.10',
|
6
6
|
description='Common library for shared functionality and DB models',
|
7
7
|
author='Pavel Kletskov',
|
8
8
|
author_email='kletskov@gmail.com',
|
@@ -1,26 +0,0 @@
|
|
1
|
-
import sys
|
2
|
-
import os
|
3
|
-
|
4
|
-
from models import Human
|
5
|
-
from db_connection import create_session
|
6
|
-
|
7
|
-
def get_fake_human_for_stats(session):
|
8
|
-
first_name = "Fake"
|
9
|
-
middle_name = "Stats"
|
10
|
-
last_name = "Human"
|
11
|
-
|
12
|
-
# Check if the human already exists
|
13
|
-
existing_human = session.query(Human).filter_by(first_name=first_name, middle_name=middle_name, last_name=last_name).first()
|
14
|
-
if existing_human:
|
15
|
-
return existing_human.id
|
16
|
-
|
17
|
-
# Create a new human
|
18
|
-
human = Human(first_name=first_name, middle_name=middle_name, last_name=last_name)
|
19
|
-
session.add(human)
|
20
|
-
session.commit() # Commit to get the human.id
|
21
|
-
|
22
|
-
return human.id
|
23
|
-
|
24
|
-
# session = create_session("hockey-blast-radonly")
|
25
|
-
# human_id = get_fake_human_for_stats(session)
|
26
|
-
# print(f"Human ID: {human_id}")
|
File without changes
|
{hockey_blast_common_lib-0.1.8 → hockey_blast_common_lib-0.1.10}/hockey_blast_common_lib/__init__.py
RENAMED
File without changes
|
File without changes
|
{hockey_blast_common_lib-0.1.8 → hockey_blast_common_lib-0.1.10}/hockey_blast_common_lib/models.py
RENAMED
File without changes
|
{hockey_blast_common_lib-0.1.8 → hockey_blast_common_lib-0.1.10}/hockey_blast_common_lib/options.py
RENAMED
File without changes
|
{hockey_blast_common_lib-0.1.8 → hockey_blast_common_lib-0.1.10}/hockey_blast_common_lib/wsgi.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|