How to integrate Ansible Galaxy tool OAuth with Gitlab API using Python

How to integrate Ansible Galaxy tool OAuth with Gitlab API using Python scripting?
Any references or sample projects or web links to refer and get it?