Page 1 of 1

How to send the python DataFrame output to MS teams in Table format.

Posted: Tue Sep 29, 2020 5:42 am
by Nagesh Pindi
Hi Team,
How to send the python DataFrame output to MS teams in Table format. Please help me on this.

import pymsteams
import pandas as pd
import numpy as np
import pyodbc
from tabulate import tabulate

server = ‘ServerName’
database = ‘DBName’
username = ‘username’
password = ‘pasword’
conn = pyodbc.connect(‘DRIVER={ODBC Driver 17 for SQL Server};SERVER=’+server+’;DATABASE=’+database+’;UID=’+username+’;PWD=’+ password)

cursor = conn.cursor()

sql_query = “select * from bookingStatusEnum”

df = pd.read_sql(sql_query, conn)

DataFrame Output: