- text_printer
- db
- character_class
- sheet_generator
- SheetGenerator
- __init__
- generate_key_pairs
- generate_basic_key_pairs
- generate_stat_key_pairs
- generate_saving_throw_key_pairs
- generate_skill_key_pairs
- generate_skill_prof_key_pairs
- generate_saving_throw_prof_key_pairs
- get_stat_modifier
- get_skill_modifier
- get_saving_throw_modifier
- check_skill_proficiency
- check_save_proficiency
- list_to_textarea_string
- SheetGenerator
- race
- __init__
- dice
- page_loader
- character
A module for printing text to the console.
class TextPrinter()A class to print text to the console.
def __init__() -> NoneInitialize the TextPrinter.
def update_text_to_print(text: str) -> NonePrint the text.
def split_string(string: str) -> strSplit the string.
def header(title: str) -> NonePrint the header.
def subheader(title: str) -> NonePrint the subheader.
def bolded(text: str) -> NonePrint the text in bold.
def list_to_dict(list_object: list) -> dictConvert a list to a dictionary.
def sort_dict(dict_object: dict) -> dictSort the dictionary.
def print_data(data: list | dict, title: str) -> NonePrint the dictionary.
def print_single_value(value: int | str, title: str) -> NonePrint a single value.
def print_dict_with_modifiers(data: dict, title: str) -> NonePrint the dictionary with modifiers.
def print_dict_with_data_and_modifiers(data: dict, title: str) -> NonePrint the dictionary with data and modifiers.
def print_modifiers(value: int) -> strPrint the modifiers of the value.
def print_character(character: Character) -> strPrint the character.
def print_basic_stats(character: Character) -> strPrint the basic stats.
def print_race_info(race_name: str) -> strPrint the list of races.
def print_class_info(class_name: str) -> strPrint the list of classes.
def print_roll(num_dice: int, num_sides: int, modifier: int) -> strPrint the roll of the dice.
A module for the database connection.
class DB()A class to represent a database connection.
def __init__() -> NoneInitialize the database connection.
def __del__() -> NoneClose the database connection when the object is destroyed.
def insert_character(name: str, race: str, dnd_class: str, stats: dict) -> intInsert a character into the database.
def insert_into_table(sql: str, data: list) -> intInsert into a table.
def read_from_table(sql: str) -> list[list]Read data from the db.
def load_character_list() -> list[list]Load the character list.
def load_character(char_id: int) -> dictLoad a character from the database.
A module to represent a class in Dungeons and Dragons.
class CharacterClass()A class to represent a class in Dungeons and Dragons.
def __init__(name: str) -> NoneInitialize the class.
def get_hit_die() -> dictGet the hit die of the class.
def get_primary_stat() -> listGet the primary stat of the class.
def get_worst_stat() -> dictGet the worst stat of the class.
def get_saving_throw_proficiencies() -> dictGet the saving throws of the class.
def get_skill_proficiencies() -> dictGet the skills of the class.
@staticmethod
def get_all_classes() -> listGet all classes.
A module for generating a character sheet key_pairs.
class SheetGenerator()A class to generate a character sheet.
def __init__(character: Character) -> NoneInitialize the SheetGenerator.
def generate_key_pairs() -> dictGenerate all key pairs for the character sheet.
def generate_basic_key_pairs() -> dictGenerate basic key pairs for the character sheet.
def generate_stat_key_pairs() -> dictGenerate stat key pairs for the character sheet.
def generate_saving_throw_key_pairs() -> dictGenerate saving throw key pairs for the character sheet.
def generate_skill_key_pairs() -> dictGenerate skill key pairs for the character sheet.
def generate_skill_prof_key_pairs() -> dictGenerate key pairs for the character sheet.
def generate_saving_throw_prof_key_pairs() -> dictGenerate key pairs for the character sheet.
def get_stat_modifier(stat: str) -> intGet the modifier of the stat.
def get_skill_modifier(skill: str) -> intGet the modifier of the skill.
def get_saving_throw_modifier(save: str) -> intGet the modifier of the saving throw.
def check_skill_proficiency(skill: str) -> boolCheck if the character is proficient in the skill.
def check_save_proficiency(save: str) -> boolCheck if the character is proficient in the save.
def list_to_textarea_string(data: list) -> strConvert a list to a string.
A module for representing a race in Dungeons and Dragons.
class Race()A class to represent a race in Dungeons and Dragons.
def __init__(name: str) -> NoneInitialize the race.
def get_race_bonus_stat() -> dictGet the bonus stats of the Race.
def get_race_speed() -> intGet the speed of the Race.
def get_race_languages() -> listGet the languages of the Race.
def get_race_traits() -> listGet the traits of the Race.
@staticmethod
def get_all_races() -> listGet a list of all the Dungeons and Dragons races.
A module to initialize the application.
A module to represent a dice roll.
class Dice()A class to represent a dice roll.
def __init__(num_dice: int, num_sides: int, modifier: int) -> NoneInitialize the dice roll.
def roll() -> NoneRoll the dice and return the total.
def roll_stat() -> intRoll a single stat.
def roll_stats() -> listRoll the stats for the character.
A module to load html pages.
class PageLoader()A class to load html pages.
def __init__() -> NoneInitialize the page loader.
def load_left_right_page(left_content: str = "",
right_content: str = "",
subtitle: str = "") -> strLoad the page.
def load_left_only_page(left_content: str = "",
subtitle: str = "",
styles: list | None = None,
scripts: list | None = None) -> strLoad the page.
def display_char(char: Character) -> strDisplay the character sheet.
def load_roll(args: dict) -> strLoad the roll page.
def load_races(args: dict) -> strLoad the races page.
def load_classes(args: dict) -> strLoad the classes page.
def load_table() -> strLoad the table page.
def left_right_dance(submit: str | None, left_content: str, right_content: str,
subtitle: str) -> strLoad the left right page.
def load_create_character(args: dict) -> strLoad the sheet page.
def load_old_character(char_id: int) -> CharacterLoad the sheet page.
def load_old_character_sheet(args: dict) -> strLoad the sheet page.
def build_script_string(script_list: list) -> strBuild a string of script tags.
def build_styles_string(styles_list: list) -> strBuild a string of style tags.
A module to represent a character in Dungeons and Dragons.
class Character()A class to represent a character in Dungeons and Dragons.
def __init__() -> NoneInitialize the character.
def new_character(name: str,
race: str,
dnd_class: str,
stats: dict[str, int] | None = None) -> NoneCreate a new character.
def store_character_in_db() -> NoneCreate the character in the database.
def find_modifier_stat(stat: str) -> intFind the modifier for a given stat.
@staticmethod
def find_modifier_value(value: int) -> intFind the modifier for a given value.
def update_race_details() -> NoneUpdate the character based on the race.
def update_class_details() -> NoneUpdate the character based on the class.
def update_skills() -> NoneUpdate the skills based on the stats.
def update_ac() -> NoneUpdate the AC based on the stats.
def update_initiative() -> NoneUpdate the initiative based on the stats.
def update_hp() -> NoneUpdate the HP based on the stats.
def update_passive_perception() -> NoneUpdate the passive perception based on the stats.
def roll_stats(primary_stat: list, worst_stat: list) -> NoneRoll the stats for the character.
def update_skill_for_stat(stat: str, skill_list: list) -> NoneUpdate the skill based on the stat.
def load_character_from_db(char_id: int) -> NoneLoad the character from the database.
def roll_check(check_type: str, check: str = "") -> intRoll a check based on type.