Disclaimer: There is a python script that does exist, however it is insufficient and does not allow for any dynamic use.
The script that would be more useful is as follows and assumes the file is hosted on a direct link from a hosted site (like mediafire in my example):
Download file to user TEMP directory
Check if this package is already installed, cancel install if it is.
If not, install the package (allow command line parameters)
Return success or error codes with common reasons why the download or install failed.
What would be extremely useful is if we have the ability to interface with dropbox, onedrive, googledrive, or amazon aws as well. But, I’m keeping it simple for now.