hockey-blast-common-lib 0.1.6__py3-none-any.whl → 0.1.8__py3-none-any.whl
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/aggregate_goalie_stats.py +161 -0
- hockey_blast_common_lib/aggregate_human_stats.py +291 -0
- hockey_blast_common_lib/aggregate_referee_stats.py +229 -0
- hockey_blast_common_lib/aggregate_skater_stats.py +323 -0
- hockey_blast_common_lib/db_connection.py +5 -17
- hockey_blast_common_lib/models.py +0 -527
- hockey_blast_common_lib/options.py +22 -0
- hockey_blast_common_lib/stats_models.py +563 -0
- hockey_blast_common_lib/utils.py +65 -0
- hockey_blast_common_lib/wsgi.py +16 -0
- {hockey_blast_common_lib-0.1.6.dist-info → hockey_blast_common_lib-0.1.8.dist-info}/METADATA +1 -1
- hockey_blast_common_lib-0.1.8.dist-info/RECORD +16 -0
- hockey_blast_common_lib-0.1.6.dist-info/RECORD +0 -8
- {hockey_blast_common_lib-0.1.6.dist-info → hockey_blast_common_lib-0.1.8.dist-info}/WHEEL +0 -0
- {hockey_blast_common_lib-0.1.6.dist-info → hockey_blast_common_lib-0.1.8.dist-info}/top_level.txt +0 -0
@@ -1,5 +1,4 @@
|
|
1
1
|
from flask_sqlalchemy import SQLAlchemy
|
2
|
-
from sqlalchemy.ext.declarative import declared_attr
|
3
2
|
|
4
3
|
db = SQLAlchemy()
|
5
4
|
|
@@ -339,532 +338,6 @@ class TeamInTTS(db.Model):
|
|
339
338
|
)
|
340
339
|
|
341
340
|
|
342
|
-
# CLASSES FOR STATS ARE BELOW THIS LINE
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
class BaseStatsHuman(db.Model):
|
361
|
-
__abstract__ = True
|
362
|
-
id = db.Column(db.Integer, primary_key=True)
|
363
|
-
human_id = db.Column(db.Integer, db.ForeignKey('humans.id'), nullable=False)
|
364
|
-
games_total = db.Column(db.Integer, default=0)
|
365
|
-
games_total_rank = db.Column(db.Integer, default=0)
|
366
|
-
games_skater = db.Column(db.Integer, default=0)
|
367
|
-
games_skater_rank = db.Column(db.Integer, default=0)
|
368
|
-
games_referee = db.Column(db.Integer, default=0)
|
369
|
-
games_referee_rank = db.Column(db.Integer, default=0)
|
370
|
-
games_scorekeeper = db.Column(db.Integer, default=0)
|
371
|
-
games_scorekeeper_rank = db.Column(db.Integer, default=0)
|
372
|
-
games_goalie = db.Column(db.Integer, default=0)
|
373
|
-
games_goalie_rank = db.Column(db.Integer, default=0)
|
374
|
-
total_in_rank = db.Column(db.Integer, default=0)
|
375
|
-
first_game_id = db.Column(db.Integer, db.ForeignKey('games.id'))
|
376
|
-
last_game_id = db.Column(db.Integer, db.ForeignKey('games.id'))
|
377
|
-
|
378
|
-
@declared_attr
|
379
|
-
def __table_args__(cls):
|
380
|
-
return (
|
381
|
-
db.UniqueConstraint('human_id', cls.aggregation_id, name=f'_human_{cls.aggregation_type}_stats_uc1'),
|
382
|
-
db.Index(f'idx_{cls.aggregation_type}_games_total1', cls.aggregation_id, 'games_total'),
|
383
|
-
db.Index(f'idx_{cls.aggregation_type}_games_skater1', cls.aggregation_id, 'games_skater'),
|
384
|
-
db.Index(f'idx_{cls.aggregation_type}_games_referee1', cls.aggregation_id, 'games_referee'),
|
385
|
-
db.Index(f'idx_{cls.aggregation_type}_games_scorekeeper1', cls.aggregation_id, 'games_scorekeeper'),
|
386
|
-
db.Index(f'idx_{cls.aggregation_type}_games_goalie1', cls.aggregation_id, 'games_goalie')
|
387
|
-
)
|
388
|
-
|
389
|
-
class BaseStatsSkater(db.Model):
|
390
|
-
__abstract__ = True
|
391
|
-
id = db.Column(db.Integer, primary_key=True)
|
392
|
-
human_id = db.Column(db.Integer, db.ForeignKey('humans.id'), nullable=False)
|
393
|
-
games_played = db.Column(db.Integer, default=0)
|
394
|
-
games_played_rank = db.Column(db.Integer, default=0)
|
395
|
-
goals = db.Column(db.Integer, default=0)
|
396
|
-
goals_rank = db.Column(db.Integer, default=0)
|
397
|
-
assists = db.Column(db.Integer, default=0)
|
398
|
-
assists_rank = db.Column(db.Integer, default=0)
|
399
|
-
points = db.Column(db.Integer, default=0)
|
400
|
-
points_rank = db.Column(db.Integer, default=0)
|
401
|
-
penalties = db.Column(db.Integer, default=0)
|
402
|
-
penalties_rank = db.Column(db.Integer, default=0)
|
403
|
-
goals_per_game = db.Column(db.Float, default=0.0)
|
404
|
-
goals_per_game_rank = db.Column(db.Integer, default=0)
|
405
|
-
points_per_game = db.Column(db.Float, default=0.0)
|
406
|
-
points_per_game_rank = db.Column(db.Integer, default=0)
|
407
|
-
assists_per_game = db.Column(db.Float, default=0.0)
|
408
|
-
assists_per_game_rank = db.Column(db.Integer, default=0)
|
409
|
-
penalties_per_game = db.Column(db.Float, default=0.0)
|
410
|
-
penalties_per_game_rank = db.Column(db.Integer, default=0)
|
411
|
-
total_in_rank = db.Column(db.Integer, default=0)
|
412
|
-
first_game_id = db.Column(db.Integer, db.ForeignKey('games.id'))
|
413
|
-
last_game_id = db.Column(db.Integer, db.ForeignKey('games.id'))
|
414
|
-
|
415
|
-
@declared_attr
|
416
|
-
def __table_args__(cls):
|
417
|
-
return (
|
418
|
-
db.UniqueConstraint('human_id', cls.aggregation_id, name=f'_human_{cls.aggregation_type}_uc_skater1'),
|
419
|
-
db.Index(f'idx_{cls.aggregation_type}_goals_per_game3', cls.aggregation_id, 'goals_per_game'),
|
420
|
-
db.Index(f'idx_{cls.aggregation_type}_points_per_game3', cls.aggregation_id, 'points_per_game'),
|
421
|
-
db.Index(f'idx_{cls.aggregation_type}_assists_per_game3', cls.aggregation_id, 'assists_per_game'),
|
422
|
-
db.Index(f'idx_{cls.aggregation_type}_penalties_per_game3', cls.aggregation_id, 'penalties_per_game'),
|
423
|
-
db.Index(f'idx_{cls.aggregation_type}_games_played3', cls.aggregation_id, 'games_played')
|
424
|
-
)
|
425
|
-
|
426
|
-
class BaseStatsGoalie(db.Model):
|
427
|
-
__abstract__ = True
|
428
|
-
id = db.Column(db.Integer, primary_key=True)
|
429
|
-
human_id = db.Column(db.Integer, db.ForeignKey('humans.id'), nullable=False)
|
430
|
-
games_played = db.Column(db.Integer, default=0)
|
431
|
-
games_played_rank = db.Column(db.Integer, default=0)
|
432
|
-
goals_allowed = db.Column(db.Integer, default=0)
|
433
|
-
goals_allowed_rank = db.Column(db.Integer, default=0)
|
434
|
-
goals_allowed_per_game = db.Column(db.Float, default=0.0)
|
435
|
-
goals_allowed_per_game_rank = db.Column(db.Integer, default=0)
|
436
|
-
shots_faced = db.Column(db.Integer, default=0)
|
437
|
-
shots_faced_rank = db.Column(db.Integer, default=0)
|
438
|
-
save_percentage = db.Column(db.Float, default=0.0)
|
439
|
-
save_percentage_rank = db.Column(db.Integer, default=0)
|
440
|
-
total_in_rank = db.Column(db.Integer, default=0)
|
441
|
-
first_game_id = db.Column(db.Integer, db.ForeignKey('games.id'))
|
442
|
-
last_game_id = db.Column(db.Integer, db.ForeignKey('games.id'))
|
443
|
-
|
444
|
-
@declared_attr
|
445
|
-
def __table_args__(cls):
|
446
|
-
return (
|
447
|
-
db.UniqueConstraint('human_id', cls.aggregation_id, name=f'_human_{cls.aggregation_type}_uc_goalie1'),
|
448
|
-
db.Index(f'idx_{cls.aggregation_type}_goals_allowed_per_game1', cls.aggregation_id, 'goals_allowed_per_game'),
|
449
|
-
db.Index(f'idx_{cls.aggregation_type}_save_percentage1', cls.aggregation_id, 'save_percentage'),
|
450
|
-
db.Index(f'idx_{cls.aggregation_type}_shots_faced1', cls.aggregation_id, 'shots_faced'),
|
451
|
-
db.Index(f'idx_{cls.aggregation_type}_games_played_goalie1', cls.aggregation_id, 'games_played'),
|
452
|
-
db.Index(f'idx_{cls.aggregation_type}_goals_allowed1', cls.aggregation_id, 'goals_allowed')
|
453
|
-
)
|
454
|
-
|
455
|
-
class BaseStatsReferee(db.Model):
|
456
|
-
__abstract__ = True
|
457
|
-
id = db.Column(db.Integer, primary_key=True)
|
458
|
-
human_id = db.Column(db.Integer, db.ForeignKey('humans.id'), nullable=False)
|
459
|
-
games_reffed = db.Column(db.Integer, default=0)
|
460
|
-
games_reffed_rank = db.Column(db.Integer, default=0)
|
461
|
-
penalties_given = db.Column(db.Integer, default=0)
|
462
|
-
penalties_given_rank = db.Column(db.Integer, default=0)
|
463
|
-
penalties_per_game = db.Column(db.Float, default=0.0)
|
464
|
-
penalties_per_game_rank = db.Column(db.Integer, default=0)
|
465
|
-
gm_given = db.Column(db.Integer, default=0)
|
466
|
-
gm_given_rank = db.Column(db.Integer, default=0)
|
467
|
-
gm_per_game = db.Column(db.Float, default=0.0)
|
468
|
-
gm_per_game_rank = db.Column(db.Integer, default=0)
|
469
|
-
total_in_rank = db.Column(db.Integer, default=0)
|
470
|
-
first_game_id = db.Column(db.Integer, db.ForeignKey('games.id'))
|
471
|
-
last_game_id = db.Column(db.Integer, db.ForeignKey('games.id'))
|
472
|
-
|
473
|
-
@declared_attr
|
474
|
-
def __table_args__(cls):
|
475
|
-
return (
|
476
|
-
db.UniqueConstraint('human_id', cls.aggregation_id, name=f'_human_{cls.aggregation_type}_uc_referee1'),
|
477
|
-
db.Index(f'idx_{cls.aggregation_type}_games_reffed1', cls.aggregation_id, 'games_reffed'),
|
478
|
-
db.Index(f'idx_{cls.aggregation_type}_penalties_given1', cls.aggregation_id, 'penalties_given'),
|
479
|
-
db.Index(f'idx_{cls.aggregation_type}_penalties_per_game1', cls.aggregation_id, 'penalties_per_game'),
|
480
|
-
db.Index(f'idx_{cls.aggregation_type}_gm_given1', cls.aggregation_id, 'gm_given'),
|
481
|
-
db.Index(f'idx_{cls.aggregation_type}_gm_per_game1', cls.aggregation_id, 'gm_per_game')
|
482
|
-
)
|
483
|
-
|
484
|
-
class BaseStatsScorekeeper(db.Model):
|
485
|
-
__abstract__ = True
|
486
|
-
id = db.Column(db.Integer, primary_key=True)
|
487
|
-
human_id = db.Column(db.Integer, db.ForeignKey('humans.id'), nullable=False)
|
488
|
-
games_recorded = db.Column(db.Integer, default=0)
|
489
|
-
games_recorded_rank = db.Column(db.Integer, default=0)
|
490
|
-
sog_given = db.Column(db.Integer, default=0)
|
491
|
-
sog_given_rank = db.Column(db.Integer, default=0)
|
492
|
-
sog_per_game = db.Column(db.Float, default=0.0)
|
493
|
-
sog_per_game_rank = db.Column(db.Integer, default=0)
|
494
|
-
total_in_rank = db.Column(db.Integer, default=0)
|
495
|
-
first_game_id = db.Column(db.Integer, db.ForeignKey('games.id'))
|
496
|
-
last_game_id = db.Column(db.Integer, db.ForeignKey('games.id'))
|
497
|
-
|
498
|
-
@declared_attr
|
499
|
-
def __table_args__(cls):
|
500
|
-
return (
|
501
|
-
db.UniqueConstraint('human_id', cls.aggregation_id, name=f'_human_{cls.aggregation_type}_uc_scorekeeper1'),
|
502
|
-
db.Index(f'idx_{cls.aggregation_type}_games_recorded1', cls.aggregation_id, 'games_recorded'),
|
503
|
-
db.Index(f'idx_{cls.aggregation_type}_sog_given1', cls.aggregation_id, 'sog_given'),
|
504
|
-
db.Index(f'idx_{cls.aggregation_type}_sog_per_game1', cls.aggregation_id, 'sog_per_game')
|
505
|
-
)
|
506
|
-
|
507
|
-
class OrgStatsHuman(BaseStatsHuman):
|
508
|
-
__tablename__ = 'org_stats_human'
|
509
|
-
org_id = db.Column(db.Integer, db.ForeignKey('organizations.id'), nullable=False)
|
510
|
-
|
511
|
-
@declared_attr
|
512
|
-
def aggregation_id(cls):
|
513
|
-
return cls.org_id
|
514
|
-
|
515
|
-
@declared_attr
|
516
|
-
def aggregation_type(cls):
|
517
|
-
return 'org'
|
518
|
-
|
519
|
-
class DivisionStatsHuman(BaseStatsHuman):
|
520
|
-
__tablename__ = 'division_stats_human'
|
521
|
-
division_id = db.Column(db.Integer, db.ForeignKey('divisions.id'), nullable=False)
|
522
|
-
|
523
|
-
@declared_attr
|
524
|
-
def aggregation_id(cls):
|
525
|
-
return cls.division_id
|
526
|
-
|
527
|
-
@declared_attr
|
528
|
-
def aggregation_type(cls):
|
529
|
-
return 'division'
|
530
|
-
|
531
|
-
class OrgStatsSkater(BaseStatsSkater):
|
532
|
-
__tablename__ = 'org_stats_skater'
|
533
|
-
org_id = db.Column(db.Integer, db.ForeignKey('organizations.id'), nullable=False)
|
534
|
-
|
535
|
-
@declared_attr
|
536
|
-
def aggregation_id(cls):
|
537
|
-
return cls.org_id
|
538
|
-
|
539
|
-
@declared_attr
|
540
|
-
def aggregation_type(cls):
|
541
|
-
return 'org'
|
542
|
-
|
543
|
-
class DivisionStatsSkater(BaseStatsSkater):
|
544
|
-
__tablename__ = 'division_stats_skater'
|
545
|
-
division_id = db.Column(db.Integer, db.ForeignKey('divisions.id'), nullable=False)
|
546
|
-
|
547
|
-
@declared_attr
|
548
|
-
def aggregation_id(cls):
|
549
|
-
return cls.division_id
|
550
|
-
|
551
|
-
@declared_attr
|
552
|
-
def aggregation_type(cls):
|
553
|
-
return 'division'
|
554
|
-
|
555
|
-
class OrgStatsGoalie(BaseStatsGoalie):
|
556
|
-
__tablename__ = 'org_stats_goalie'
|
557
|
-
org_id = db.Column(db.Integer, db.ForeignKey('organizations.id'), nullable=False)
|
558
|
-
|
559
|
-
@declared_attr
|
560
|
-
def aggregation_id(cls):
|
561
|
-
return cls.org_id
|
562
|
-
|
563
|
-
@declared_attr
|
564
|
-
def aggregation_type(cls):
|
565
|
-
return 'org'
|
566
|
-
|
567
|
-
class DivisionStatsGoalie(BaseStatsGoalie):
|
568
|
-
__tablename__ = 'division_stats_goalie'
|
569
|
-
division_id = db.Column(db.Integer, db.ForeignKey('divisions.id'), nullable=False)
|
570
|
-
|
571
|
-
@declared_attr
|
572
|
-
def aggregation_id(cls):
|
573
|
-
return cls.division_id
|
574
|
-
|
575
|
-
@declared_attr
|
576
|
-
def aggregation_type(cls):
|
577
|
-
return 'division'
|
578
|
-
|
579
|
-
|
580
|
-
class OrgStatsReferee(BaseStatsReferee):
|
581
|
-
__tablename__ = 'org_stats_referee'
|
582
|
-
org_id = db.Column(db.Integer, db.ForeignKey('organizations.id'), nullable=False)
|
583
|
-
|
584
|
-
@declared_attr
|
585
|
-
def aggregation_id(cls):
|
586
|
-
return cls.org_id
|
587
|
-
|
588
|
-
@declared_attr
|
589
|
-
def aggregation_type(cls):
|
590
|
-
return 'org'
|
591
|
-
|
592
|
-
class DivisionStatsReferee(BaseStatsReferee):
|
593
|
-
__tablename__ = 'division_stats_referee'
|
594
|
-
division_id = db.Column(db.Integer, db.ForeignKey('divisions.id'), nullable=False)
|
595
|
-
|
596
|
-
@declared_attr
|
597
|
-
def aggregation_id(cls):
|
598
|
-
return cls.division_id
|
599
|
-
|
600
|
-
@declared_attr
|
601
|
-
def aggregation_type(cls):
|
602
|
-
return 'division'
|
603
|
-
|
604
|
-
|
605
|
-
class OrgStatsScorekeeper(BaseStatsScorekeeper):
|
606
|
-
__tablename__ = 'org_stats_scorekeeper'
|
607
|
-
org_id = db.Column(db.Integer, db.ForeignKey('organizations.id'), nullable=False)
|
608
|
-
|
609
|
-
@declared_attr
|
610
|
-
def aggregation_id(cls):
|
611
|
-
return cls.org_id
|
612
|
-
|
613
|
-
@declared_attr
|
614
|
-
def aggregation_type(cls):
|
615
|
-
return 'org'
|
616
|
-
|
617
|
-
class DivisionStatsScorekeeper(BaseStatsScorekeeper):
|
618
|
-
__tablename__ = 'division_stats_scorekeeper'
|
619
|
-
division_id = db.Column(db.Integer, db.ForeignKey('divisions.id'), nullable=False)
|
620
|
-
|
621
|
-
@declared_attr
|
622
|
-
def aggregation_id(cls):
|
623
|
-
return cls.division_id
|
624
|
-
|
625
|
-
@declared_attr
|
626
|
-
def aggregation_type(cls):
|
627
|
-
return 'division'
|
628
|
-
|
629
|
-
class OrgStatsDailyHuman(BaseStatsHuman):
|
630
|
-
__tablename__ = 'org_stats_daily_human'
|
631
|
-
org_id = db.Column(db.Integer, db.ForeignKey('organizations.id'), nullable=False)
|
632
|
-
|
633
|
-
@declared_attr
|
634
|
-
def aggregation_id(cls):
|
635
|
-
return cls.org_id
|
636
|
-
|
637
|
-
@declared_attr
|
638
|
-
def aggregation_type(cls):
|
639
|
-
return 'org_daily'
|
640
|
-
|
641
|
-
class OrgStatsWeeklyHuman(BaseStatsHuman):
|
642
|
-
__tablename__ = 'org_stats_weekly_human'
|
643
|
-
org_id = db.Column(db.Integer, db.ForeignKey('organizations.id'), nullable=False)
|
644
|
-
|
645
|
-
@declared_attr
|
646
|
-
def aggregation_id(cls):
|
647
|
-
return cls.org_id
|
648
|
-
|
649
|
-
@declared_attr
|
650
|
-
def aggregation_type(cls):
|
651
|
-
return 'org_weekly'
|
652
|
-
|
653
|
-
class DivisionStatsDailyHuman(BaseStatsHuman):
|
654
|
-
__tablename__ = 'division_stats_daily_human'
|
655
|
-
division_id = db.Column(db.Integer, db.ForeignKey('divisions.id'), nullable=False)
|
656
|
-
|
657
|
-
@declared_attr
|
658
|
-
def aggregation_id(cls):
|
659
|
-
return cls.division_id
|
660
|
-
|
661
|
-
@declared_attr
|
662
|
-
def aggregation_type(cls):
|
663
|
-
return 'division_daily'
|
664
|
-
|
665
|
-
class DivisionStatsWeeklyHuman(BaseStatsHuman):
|
666
|
-
__tablename__ = 'division_stats_weekly_human'
|
667
|
-
division_id = db.Column(db.Integer, db.ForeignKey('divisions.id'), nullable=False)
|
668
|
-
|
669
|
-
@declared_attr
|
670
|
-
def aggregation_id(cls):
|
671
|
-
return cls.division_id
|
672
|
-
|
673
|
-
@declared_attr
|
674
|
-
def aggregation_type(cls):
|
675
|
-
return 'division_weekly'
|
676
|
-
|
677
|
-
class OrgStatsDailySkater(BaseStatsSkater):
|
678
|
-
__tablename__ = 'org_stats_daily_skater'
|
679
|
-
org_id = db.Column(db.Integer, db.ForeignKey('organizations.id'), nullable=False)
|
680
|
-
|
681
|
-
@declared_attr
|
682
|
-
def aggregation_id(cls):
|
683
|
-
return cls.org_id
|
684
|
-
|
685
|
-
@declared_attr
|
686
|
-
def aggregation_type(cls):
|
687
|
-
return 'org_daily'
|
688
|
-
|
689
|
-
class OrgStatsWeeklySkater(BaseStatsSkater):
|
690
|
-
__tablename__ = 'org_stats_weekly_skater'
|
691
|
-
org_id = db.Column(db.Integer, db.ForeignKey('organizations.id'), nullable=False)
|
692
|
-
|
693
|
-
@declared_attr
|
694
|
-
def aggregation_id(cls):
|
695
|
-
return cls.org_id
|
696
|
-
|
697
|
-
@declared_attr
|
698
|
-
def aggregation_type(cls):
|
699
|
-
return 'org_weekly'
|
700
|
-
|
701
|
-
class DivisionStatsDailySkater(BaseStatsSkater):
|
702
|
-
__tablename__ = 'division_stats_daily_skater'
|
703
|
-
division_id = db.Column(db.Integer, db.ForeignKey('divisions.id'), nullable=False)
|
704
|
-
|
705
|
-
@declared_attr
|
706
|
-
def aggregation_id(cls):
|
707
|
-
return cls.division_id
|
708
|
-
|
709
|
-
@declared_attr
|
710
|
-
def aggregation_type(cls):
|
711
|
-
return 'division_daily'
|
712
|
-
|
713
|
-
class DivisionStatsWeeklySkater(BaseStatsSkater):
|
714
|
-
__tablename__ = 'division_stats_weekly_skater'
|
715
|
-
division_id = db.Column(db.Integer, db.ForeignKey('divisions.id'), nullable=False)
|
716
|
-
|
717
|
-
@declared_attr
|
718
|
-
def aggregation_id(cls):
|
719
|
-
return cls.division_id
|
720
|
-
|
721
|
-
@declared_attr
|
722
|
-
def aggregation_type(cls):
|
723
|
-
return 'division_weekly'
|
724
|
-
|
725
|
-
class OrgStatsDailyGoalie(BaseStatsGoalie):
|
726
|
-
__tablename__ = 'org_stats_daily_goalie'
|
727
|
-
org_id = db.Column(db.Integer, db.ForeignKey('organizations.id'), nullable=False)
|
728
|
-
|
729
|
-
@declared_attr
|
730
|
-
def aggregation_id(cls):
|
731
|
-
return cls.org_id
|
732
|
-
|
733
|
-
@declared_attr
|
734
|
-
def aggregation_type(cls):
|
735
|
-
return 'org_daily'
|
736
|
-
|
737
|
-
class OrgStatsWeeklyGoalie(BaseStatsGoalie):
|
738
|
-
__tablename__ = 'org_stats_weekly_goalie'
|
739
|
-
org_id = db.Column(db.Integer, db.ForeignKey('organizations.id'), nullable=False)
|
740
|
-
|
741
|
-
@declared_attr
|
742
|
-
def aggregation_id(cls):
|
743
|
-
return cls.org_id
|
744
|
-
|
745
|
-
@declared_attr
|
746
|
-
def aggregation_type(cls):
|
747
|
-
return 'org_weekly'
|
748
|
-
|
749
|
-
class DivisionStatsDailyGoalie(BaseStatsGoalie):
|
750
|
-
__tablename__ = 'division_stats_daily_goalie'
|
751
|
-
division_id = db.Column(db.Integer, db.ForeignKey('divisions.id'), nullable=False)
|
752
|
-
|
753
|
-
@declared_attr
|
754
|
-
def aggregation_id(cls):
|
755
|
-
return cls.division_id
|
756
|
-
|
757
|
-
@declared_attr
|
758
|
-
def aggregation_type(cls):
|
759
|
-
return 'division_daily'
|
760
|
-
|
761
|
-
class DivisionStatsWeeklyGoalie(BaseStatsGoalie):
|
762
|
-
__tablename__ = 'division_stats_weekly_goalie'
|
763
|
-
division_id = db.Column(db.Integer, db.ForeignKey('divisions.id'), nullable=False)
|
764
|
-
|
765
|
-
@declared_attr
|
766
|
-
def aggregation_id(cls):
|
767
|
-
return cls.division_id
|
768
|
-
|
769
|
-
@declared_attr
|
770
|
-
def aggregation_type(cls):
|
771
|
-
return 'division_weekly'
|
772
|
-
|
773
|
-
class OrgStatsDailyReferee(BaseStatsReferee):
|
774
|
-
__tablename__ = 'org_stats_daily_referee'
|
775
|
-
org_id = db.Column(db.Integer, db.ForeignKey('organizations.id'), nullable=False)
|
776
|
-
|
777
|
-
@declared_attr
|
778
|
-
def aggregation_id(cls):
|
779
|
-
return cls.org_id
|
780
|
-
|
781
|
-
@declared_attr
|
782
|
-
def aggregation_type(cls):
|
783
|
-
return 'org_daily'
|
784
|
-
|
785
|
-
class OrgStatsWeeklyReferee(BaseStatsReferee):
|
786
|
-
__tablename__ = 'org_stats_weekly_referee'
|
787
|
-
org_id = db.Column(db.Integer, db.ForeignKey('organizations.id'), nullable=False)
|
788
|
-
|
789
|
-
@declared_attr
|
790
|
-
def aggregation_id(cls):
|
791
|
-
return cls.org_id
|
792
|
-
|
793
|
-
@declared_attr
|
794
|
-
def aggregation_type(cls):
|
795
|
-
return 'org_weekly'
|
796
|
-
|
797
|
-
class DivisionStatsDailyReferee(BaseStatsReferee):
|
798
|
-
__tablename__ = 'division_stats_daily_referee'
|
799
|
-
division_id = db.Column(db.Integer, db.ForeignKey('divisions.id'), nullable=False)
|
800
|
-
|
801
|
-
@declared_attr
|
802
|
-
def aggregation_id(cls):
|
803
|
-
return cls.division_id
|
804
|
-
|
805
|
-
@declared_attr
|
806
|
-
def aggregation_type(cls):
|
807
|
-
return 'division_daily'
|
808
|
-
|
809
|
-
class DivisionStatsWeeklyReferee(BaseStatsReferee):
|
810
|
-
__tablename__ = 'division_stats_weekly_referee'
|
811
|
-
division_id = db.Column(db.Integer, db.ForeignKey('divisions.id'), nullable=False)
|
812
|
-
|
813
|
-
@declared_attr
|
814
|
-
def aggregation_id(cls):
|
815
|
-
return cls.division_id
|
816
|
-
|
817
|
-
@declared_attr
|
818
|
-
def aggregation_type(cls):
|
819
|
-
return 'division_weekly'
|
820
|
-
|
821
|
-
class OrgStatsDailyScorekeeper(BaseStatsScorekeeper):
|
822
|
-
__tablename__ = 'org_stats_daily_scorekeeper'
|
823
|
-
org_id = db.Column(db.Integer, db.ForeignKey('organizations.id'), nullable=False)
|
824
|
-
|
825
|
-
@declared_attr
|
826
|
-
def aggregation_id(cls):
|
827
|
-
return cls.org_id
|
828
|
-
|
829
|
-
@declared_attr
|
830
|
-
def aggregation_type(cls):
|
831
|
-
return 'org_daily'
|
832
|
-
|
833
|
-
class OrgStatsWeeklyScorekeeper(BaseStatsScorekeeper):
|
834
|
-
__tablename__ = 'org_stats_weekly_scorekeeper'
|
835
|
-
org_id = db.Column(db.Integer, db.ForeignKey('organizations.id'), nullable=False)
|
836
|
-
|
837
|
-
@declared_attr
|
838
|
-
def aggregation_id(cls):
|
839
|
-
return cls.org_id
|
840
|
-
|
841
|
-
@declared_attr
|
842
|
-
def aggregation_type(cls):
|
843
|
-
return 'org_weekly'
|
844
|
-
|
845
|
-
class DivisionStatsDailyScorekeeper(BaseStatsScorekeeper):
|
846
|
-
__tablename__ = 'division_stats_daily_scorekeeper'
|
847
|
-
division_id = db.Column(db.Integer, db.ForeignKey('divisions.id'), nullable=False)
|
848
|
-
|
849
|
-
@declared_attr
|
850
|
-
def aggregation_id(cls):
|
851
|
-
return cls.division_id
|
852
|
-
|
853
|
-
@declared_attr
|
854
|
-
def aggregation_type(cls):
|
855
|
-
return 'division_daily'
|
856
|
-
|
857
|
-
class DivisionStatsWeeklyScorekeeper(BaseStatsScorekeeper):
|
858
|
-
__tablename__ = 'division_stats_weekly_scorekeeper'
|
859
|
-
division_id = db.Column(db.Integer, db.ForeignKey('divisions.id'), nullable=False)
|
860
|
-
|
861
|
-
@declared_attr
|
862
|
-
def aggregation_id(cls):
|
863
|
-
return cls.division_id
|
864
|
-
|
865
|
-
@declared_attr
|
866
|
-
def aggregation_type(cls):
|
867
|
-
return 'division_weekly'
|
868
341
|
|
869
342
|
# # MANUAL AMENDS HAPPEN HERE :)
|
870
343
|
# from db_connection import create_session
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import argparse
|
2
|
+
|
3
|
+
MAX_HUMAN_SEARCH_RESULTS = 25
|
4
|
+
MAX_TEAM_SEARCH_RESULTS = 25
|
5
|
+
MIN_GAMES_FOR_ORG_STATS = 1
|
6
|
+
MIN_GAMES_FOR_DIVISION_STATS = 1
|
7
|
+
|
8
|
+
orgs = {'caha', 'sharksice', 'tvice'}
|
9
|
+
|
10
|
+
not_human_names = [
|
11
|
+
("Away", None, None),
|
12
|
+
(None, "Unknown", None),
|
13
|
+
("Not", None , None),
|
14
|
+
(None , None, "Goalie")
|
15
|
+
]
|
16
|
+
|
17
|
+
def parse_args():
|
18
|
+
parser = argparse.ArgumentParser(description="Process data for a specific organization.")
|
19
|
+
parser.add_argument("org", choices=orgs, help="The organization to process (e.g., 'caha', 'sharksice', 'tvice').")
|
20
|
+
parser.add_argument("--reprocess", action="store_true", help="Reprocess existing data.")
|
21
|
+
parser.add_argument("--pre_process", action="store_true", help="Pre-Process existing data.")
|
22
|
+
return parser.parse_args()
|