I am looking for a Python script that is able to register itself as a URL protocol handler (URL handler) under OS X.
The only information I found was http://www.cocoadev.com/index.pl?HowToRegisterURLHandler but this is for Apps written in Objective-C and I’m not sure if how/it’s possible to replicate the same with a Python script.
Short answer: Use AppleScript as an intermediary, as demonstrated here:
Python URL Handler
The information from the URL is passed into the Python script arguments.