rsync recognizes if a destination is local rsync a/ /local/path/  or if it is remote rsync a/ user@example.com:/path/to/.
Is there a similar URL parsing tool, built-in in Python's stdlib?
The key thing with rsync or scp is that we don't want to prepend a ssh://, it automatically parses it as local or remote, that's the requirement I have.
urllib.parse does not seem to be what I'm looking for:
import urllib.parse
print(urllib.parse.urlsplit('user@host.com:/home'))  # SplitResult(scheme='', netloc='', path='user@host.com:/home', query='', fragment='')
print(urllib.parse.urlsplit('./slash@host.com:/home')) # could be both a local path with @ and : in dirname
print(urllib.parse.urlsplit('./slash@host.com:/home')) # or a remote with valid unix username "./slash"
Note: SCP's implementation and IETF draft about this.
 
    