hockey-blast-common-lib 0.1.23__py3-none-any.whl → 0.1.25__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/db_connection.py +13 -9
- {hockey_blast_common_lib-0.1.23.dist-info → hockey_blast_common_lib-0.1.25.dist-info}/METADATA +1 -1
- {hockey_blast_common_lib-0.1.23.dist-info → hockey_blast_common_lib-0.1.25.dist-info}/RECORD +5 -5
- {hockey_blast_common_lib-0.1.23.dist-info → hockey_blast_common_lib-0.1.25.dist-info}/WHEEL +0 -0
- {hockey_blast_common_lib-0.1.23.dist-info → hockey_blast_common_lib-0.1.25.dist-info}/top_level.txt +0 -0
@@ -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("
|
18
|
-
"password": os.getenv("
|
19
|
-
"host": os.getenv("
|
20
|
-
"port": int(os.getenv("
|
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
|
-
#
|
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("
|
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("
|
30
|
-
"port": int(os.getenv("
|
33
|
+
"host": os.getenv("DB_HOST", "localhost"),
|
34
|
+
"port": int(os.getenv("DB_PORT", 5432))
|
31
35
|
},
|
32
36
|
}
|
33
37
|
|
{hockey_blast_common_lib-0.1.23.dist-info → hockey_blast_common_lib-0.1.25.dist-info}/RECORD
RENAMED
@@ -3,7 +3,7 @@ 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=
|
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
8
|
hockey_blast_common_lib/hockey_blast_sample_backup.sql.gz,sha256=JIk9FeWrEqHvmTLeueJtSkK2mNpg_xtonAMHDKlYe-4,1033693
|
9
9
|
hockey_blast_common_lib/models.py,sha256=GqQIGpanmFub97BoYCuaqDov2MxM4LMesUTxZ2edpvw,15393
|
@@ -12,7 +12,7 @@ hockey_blast_common_lib/restore_sample_db.sh,sha256=u2zKazC6vNMULkpYzI64nlneCWaG
|
|
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.
|
16
|
-
hockey_blast_common_lib-0.1.
|
17
|
-
hockey_blast_common_lib-0.1.
|
18
|
-
hockey_blast_common_lib-0.1.
|
15
|
+
hockey_blast_common_lib-0.1.25.dist-info/METADATA,sha256=0gW2JaFkqrFFyaNeaMRsKYxRWMkI_rdzf7oxF1vN_mk,318
|
16
|
+
hockey_blast_common_lib-0.1.25.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
17
|
+
hockey_blast_common_lib-0.1.25.dist-info/top_level.txt,sha256=wIR4LIkE40npoA2QlOdfCYlgFeGbsHR8Z6r0h46Vtgc,24
|
18
|
+
hockey_blast_common_lib-0.1.25.dist-info/RECORD,,
|
File without changes
|
{hockey_blast_common_lib-0.1.23.dist-info → hockey_blast_common_lib-0.1.25.dist-info}/top_level.txt
RENAMED
File without changes
|