testing
This commit is contained in:
parent
545668421b
commit
1637ab6d82
2 changed files with 11 additions and 41 deletions
BIN
instance/site.db
BIN
instance/site.db
Binary file not shown.
|
|
@ -1,7 +1,7 @@
|
||||||
import datetime
|
import datetime
|
||||||
import openpyxl
|
import openpyxl
|
||||||
import time
|
import time
|
||||||
from sqlalchemy import create_engine, MetaData, Table, select
|
from sqlalchemy import create_engine, MetaData, Table, select, distinct, extract
|
||||||
import os
|
import os
|
||||||
|
|
||||||
def engineer():
|
def engineer():
|
||||||
|
|
@ -25,46 +25,16 @@ def playground():
|
||||||
vendor_table = Table("vendor", metadata_obj, autoload_with=engine)
|
vendor_table = Table("vendor", metadata_obj, autoload_with=engine)
|
||||||
|
|
||||||
with engine.connect() as conn:
|
with engine.connect() as conn:
|
||||||
lis = conn.execute(select(line_item_table))
|
|
||||||
|
|
||||||
# xl = openpyxl.load_workbook('C:/Users/Lenovo/Desktop/BudgetingApp/app/static/uploadable/Bulk_Line_Item_Upload.xlsx',read_only=True)
|
x = conn.execute(select(line_item_table.c.date)).all()
|
||||||
# wb = xl.worksheets[0]
|
print(x)
|
||||||
# items_to_add = []
|
# lis = [datetime.datetime.fromtimestamp(s) for s in conn.execute(select(distinct(line_item_table.c.date))).scalars().all()]
|
||||||
# for line, row in enumerate(wb.rows):
|
# month_year = {(s.month, s.year) for s in lis}
|
||||||
# row = [x.value for x in row]
|
|
||||||
# if line == 0:
|
|
||||||
# columns = {x: i for i,x in enumerate(row)}
|
|
||||||
# continue
|
|
||||||
# if row[columns['Charge']]:
|
|
||||||
# amount=row[columns['Charge']] * -1
|
|
||||||
# else:
|
|
||||||
# amount=row[columns['Deposit']]
|
|
||||||
# date = row[0]
|
|
||||||
# date = time.mktime(date.timetuple())
|
|
||||||
# line_item = {
|
|
||||||
# 'parent_line_item_id':None,
|
|
||||||
# 'amount':amount,
|
|
||||||
# 'currency_type':'shekel',
|
|
||||||
# 'vendor_id':None,
|
|
||||||
# 'date':date,
|
|
||||||
# 'confirmation_code':row[columns['Confirmation Code']],
|
|
||||||
# 'note':row[columns['Note']]
|
|
||||||
# }
|
|
||||||
# items_to_add.append(line_item)
|
|
||||||
# print(len(items_to_add))
|
|
||||||
# print(items_to_add[51])
|
|
||||||
|
|
||||||
# month = datetime.datetime.now().date().month
|
# month_year = [datetime.datetime(year=x[1], month=x[0], day=1) for x in month_year]
|
||||||
# year = datetime.datetime.now().date().year
|
# month_year.sort()
|
||||||
# print(month)
|
# return [x.strftime("%b %Y") for x in month_year]
|
||||||
# print(year)
|
|
||||||
# print(type(month))
|
|
||||||
# print(type(year))
|
|
||||||
# print(datetime.datetime.now(datetime.timezone.utc).timestamp())
|
|
||||||
|
|
||||||
# today = datetime.datetime.today().date()
|
|
||||||
# today = time.mktime(today.timetuple())
|
|
||||||
# print(today)
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
playground()
|
# print(playground())
|
||||||
|
print(datetime.datetime.strptime('Aug', "%b").month)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue