Submit + RestAPI Client

Good Day

I have the following coding:

import fdb
from frappeclient import FrappeClient

client = FrappeClient(“http://192.168.29.6”, “username”, “password”)

con = fdb.connect(host=‘192.168.29.1’, database=‘C:\Program Files\Time Manager Platinum\Data\TIMEMANAGERPLATINUM.GDB’, user=‘sysdba’, password=‘masterkey’)

cur = con.cursor()

cur.execute("SELECT EMPNO,DATETIME,STATUS FROM CLOCKD WHERE DATETIME BETWEEN ‘09/01/2017 00:00:00’ AND ‘09/14/2017 00:00:00’ ")

for row in cur:
if row[2] == 0:
print (row[0] + “-” + str(row[1].date()) + “-Present”)
doc = {“doctype”: “Attendance”,
“employee”: row[0],
“status”: “Present”,
“attendance_date”: str(row[1].date())}

             record = client.get_doc(doc)
             record.insert()
             record.submit()

   elif row[2] == 1:
      	print (row[0] + "-" + str(row[1].date()) + "-Absent")
            doc = {"doctype": "Attendance",
   			       "employee": row[0],
   			       "status": "Absent",
                           "attendance_date": str(row[1].date())}

        record = client.get_doc(doc)
            record.insert()
            record.submit()

         
   elif row[2] == 2:
      	print (row[0] + "-" + str(row[1].date()) + "-Not Compulsary")

How can i submit records as code above was what i tried, but failed.

Thank You

Albertus Geyser