executablebooks / cookiecutter-jupyter-book

Cookiecutter template for a simple jupyter book
https://executablebooks.github.io/cookiecutter-jupyter-book/
BSD 3-Clause "New" or "Revised" License
140 stars 53 forks source link

Add a project hook to check that GitHub username is valid #3

Closed TomasBeuzen closed 4 years ago

TomasBeuzen commented 4 years ago

It was pointed out that not all users will have GitHub usernames, or may make mistakes when entering their username. As this username is used to populate cookiecutter files, we should check that the name is valid, and raise a warning if not.

I'm thinking that this could be done with requests:

import requests

if not requests.get("http://www.github.com/tomasbeuzen").status_code < 400:
    # raise a warning

This adds ~ 2 seconds onto the post generation workflow, I'll try it out and see how it goes...