town_clock.util package

Submodules

town_clock.util.clock_exceptions module

town_clock.util.clock_logging module

town_clock.util.location_sunrise_sunset module

Calculates sun position.

find_sunrise_sunset_times(latitude: float, longitude: float, altitude: float) dict[int, float][source]
timezone_finder(latitude: float, longitude: float)[source]

town_clock.util.utils module

class CLOCK(value)[source]

Bases: Enum

CLOCK Names A enum used for controlling and altering the clock times independently. todo: Use enum with objects..

ALL = 0
ONE = 1
TWO = 2
classmethod values() tuple[Literal[0], Literal[1], Literal[2]][source]
class Log_Level(value)[source]

Bases: Enum

Log Levels: CRITICAL: 50 EXCEPTION = 40 ERROR: 40 WARNING: 30 INFO: 20 DEBUG: 10 NOTSET: 0

CRITICAL = 50
DEBUG = 10
ERROR = 40
EXCEPTION = 40
INFO = 20
NOTSET = 0
PULSE = 45
SUCCESS = 25
WARNING = 30
class Mode(value)[source]

Bases: Enum

Either Test or Active

DEV = ‘dev’ TEST = ‘test’ ACTIVE = ‘active’

ACTIVE = 'active'
DEV = 'dev'
TEST = 'test'
convert_position_string_to_number(position_str: str) float[source]

Converts a position string to a number.

Parameters:

position_str – str: Position in the form of a string. eg “30.3402W”

Module contents

Utility package for town-clock

All modules can use these utility functions and classes.

Author: Zack Hankin Started: 27/01/2023

class CLOCK(value)[source]

Bases: Enum

CLOCK Names A enum used for controlling and altering the clock times independently. todo: Use enum with objects..

ALL = 0
ONE = 1
TWO = 2
classmethod values() tuple[Literal[0], Literal[1], Literal[2]][source]
class Log_Level(value)[source]

Bases: Enum

Log Levels: CRITICAL: 50 EXCEPTION = 40 ERROR: 40 WARNING: 30 INFO: 20 DEBUG: 10 NOTSET: 0

CRITICAL = 50
DEBUG = 10
ERROR = 40
EXCEPTION = 40
INFO = 20
NOTSET = 0
PULSE = 45
SUCCESS = 25
WARNING = 30
class Mode(value)[source]

Bases: Enum

Either Test or Active

DEV = ‘dev’ TEST = ‘test’ ACTIVE = ‘active’

ACTIVE = 'active'
DEV = 'dev'
TEST = 'test'
convert_position_string_to_number(position_str: str) float[source]

Converts a position string to a number.

Parameters:

position_str – str: Position in the form of a string. eg “30.3402W”

find_sunrise_sunset_times(latitude: float, longitude: float, altitude: float) dict[int, float][source]
timezone_finder(latitude: float, longitude: float)[source]