To just check the latest version on PyPi (for Python 3.6 and up):
$ pip install requests
import requests
package = 'django' # replace with the package you want to check
response = requests.get(f'https://pypi.org/pypi/{package}/json')
latest_version = response.json()['info']['version']