inspect_project.py 632 B

123456789101112131415
  1. import requests
  2. import urllib3
  3. import os
  4. import json
  5. urllib3.disable_warnings()
  6. auth = requests.post('https://192.168.130.161/taiga/api/v1/auth', json={'type': 'normal', 'username': 'FrancoisLange', 'password': 'your_db_password_here'}, verify=False).json()
  7. h = {'Authorization': f'Bearer {auth["auth_token"]}'}
  8. p = requests.get('https://192.168.130.161/taiga/api/v1/projects/21', headers=h, verify=False).json()
  9. # Write project dictionary to a temporary text file so we can view it
  10. with open('scratch/project_details.json', 'w') as f:
  11. json.dump(p, f, indent=2)
  12. print("Project details saved to scratch/project_details.json")