Hi i want to fetch tally erp data for profit and loss using collection and i am having hard time to get the method to write collection for the same as it does not have anything available of Profit and loss account. can any one help me with the same.
import pyodbc
import pandas as pd
conn = pyodbc.connect('DSN=TallyODBC64_9000;SERVER=({local});DRIVER=Tally ODBC Driver64;PORT=9000')
cursor=conn.cursor()
Company = cursor.execute("SELECT $Name, $Address, $Website,
$GUID, $EMail, $StateName, $PINCode, $PhoneNumber,
$ShowBankDetails FROM Company")
columns = [column[0] for column in Company.description]
actual_cols=[s.strip('$') for s in columns]
rows = Company.fetchall()
df = pd.DataFrame.from_records(rows)
df.columns=actual_cols
pd.DataFrame.from_records(rows)
columns=actual_cols
df.to_csv("D:\\Company.csv", index=False)