[Python] Python script to read credentials from a yaml file, read a dataset and update...

Discussão em 'Python' iniciado por Stack, Setembro 11, 2024.

  1. Stack

    Stack Membro Participativo

    I'm working on an academic project where I need to create a python script to change credentials from a yaml file. This script should read the yaml file, then look for the value of Oauth 1 in a spreadsheet (authentication column) and get the updated Oauth 2, finally create a new ymal file with auth 2. I would like to know where I can start.

    I have a credentials.yaml with the content below.

    name: gcp_credentials_project
    info: 1798
    project_id: acd-univer-proj-mod-pers
    consumer_key: "cfb45ac0098b723f84219e5c12a9532067abf19a7"
    oauth_token: "52871f93b604e239a431de879b3c2e45082768f02d"
    oauth_version: 1.0
    oauth_signature_metho: "HMAC-SHA1"


    The yaml file should be parsed and updated (oauth_version) as below.

    name: gcp_credentials_project
    info: 1798
    project_id: acd-univer-proj-mod-pers
    consumer_key: "cfb45ac0098b723f84219e5c12a9532067abf19a7"
    oauth_token: "52871f93b604e239a431de879b3c2e45082768f02d"
    oauth_version: 2.0
    oauth_signature_metho: "HMAC-SHA1"

    Continue reading...

Compartilhe esta Página