thejourneyplanner.config package

Submodules

thejourneyplanner.config.constants module

constants.py: Constants for the application.

class thejourneyplanner.config.constants.Constants

Bases: object

Constants for the application.

Notes

This class contains constants used throughout the application. By storing constants in a single location, it is easier to manage and update them. Constants should be defined as class attributes and should be named in uppercase with underscores separating words.

API_MAX: int = 8
COMPUTE_ROUTES_FIELD_MASK = 'routes.duration,routes.distanceMeters,routes.polyline.encodedPolyline'
COMPUTE_ROUTES_URL: str = 'https://routes.googleapis.com/directions/v2:computeRoutes'
CONVERSION_FACTOR_MINUTES_TO_METERS: int = 750
CONVERSION_FACTOR_SECONDS_TO_METERS: float = 12.5
DEFAULT_LOG_SAVE_PATH: Path = PosixPath('thejourneyplanner-log.txt')
DEFAULT_MAP_SAVE_PATH: Path = PosixPath('thejourneyplanner-map.html')
DEFAULT_OPEN_MAP: bool = False
DISTANCE_MATRIX_URL: str = 'https://maps.googleapis.com/maps/api/distancematrix/json'
FORBIDDEN_CODE: int = 403
LANGUAGE_CODE: str = 'en-GB'
LOGGING_CONSOLE_FORMAT: str = '%(message)s'
LOGGING_DATE_FORMAT: str = '[%X]'
LOGGING_LEVEL_CONSOLE_DEFAULT: Literal['CRITICAL', 'ERROR', 'WARNING', 'INFO', 'DEBUG'] = 'INFO'
LOGGING_LEVEL_LOGFILE_DEFAULT: Literal['CRITICAL', 'ERROR', 'WARNING', 'INFO', 'DEBUG'] = 'DEBUG'
LOGGING_LOGFILE_FORMAT: str = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
LOGGING_TIMESTAMP_FORMAT: str = '%Y-%m-%d_%H-%M-%S'
LOGGING_TRACEBACKS: bool = True
MAX_NEARBY_PLACES: int = 20
MAX_NEARBY_RADIUS: int = 50000
NEARBY_SEARCH_FIELD_MASK = 'places.displayName,places.location,places.formattedAddress,places.rating,places.userRatingCount'
NEARBY_SEARCH_RANK_BY: str = 'DISTANCE'
NEARBY_SEARCH_TYPES: list[str] = ['tourist_attraction']
NEARBY_SEARCH_URL: str = 'https://places.googleapis.com/v1/places:searchNearby'
NOMINATIM_URL: str = 'https://nominatim.openstreetmap.org/search'
NOMINATIM_USER_AGENT: str = 'Mozilla/5.0'
POSSIBLE_LOGGING_LEVELS

alias of Literal[‘CRITICAL’, ‘ERROR’, ‘WARNING’, ‘INFO’, ‘DEBUG’]

SUCCESS_CODE: int = 200
SUCCESS_TEXT: str = 'OK'

Module contents