Package: chorecore
ChoreCoreChoreCore is a multi-language utility library built to make every developer's life easier.It is made up of a plethora of modules and this documentation will assume that you import all definitions from each
moduleImport ExplanationObviously this method of importing is not required, but is simply used in this documentation to save time and space.fromchorecore.alphabetimport*fromchorecore.conditionalsimport*fromchorecore.fractionimport*fromchorecore.mathimport*fromchorecore.stringsimport*fromchorecore.symbolsimport*fromchorecore.timeimport*AlphabetClassAlphabetContains the alphabet in an abundance of variants in Array form.NameValueLOWERCASE["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]UPPERCASE["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]LOWERCASE_VOWELS["a", "e", "i", "o", "u", "y"]UPPERCASE_VOWELS["A", "E", "I", "O", "U", "Y"]LOWERCASE_NON_VOWELS["b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "q", "r", "s", "t", "v", "w", "x", "z"]UPPERCASE_NON_VOWELS["B", "C", "D", "F", "G", "H", "J", "K", "L", "M", "N", "P", "Q", "R", "S", "T", "V", "W", "X", "Z"]Alphabet.StringsContains the alphabet in an abundance of variants in String form.NameValueLOWERCASE"abcdefghijklmnopqrstuvwxyz"UPPERCASE"ABCDEFGHIJKLMNOPQRSTUVWXYZ"LOWERCASE_VOWELS"aeiouy"UPPERCASE_VOWELS"AEIOUY"LOWERCASE_NON_VOWELS"bcdfghjklmnpqrstvwxz"UPPERCASE_NON_VOWELS"BCDFGHJKLMNPQRSTVWXZ"MethodsAll constants have an accompanying method that will simply return the character at the index passed to itlowercase_at(i: int): struppercase_at(i: int): strlowercase_vowel_at(i: int): struppercase_vowel_at(i: int): strlowercase_non_vowel_at(i: int): struppercase_non_vowel_at(i: int): strConditionalsConditional functions were mainly made to simplify ternary operations and provide one-sided cases.They are specialized for string interpolation, but are certainly not limited to this.It should be noted thatConditionalsextensively leverages theInternalmodule.is_even(test_val, return_val=Default.PARAMETER, else_val='')If thetest_valis even, thereturn_valis returned, otherwise it will returnelse_val.is_equal(original_val, test_val, return_val=Default.PARAMETER, else_val='')If theoriginal_valandtest_valare equal, thereturn_valis returned, otherwise it will returnelse_val.is_false(test_val, return_val=Default.PARAMETER, else_val='')If thetest_valisfalse, thereturn_valis returned, otherwise it will returnelse_val.is_gt: (original_val, test_val, return_val=Default.PARAMETER, else_val='')If theoriginal_valis greater than thetest_val, thereturn_valis returned, otherwise it will returnelse_val.is_gte: (original_val, test_val, return_val=Default.PARAMETER, else_val='')If theoriginal_valis greater than or equal to thetest_val, thereturn_valis returned, otherwise it will returnelse_val.is_lt: (original_val, test_val, return_val=Default.PARAMETER, else_val='')If theoriginal_valis less than thetest_val, thereturn_valis returned, otherwise it will returnelse_val.is_lte: (original_val, test_val, return_val=Default.PARAMETER, else_val='')If theoriginal_valis less than or equal to thetest_val, thereturn_valis returned, otherwise it will returnelse_val.is_not_equal(original_val, test_val, return_val=Default.PARAMETER, else_val='')If theoriginal_valandtest_valare not equal, thereturn_valis returned, otherwise it will returnelse_val.is_not_none(test_val, return_val=Default.PARAMETER, else_val='')If thetest_valis notNone, thereturn_valis returned, otherwise it will returnelse_val.is_not_undefined(test_val, return_val=Default.PARAMETER, else_val='')If thetest_valis notundefined, thereturn_valis returned, otherwise it will returnelse_val.is_none(test_val, return_val=Default.PARAMETER, else_val='')If thetest_valisNone, thereturn_valis returned, otherwise it will returnelse_val.is_odd(test_val: number, return_val=Default.PARAMETER, else_val='')If thetest_valis odd, thereturn_valis returned, otherwise it will returnelse_val.is_true(test_val, return_val=Default.PARAMETER, else_val='')If thetest_valistrue, thereturn_valis returned, otherwise it will returnelse_val.is_undefined(test_val, return_val=Default.PARAMETER, else_val='')If thetestValisundefined, thereturnValis returned, otherwise it will returnelseVal.FractionClassFractionContains all Unicode fraction symbolsNameValueONE_HALF½ONE_THIRD⅓ONE_QUARTER¼ONE_FIFTH⅕ONE_SIXTH⅙ONE_SEVENTH⅐ONE_EIGHTH⅛ONE_NINTH⅑ONE_TENTH⅒TWO_THIRDS⅔TWO_FIFTHS⅖THREE_QUARTERS¾THREE_FIFTHS⅗THREE_EIGHTHS⅜FOUR_FIFTHS⅘FIVE_SIXTHS⅚FIVE_EIGHTHS⅝SEVEN_EIGHTHS⅞InternalThis module was created for the sole purpose of expanding on Python's default parameter abilities.As it stands, Python allows for default parameters of specified values, but does not allow you to set them to the value of another parameter.Combining the class and method below allows us to replicate the following JavaScript code:functionfunc(x,y=x){// If y is not defined, y will default to the value of x}in Python by doing this:deffunc(x,y=Default.PARAMETER):y=is_default_parameter(y,x)# If y is not defined, y will default to the value of xClassDefaultDefault is an Enum which contains only a single member value: PARAMETER. (It's value isNone, but that's irrelevant)Methodis_default_parameter(test_val, return_val)If thetest_valisDefault.PARAMETER, the method returnsreturn_val. Otherwise, that means thetest_valwas defined and is therefore returned.Mathclosest(needle: number, arr: number[]): numberThis method will return the closest value in the array to the needleExample:closest(8,[1,7,3,10,5])# returns 7parse_fraction_string(fraction: string): numberThis method parses a function written in out in a string and returns the number as a decimalStringsMethodsreplacement_map(alter: str, replacements: dict): strThis method is used to shrink multiplereplacecalls in a row. By passing in the string, as well as a dictionary of key (string in the original) value (string to replace with) pairs, you will receive back a string with all occurrences of the keys, replaced with their corresponding partner.It should be noted that the order of keys does matter when keys overlap. (FIFO)TimeClassTimeContains all time constants in milliseconds (Units such as months and up are not included as they are not constant).UnitValueMILLISECOND1SECOND1000MINUTE60000HOUR3600000DAY86400000WEEK604800000MethodsAll constants have an accompanying method that will simply return that unit in milliseconds multiplied by the argument you pass in.days(multiplier: number): numberhours(multiplier: number): numbermilliseconds(multiplier: number): numberminutes(multiplier: number): numberseconds(multiplier: number): numberweeks(multiplier: number): numberSymbolsMethodfraction_to_symbol(originalVal: number | string): stringThis method accepts a fraction (either as a number or a string) and returns the closest value from the list of symbols aboveThrows an error if the provided value is less than or equal to  -1, or greater than or equal to 1