Package: typo
typotypo is a python package to simulate typographical errors in English language.Release 0.1.7Ability to preserve first and/or last characters in error methods.UsageimporttypoimportdatetimemyStrErrer=typo.StrErrer('Hello World! Happy new year 2021.',seed=31)print(myStrErrer.missing_char().result)# Should print 'ello World! Happy new year 2021.'myStrErrer=typo.StrErrer('Hello World! Happy new year 2021.',seed=31)print(myStrErrer.missing_char(preservefirst=True).result)# Should print 'Hllo World! Happy new year 2021.'myStrErrer=typo.StrErrer('Hello World! Happy new year 2021.',seed=2)print(myStrErrer.missing_char().char_swap().result)# Should print 'Hlol World! Happy new year 2021.'myIntErrer=typo.IntErrer(34343,seed=1)print(myIntErrer.similar_digit().result)# Should print 39343myDateErrer=typo.DateErrer(datetime.datetime.strptime("8 Mar 95","%d%b %y"))print(myDateErrer.date_month_swap().result)# Should print 1995-08-03 00:00:00Currently, following types of typos can be simulated:String typos:Given the inputHello World! Happy new year 2021., different error types produce the following errors.Error methodDescriptionSample outputchar_swap(preservefirst=False, preservelast=False)Swaps two random consecutive word characters in the string.Hello World! Ahppy new year 2021.missing_char(preservefirst=False, preservelast=False)Skips a random word character in the string.Hllo World! Happy new year 2021.extra_char(preservefirst=False, preservelast=False)Adds an extra, keyboard-neighbor, letter next to a random word character.Hrello World! Happy new year 2021.nearby_char(preservefirst=False, preservelast=False)Replaces a random word character with keyboard-neighbor letter.Hello World! Happy new ysar 2021.similar_char()Replaces a random word character with another visually similar character.Hell0 world! Happy new year 2021.skipped_space()Skips a random space from the string.Hello world! Happy new year2021.random_space()Adds a random space in the string.Hell o world! Happy new year 2021.repeated_char()Repeats a random word character.Hello worrld! Happy new year 2021.unichar()Replaces a random consecutive repeated letter with a single letter.Hello world! Hapy new year 2021.Integer typos:Error methodDescriptionInputSample outputdigit_swap(preservefirst=False, preservelast=False)Swaps two random consecutive digits in the integer.12345678901324567890missing_digit(preservefirst=False, preservelast=False)Skips a random digit in the integer.-1234567890-123457890extra_digit(preservefirst=False, preservelast=False)Adds an extra, keyboard-neighbor, digit next to a random digit in the integer.123456789012345678920nearby_digit(preservefirst=False, preservelast=False)Replaces a random digit in the integer with a keyboard-neighbor digit.12345678901234567892similar_digit()Replaces a random digit with another visually similar digit.12345678901234567896repeated_digit()Repeats a random digit in the integer.123456789012345678900unidigit()Replaces a random consecutive repeated digit with a single digit.-112233445566-11233445566Datetime typos:Error methodDescriptionInputSample outputdate_month_swap()Swaps the day and month of the date if the value of the day is less than or equal to 12.8 Mar 953 Aug 95