1
Fork 0
mirror of https://github.com/Steffo99/unimore-bda-6.git synced 2024-11-26 01:34:20 +00:00
bda-6-steffo/unimore_bda_6/config.py

38 lines
648 B
Python
Raw Normal View History

2023-02-01 03:20:09 +00:00
import cfig
config = cfig.Configuration()
@config.required()
def MONGO_HOST(val: str) -> str:
"""
The hostname of the MongoDB database to connect to.
"""
return val
@config.required()
def MONGO_PORT(val: str) -> str:
"""
The port of the MongoDB database to connect to.
"""
return val
@config.required()
def TRAINING_SET_SIZE(val: str) -> int:
"""
The number of reviews from each category to fetch for the training set.
"""
try:
return int(val)
except ValueError:
raise cfig.InvalidValueError("Not an int.")
__all__ = (
"config",
"MONGO_HOST",
"MONGO_PORT",
)