Giter Club home page Giter Club logo

py_vcs's Introduction

Versionar arquivos do Power BI com GIT

Esse diretório possue um compilado de todos arquivos necessários para realizar o versionamento dos arquivos do Power BI com o GIT
Repositório Original para refência - https://github.com/awaregroup/powerbi-vcs

Vídeo Demonstrativo

IMAGE ALT TEXT HERE

Configurações para esteira de Entrega Contínua do Azure Dev Ops

Vocês podem utilizar o arquivo YAML config.yml e importar no Azure Dev Ops , ou realizar os procedimentos abaixo:

Dependências

python -m pip install --upgrade pip
pip install ConfigArgParse
pip install lxml
pip install requests-toolbelt
pip install json
pip install requests

Step de compactação da esteira

cd ../
git clone https://github.com/3t1n/py_vcs.git 
ls -lia
cd py_vcs
python pbivcs.py -c /home/vsts/work/1/s f1.pbix
ls -lia

Para mais informações sobre esse arquivo acesse esse repositório : https://github.com/3t1n/build_pbi

Step de Build

# -*- coding: utf-8 -*-
"""
@author: Tadeu Mansi
"""

import requests
from requests_toolbelt import MultipartEncoder
import json

url = "https://login.microsoftonline.com/common/oauth2/token"

payload = {
'client_id': 'SEU_CLIENT_ID',
'grant_type': 'password',
'resource': 'https://analysis.windows.net/powerbi/api',
'username': 'SEU_EMAIL',
'password': 'SUA_SENHA',
'client_secret': 'SEU_CLIENT_SECRET'
}

response = requests.request("POST", url, headers={}, data = payload)

json_encode = json.loads(response.text.encode('utf8'))
accessToken = json_encode['access_token']

groupId = "ID_DO_WORKSPACE"
reportName = "NOME_DO_REPORT"

url = 'https://api.powerbi.com/v1.0/myorg/groups/' + groupId + '/imports?datasetDisplayName=' + reportName + '&nameConflict=CreateOrOverwrite'

headers = {
    'Content-Type': 'multipart/form-data',
    'authorization': 'Bearer ' + accessToken
}

file_location = 'SEUARQUIVO.pbix'

files = {'value': (None, open(file_location, 'rb'), 'multipart/form-data')}
mp_encoder = MultipartEncoder(fields=files)

r = requests.post(
    url=url,
    data=mp_encoder, 
    headers=headers
)

py_vcs's People

Contributors

3t1n avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.