We have an external power transformer for our 1975 182P we can plug in to wall and airplane. We have this to power the avionics when we are learning and practicing. I’ll be at hangar this Wednesday and try ti get a photo of unit and data plate for you.
What exactly do you want to do with this "external power source?" That could determine the complexity and cost of install.
If you want to use a "GPU" through the existing aircraft external power receptacle, you need to see if your 172 has a split electrical buss than separates the avionics power. Some will work with external power and some won't and will require further modification. As mentioned the quickest/easiest is to connect a quality aircraft battery charger during your "ground" work. However, there are other methods of varying complexity.
This plugs into wall, and then the ground power port just forward of pilot door. I think we purchased from Aircraft Spruce
There maybe a AD for your plane to prevent the prop from turning when ground power is connected if you have external power receptacle. Be careful when first connecting a GPU and stay away from the prop because it may turn if your plane is part of the AD and it has not been straighten out by fixing the wiring. The AD is 77-12-08
I made one with the finest in 27V 1000W power supplies(adjustable down to 24v and up a bit over 27), And then a second one with a 1000W 0-30 adjustable supply for both 12 and 24V planes.