Hook to create JupyterHub instance in specified namespace

Is it possible, when a user logs in to his instance the first time(and subsequently), to run a python script which uses some internal logic to determine which kubernetes namespace to assign him/her to and then create the notebook instance in that namespace?
Rationale: We are a multi-tenant platform and plan to sequester tenants by namespaces for security and billing purposes.