Ranger provides client libraries in Java and Python to access Ranger REST APIs programmatically with ease.
For more details, please refer to Ranger Python Client Library.