I am looking for an implementation or clear algorithm for getting the prime factorization of N in either python, pseudocode or any
You should probably do some prime detection which you could look here, Fast algorithm for finding prime numbers?
You should read that entire blog though, there is a few algorithms that he lists for testing primality.