hockey-blast-common-lib 0.1.24__py3-none-any.whl → 0.1.26__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.
@@ -1,6 +1,10 @@
1
1
  import os
2
2
  from sqlalchemy import create_engine
3
3
  from sqlalchemy.orm import sessionmaker
4
+ from dotenv import load_dotenv
5
+
6
+ # Load environment variables from .env file in the root directory of THE PROJECT (not this library)
7
+ load_dotenv()
4
8
 
5
9
  # Database connection parameters per organization
6
10
  DB_PARAMS = {
@@ -14,20 +18,20 @@ DB_PARAMS = {
14
18
 
15
19
  "frontend-sample-db": {
16
20
  "dbname": os.getenv("DB_NAME_SAMPLE", "hockey_blast_sample"),
17
- "user": os.getenv("DB_USER_SAMPLE", "frontend_user"),
18
- "password": os.getenv("DB_PASSWORD_SAMPLE", "hockey-blast"),
19
- "host": os.getenv("DB_HOST_SAMPLE", "localhost"),
20
- "port": int(os.getenv("DB_PORT_SAMPLE", 5432))
21
+ "user": os.getenv("DB_USER", "frontend_user"),
22
+ "password": os.getenv("DB_PASSWORD", "hockey-blast"),
23
+ "host": os.getenv("DB_HOST", "localhost"),
24
+ "port": int(os.getenv("DB_PORT", 5432))
21
25
  },
22
26
 
23
- # TODO - the section below is just to handle recovery of sample DB where boss user is present
24
- # Maybe figure out a way to do backup without it and make frontend_user own the sample?
27
+ # The section below is to handle recovery of sample DB where boss user is present, to avoid warnings and errors
28
+ # TODO: Maybe figure out a way to do backup without it and make frontend_user own the sample?
25
29
  "boss": {
26
- "dbname": os.getenv("DB_NAME_BOSS", "hockey_blast"),
30
+ "dbname": os.getenv("DB_NAME", "hockey_blast"),
27
31
  "user": os.getenv("DB_USER_BOSS", "boss"),
28
32
  "password": os.getenv("DB_PASSWORD_BOSS", "boss"),
29
- "host": os.getenv("DB_HOST_BOSS", "localhost"),
30
- "port": int(os.getenv("DB_PORT_BOSS", 5432))
33
+ "host": os.getenv("DB_HOST", "localhost"),
34
+ "port": int(os.getenv("DB_PORT", 5432))
31
35
  },
32
36
  }
33
37
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hockey-blast-common-lib
3
- Version: 0.1.24
3
+ Version: 0.1.26
4
4
  Summary: Common library for shared functionality and DB models
5
5
  Author: Pavel Kletskov
6
6
  Author-email: kletskov@gmail.com
@@ -3,16 +3,16 @@ hockey_blast_common_lib/aggregate_goalie_stats.py,sha256=d2qav46Rg2DNIYRj_Ubj1kp
3
3
  hockey_blast_common_lib/aggregate_human_stats.py,sha256=88OMhTgQjzc9xIakf6kW9_lZwbSXkpsZy8C0pX-Wlq8,14229
4
4
  hockey_blast_common_lib/aggregate_referee_stats.py,sha256=A0PTyEbPUjqfXxlJCDOVioFaQk9AyjjhiWEuRuu35v0,11036
5
5
  hockey_blast_common_lib/aggregate_skater_stats.py,sha256=37fhgej9trukr8cGaK7DT1HoxBcp95qwsypYCCziqqc,15563
6
- hockey_blast_common_lib/db_connection.py,sha256=9jRHXXQr1KLIsV416O0uVrJTmhXPAVBCQ8Vxt55Hfus,1763
6
+ hockey_blast_common_lib/db_connection.py,sha256=HvPxDvOj7j5H85RfslGvHVNevfg7mKCd0syJ6NX21mU,1890
7
7
  hockey_blast_common_lib/dump_sample_db.sh,sha256=MHPA-Ciod7wsvAlMbRtXFiyajgnEqU1xR59sJQ9UWR0,738
8
- hockey_blast_common_lib/hockey_blast_sample_backup.sql.gz,sha256=JIk9FeWrEqHvmTLeueJtSkK2mNpg_xtonAMHDKlYe-4,1033693
8
+ hockey_blast_common_lib/hockey_blast_sample_backup.sql.gz,sha256=UBbPuU8WzHmxIQScT1uXIbTpjWkkt3gu-FS2LNjBx2A,1033691
9
9
  hockey_blast_common_lib/models.py,sha256=GqQIGpanmFub97BoYCuaqDov2MxM4LMesUTxZ2edpvw,15393
10
10
  hockey_blast_common_lib/options.py,sha256=-LtEX8duw5Pl3CSpjFlLM5FPvrZuTAxTfSlDPa7H6mQ,761
11
11
  hockey_blast_common_lib/restore_sample_db.sh,sha256=u2zKazC6vNMULkpYzI64nlneCWaGUtDHPBAU-gWgRbw,1861
12
12
  hockey_blast_common_lib/stats_models.py,sha256=PI-mL1jmjCHLAvaATxSsjHEn05g9L_reA_YpsITPWjQ,21047
13
13
  hockey_blast_common_lib/utils.py,sha256=odDJWCK0BgbResXeoUzxbVChjaxcXr168ZxbrAw3L_8,3752
14
14
  hockey_blast_common_lib/wsgi.py,sha256=wl1gf3KtaGSnYbCF5Z2xWwRXNSTQp43HoyhCAKJibI4,750
15
- hockey_blast_common_lib-0.1.24.dist-info/METADATA,sha256=XaVVtt0lzFoikeXe3EjcPtEoUeLNF_JT5acqqbfiSP4,318
16
- hockey_blast_common_lib-0.1.24.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
17
- hockey_blast_common_lib-0.1.24.dist-info/top_level.txt,sha256=wIR4LIkE40npoA2QlOdfCYlgFeGbsHR8Z6r0h46Vtgc,24
18
- hockey_blast_common_lib-0.1.24.dist-info/RECORD,,
15
+ hockey_blast_common_lib-0.1.26.dist-info/METADATA,sha256=pk2DS7PIU7DyABn3LxU5enJmHSghN_4OyGn8RN-l8e8,318
16
+ hockey_blast_common_lib-0.1.26.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
17
+ hockey_blast_common_lib-0.1.26.dist-info/top_level.txt,sha256=wIR4LIkE40npoA2QlOdfCYlgFeGbsHR8Z6r0h46Vtgc,24
18
+ hockey_blast_common_lib-0.1.26.dist-info/RECORD,,