My journey into AI and automation began with learning Python. I spent eight months diligently learning procedural and object-oriented Python programming from the OpenEDG Python Institute. Below are some notable automation programs I developed using Python.
1. Character Frequency Counter (January 2025)
This program performs character frequency analysis: it requests a file name or path from the user, reads the file, and displays the frequency of each character. It also counts and displays the total number of lines and characters in the file. Characters are displayed in a sorted manner: letters are sorted first, followed by numbers, and lastly non-alphanumeric symbols. Corresponding lower-case and upper-case letters are treated as the same and presented in upper case. Tab, line break and space symbols are spelled out because they're not intrinsically visible characters.
For users who choose to export the results of the analysis, the program creates a text file on their computer (in the same directory as the source file) and names it after the source file, but with "_results" appended to distinguish them. The program knows when the source file is empty and when the user enters invalid data such as a non-existent filename, a filename without an extension, etc. Fields such as natural language processing and cryptography could utilise this program due to its ability to automate the counting of specific characters in a file.
2. Row Matcher and Consolidator (January 2025)
This program reads a file containing data presented in three columns (where the third column is considered as having numeric values) and returns a processed version where matching rows are consolidated. It combines any essentially identical rows and cumulates the values of their third column to form a single row. Corresponding lower-case and upper-case letters are treated as the same, and the result is sorted in ascending order and presented in title case.
The program uses custom exceptions to identify data errors in the file, then reports the row number and error text to the user. The program knows when the source file is empty and when the user enters invalid data such as a non-existent filename, a filename without an extension, etc. This program's ability to automatically match and consolidate rows makes it useful for tasks like cumulative score evaluation and multi-location inventory management.
3. Text Frequency Counter (December 2024)
This program finds the number of occurrences of a specified value in a given text. The specified value can be one or more characters or words. Users can perform multiple searches on the current text or provide new text for further searching without restarting the program. Corresponding lower-case and upper-case letters are treated as the same.
The program does not accept an empty search value. It also notifies the user when a search value yields no results. Users can terminate the program at any time with a simple command. This program's ability to automate the counting of specified characters or words in a given text makes it useful for tasks like word processing and data analysis.
4. Caesar Cipher (November 2024)
This program encrypts or decrypts messages by shifting each letter a certain number of positions up or down the alphabet respectively. It is an all-in-one substitution cipher that allows users to edit their input and switch between operations while maintaining their current session. It is therefore useful for automating encryption and decryption tasks where user experience is paramount.
The program begins by offering the user the option to encrypt, decrypt, or terminate. If the user chooses to encrypt or decrypt, the program prompts for the message and the desired shift value. Users can specify a new shift value to re-encrypt or re-decrypt their original message, or provide an entirely new message for encryption or decryption without restarting the program. Users can also terminate the program at any time with a simple command.
The program bases all encryption and decryption on the alphabet, and seamlessly transitions between the beginning and the end of the alphabet (treating it as a circular structure). For example, during an encryption where the shift value is 1, "z" becomes "a", and "Z" becomes "A". Conversely, during a decryption where the shift value is 1, "a" becomes "z", and "A" becomes "Z". As these examples also indicate, the program preserves each letter's case: lower-case letters remain lower case and upper-case letters remain upper case; non-alphabetical characters (e.g., numbers, spaces, symbols, etc.) remain unchanged.
Whenever users enter invalid data, the program lets them know and allows them to re-enter the data without requiring termination or restart. Invalid data includes a shift value that is not an integer from 1 to 25; an entry that is not one of the displayed options; an entry consisting solely of whitespace characters; and a blank entry.
5. Sudoku Validator (November 2024)
Sudoku is a number-placing puzzle played on a 9x9 board. For a Sudoku to be valid, each of the nine rows, nine columns, and nine 3x3 boxes making up the board must contain all digits from 1 to 9 arranged in any order. This program collects and reads the nine rows of a Sudoku to determine whether the play is valid or not. It verifies that each entry is a nine-digit sequence composed exclusively of numerals from 1 to 9. Whenever users enter invalid data, the program lets them know and allows them to re-enter the data without requiring termination or restart. Users can terminate the program at any time with a simple command.
6. Number to LED Display Converter (November 2024)
This is a fun program that simulates the behaviour of an LED display. The program receives an input comprising one or more positive integer digits, validates the entry, and displays it in an LED-style format if it passes the validation check. If the entry is invalid (e.g., is blank or contains alphabets, symbols, spaces, etc.), the program notifies the user and allows them to re-enter the data without requiring termination or restart. The numbers are displayed horizontally (side-by-side) like on an LED screen; to challenge myself, I developed this feature without using packages, modules, zip(), or similar functions.