can you please help us how to apply numerology for any text document in python and say whether the given text file is optimistic or not depending on the numerology applied.

Not to endorse or refute the underlying concept, if you provided the rules (eg: number of vowels is greater than twice the square root of the number of "s"s) I'm sure you'd get some help.