Commit 698b2b03 by ajil.k

integrated with all modules

parent 0b54d002
......@@ -7,3 +7,5 @@ class EndPoints:
get_booking_details = "/get_booking_details/"
show_begin = "/show_begin"
get_booking_details_between = "/get_booking_details_between/"
booking_details_json = "/booking_details_json/"
......@@ -100,7 +100,7 @@ class Tickets:
print("-------------------------------Booking Details-------------------------------")
print(df)
# Use pandas to save the DataFrame to an Excel file
df.to_excel('temp/booking_details.xlsx', index=False)
df.to_excel('external/booking_details.xlsx', index=False)
except Exception as e:
logger.error(e)
......@@ -113,6 +113,34 @@ class Tickets:
# Use pandas to convert the list of dictionaries to a DataFrame
df = pd.DataFrame(cleaned_data_dict)
# Use pandas to save the DataFrame to an Excel file
df.to_excel(f'temp/booking_from_{from_date}_to_{to_date}_.xlsx', index=False)
df.to_excel(f'external/booking_from_{from_date}_to_{to_date}_.xlsx', index=False)
except Exception as e:
logger.error(e)
def json_data(self):
try:
records = self.session.query(BookingDetails).all()
cleaned_data_dict = clean_record(records)
# Use pandas to convert the list of dictionaries to a DataFrame
df = pd.DataFrame(cleaned_data_dict)
df["date_of_purchase"] = df["date_of_purchase"].apply(lambda x: x.strftime('%Y-%m-%d'))
# df = pd.read_excel(filename)
# Print number of rows and columns
# print("Number of rows: ", len(df))
# # Setting "header" dictionary
keys = []
column_names = df.columns.tolist()
for i in range(len(column_names)):
keys.append("column" + str(i))
header_dict = {'header': dict(zip(keys, column_names))}
# Setting 'body' dictionary
data = {"body": df.to_dict(orient='records')}
json_dict = {**header_dict, **data}
# Create the JSON file
with open("external/bookings.json", "w") as json_file:
# Write data to the file
json.dump(json_dict, json_file, indent=4)
return json_dict
except Exception as e:
logger.exception(e)
print("Data insertion error-", e)
# importing libraries
from fastapi import APIRouter
from fastapi import APIRouter, UploadFile
from scripts.constants.endpoints import EndPoints
from scripts.constants.schema import ticket_booking
from scripts.core.handlers.api_functions import Tickets
......@@ -60,3 +58,12 @@ def generate_seats():
except Exception as e:
logger.error(e)
print(e)
@router.post(EndPoints.booking_details_json, tags=["Create Json File"])
def booking_details_json_format(file: UploadFile):
try:
message = Tickets().json_data()
return message
except Exception as e:
logger.error(e)
......@@ -104,3 +104,371 @@ FROM ticket_details
WHERE ticket_details.preferred_class BETWEEN %(preferred_class_1)s AND %(preferred_class_2)s]
[parameters: {'preferred_class_1': datetime.date(2023, 2, 12), 'preferred_class_2': datetime.date(2023, 2, 14)}]
(Background on this error at: https://sqlalche.me/e/20/f405)
2023-02-15 10:42:54 - ERROR - [MainThread:check_file_field():110] - Form data requires "python-multipart" to be installed.
You can install "python-multipart" with:
pip install python-multipart
2023-02-15 10:53:31 - ERROR - [AnyIO worker thread:json_data():144] - 'SpooledTemporaryFile' object has no attribute 'seekable'
Traceback (most recent call last):
File "E:\Python\theater_management\scripts\core\handlers\api_functions.py", line 125, in json_data
dataframe = pd.read_excel(excel_file)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\util\_decorators.py", line 211, in wrapper
return func(*args, **kwargs)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\util\_decorators.py", line 331, in wrapper
return func(*args, **kwargs)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_base.py", line 482, in read_excel
io = ExcelFile(io, storage_options=storage_options, engine=engine)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_base.py", line 1695, in __init__
self._reader = self._engines[engine](self._io, storage_options=storage_options)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_openpyxl.py", line 557, in __init__
super().__init__(filepath_or_buffer, storage_options=storage_options)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_base.py", line 545, in __init__
self.book = self.load_workbook(self.handles.handle)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_openpyxl.py", line 568, in load_workbook
return load_workbook(
File "E:\Python\theater_management\venv\lib\site-packages\openpyxl\reader\excel.py", line 346, in load_workbook
reader.read()
File "E:\Python\theater_management\venv\lib\site-packages\openpyxl\reader\excel.py", line 287, in read
self.read_manifest()
File "E:\Python\theater_management\venv\lib\site-packages\openpyxl\reader\excel.py", line 134, in read_manifest
src = self.archive.read(ARC_CONTENT_TYPES)
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\zipfile.py", line 1472, in read
with self.open(name, "r", pwd) as fp:
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\zipfile.py", line 1523, in open
zef_file = _SharedFile(self.fp, zinfo.header_offset,
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\zipfile.py", line 722, in __init__
self.seekable = file.seekable
AttributeError: 'SpooledTemporaryFile' object has no attribute 'seekable'
2023-02-15 11:01:09 - ERROR - [AnyIO worker thread:json_data():145] - 'SpooledTemporaryFile' object has no attribute 'seekable'
Traceback (most recent call last):
File "E:\Python\theater_management\scripts\core\handlers\api_functions.py", line 125, in json_data
dataframe = pd.read_excel(excel_file)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\util\_decorators.py", line 211, in wrapper
return func(*args, **kwargs)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\util\_decorators.py", line 331, in wrapper
return func(*args, **kwargs)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_base.py", line 482, in read_excel
io = ExcelFile(io, storage_options=storage_options, engine=engine)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_base.py", line 1695, in __init__
self._reader = self._engines[engine](self._io, storage_options=storage_options)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_openpyxl.py", line 557, in __init__
super().__init__(filepath_or_buffer, storage_options=storage_options)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_base.py", line 545, in __init__
self.book = self.load_workbook(self.handles.handle)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_openpyxl.py", line 568, in load_workbook
return load_workbook(
File "E:\Python\theater_management\venv\lib\site-packages\openpyxl\reader\excel.py", line 346, in load_workbook
reader.read()
File "E:\Python\theater_management\venv\lib\site-packages\openpyxl\reader\excel.py", line 287, in read
self.read_manifest()
File "E:\Python\theater_management\venv\lib\site-packages\openpyxl\reader\excel.py", line 134, in read_manifest
src = self.archive.read(ARC_CONTENT_TYPES)
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\zipfile.py", line 1472, in read
with self.open(name, "r", pwd) as fp:
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\zipfile.py", line 1523, in open
zef_file = _SharedFile(self.fp, zinfo.header_offset,
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\zipfile.py", line 722, in __init__
self.seekable = file.seekable
AttributeError: 'SpooledTemporaryFile' object has no attribute 'seekable'
2023-02-15 11:02:05 - ERROR - [AnyIO worker thread:json_data():140] - 'SpooledTemporaryFile' object has no attribute 'seekable'
Traceback (most recent call last):
File "E:\Python\theater_management\scripts\core\handlers\api_functions.py", line 125, in json_data
dataframe = pd.read_excel(excel_file)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\util\_decorators.py", line 211, in wrapper
return func(*args, **kwargs)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\util\_decorators.py", line 331, in wrapper
return func(*args, **kwargs)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_base.py", line 482, in read_excel
io = ExcelFile(io, storage_options=storage_options, engine=engine)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_base.py", line 1695, in __init__
self._reader = self._engines[engine](self._io, storage_options=storage_options)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_openpyxl.py", line 557, in __init__
super().__init__(filepath_or_buffer, storage_options=storage_options)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_base.py", line 545, in __init__
self.book = self.load_workbook(self.handles.handle)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_openpyxl.py", line 568, in load_workbook
return load_workbook(
File "E:\Python\theater_management\venv\lib\site-packages\openpyxl\reader\excel.py", line 346, in load_workbook
reader.read()
File "E:\Python\theater_management\venv\lib\site-packages\openpyxl\reader\excel.py", line 287, in read
self.read_manifest()
File "E:\Python\theater_management\venv\lib\site-packages\openpyxl\reader\excel.py", line 134, in read_manifest
src = self.archive.read(ARC_CONTENT_TYPES)
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\zipfile.py", line 1472, in read
with self.open(name, "r", pwd) as fp:
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\zipfile.py", line 1523, in open
zef_file = _SharedFile(self.fp, zinfo.header_offset,
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\zipfile.py", line 722, in __init__
self.seekable = file.seekable
AttributeError: 'SpooledTemporaryFile' object has no attribute 'seekable'
2023-02-15 11:14:06 - ERROR - [AnyIO worker thread:json_data():141] - 'SpooledTemporaryFile' object has no attribute 'seekable'
Traceback (most recent call last):
File "E:\Python\theater_management\scripts\core\handlers\api_functions.py", line 126, in json_data
dataframe = pd.read_excel(excel_file)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\util\_decorators.py", line 211, in wrapper
return func(*args, **kwargs)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\util\_decorators.py", line 331, in wrapper
return func(*args, **kwargs)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_base.py", line 482, in read_excel
io = ExcelFile(io, storage_options=storage_options, engine=engine)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_base.py", line 1695, in __init__
self._reader = self._engines[engine](self._io, storage_options=storage_options)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_openpyxl.py", line 557, in __init__
super().__init__(filepath_or_buffer, storage_options=storage_options)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_base.py", line 545, in __init__
self.book = self.load_workbook(self.handles.handle)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_openpyxl.py", line 568, in load_workbook
return load_workbook(
File "E:\Python\theater_management\venv\lib\site-packages\openpyxl\reader\excel.py", line 346, in load_workbook
reader.read()
File "E:\Python\theater_management\venv\lib\site-packages\openpyxl\reader\excel.py", line 287, in read
self.read_manifest()
File "E:\Python\theater_management\venv\lib\site-packages\openpyxl\reader\excel.py", line 134, in read_manifest
src = self.archive.read(ARC_CONTENT_TYPES)
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\zipfile.py", line 1472, in read
with self.open(name, "r", pwd) as fp:
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\zipfile.py", line 1523, in open
zef_file = _SharedFile(self.fp, zinfo.header_offset,
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\zipfile.py", line 722, in __init__
self.seekable = file.seekable
AttributeError: 'SpooledTemporaryFile' object has no attribute 'seekable'
2023-02-15 11:20:06 - ERROR - [AnyIO worker thread:json_data():141] - 'SpooledTemporaryFile' object has no attribute 'seekable'
Traceback (most recent call last):
File "E:\Python\theater_management\scripts\core\handlers\api_functions.py", line 126, in json_data
dataframe = pd.read_excel(excel_file)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\util\_decorators.py", line 211, in wrapper
return func(*args, **kwargs)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\util\_decorators.py", line 331, in wrapper
return func(*args, **kwargs)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_base.py", line 482, in read_excel
io = ExcelFile(io, storage_options=storage_options, engine=engine)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_base.py", line 1695, in __init__
self._reader = self._engines[engine](self._io, storage_options=storage_options)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_openpyxl.py", line 557, in __init__
super().__init__(filepath_or_buffer, storage_options=storage_options)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_base.py", line 545, in __init__
self.book = self.load_workbook(self.handles.handle)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_openpyxl.py", line 568, in load_workbook
return load_workbook(
File "E:\Python\theater_management\venv\lib\site-packages\openpyxl\reader\excel.py", line 346, in load_workbook
reader.read()
File "E:\Python\theater_management\venv\lib\site-packages\openpyxl\reader\excel.py", line 287, in read
self.read_manifest()
File "E:\Python\theater_management\venv\lib\site-packages\openpyxl\reader\excel.py", line 134, in read_manifest
src = self.archive.read(ARC_CONTENT_TYPES)
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\zipfile.py", line 1472, in read
with self.open(name, "r", pwd) as fp:
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\zipfile.py", line 1523, in open
zef_file = _SharedFile(self.fp, zinfo.header_offset,
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\zipfile.py", line 722, in __init__
self.seekable = file.seekable
AttributeError: 'SpooledTemporaryFile' object has no attribute 'seekable'
2023-02-15 11:23:04 - ERROR - [AnyIO worker thread:json_data():141] - 'SpooledTemporaryFile' object has no attribute 'seekable'
Traceback (most recent call last):
File "E:\Python\theater_management\scripts\core\handlers\api_functions.py", line 126, in json_data
dataframe = pd.read_excel(excel_file)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\util\_decorators.py", line 211, in wrapper
return func(*args, **kwargs)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\util\_decorators.py", line 331, in wrapper
return func(*args, **kwargs)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_base.py", line 482, in read_excel
io = ExcelFile(io, storage_options=storage_options, engine=engine)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_base.py", line 1695, in __init__
self._reader = self._engines[engine](self._io, storage_options=storage_options)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_openpyxl.py", line 557, in __init__
super().__init__(filepath_or_buffer, storage_options=storage_options)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_base.py", line 545, in __init__
self.book = self.load_workbook(self.handles.handle)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_openpyxl.py", line 568, in load_workbook
return load_workbook(
File "E:\Python\theater_management\venv\lib\site-packages\openpyxl\reader\excel.py", line 346, in load_workbook
reader.read()
File "E:\Python\theater_management\venv\lib\site-packages\openpyxl\reader\excel.py", line 287, in read
self.read_manifest()
File "E:\Python\theater_management\venv\lib\site-packages\openpyxl\reader\excel.py", line 134, in read_manifest
src = self.archive.read(ARC_CONTENT_TYPES)
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\zipfile.py", line 1472, in read
with self.open(name, "r", pwd) as fp:
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\zipfile.py", line 1523, in open
zef_file = _SharedFile(self.fp, zinfo.header_offset,
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\zipfile.py", line 722, in __init__
self.seekable = file.seekable
AttributeError: 'SpooledTemporaryFile' object has no attribute 'seekable'
2023-02-15 11:25:29 - ERROR - [AnyIO worker thread:json_data():141] - 'SpooledTemporaryFile' object has no attribute 'seekable'
Traceback (most recent call last):
File "E:\Python\theater_management\scripts\core\handlers\api_functions.py", line 125, in json_data
df = pd.read_excel(excel_file)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\util\_decorators.py", line 211, in wrapper
return func(*args, **kwargs)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\util\_decorators.py", line 331, in wrapper
return func(*args, **kwargs)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_base.py", line 482, in read_excel
io = ExcelFile(io, storage_options=storage_options, engine=engine)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_base.py", line 1695, in __init__
self._reader = self._engines[engine](self._io, storage_options=storage_options)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_openpyxl.py", line 557, in __init__
super().__init__(filepath_or_buffer, storage_options=storage_options)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_base.py", line 545, in __init__
self.book = self.load_workbook(self.handles.handle)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_openpyxl.py", line 568, in load_workbook
return load_workbook(
File "E:\Python\theater_management\venv\lib\site-packages\openpyxl\reader\excel.py", line 346, in load_workbook
reader.read()
File "E:\Python\theater_management\venv\lib\site-packages\openpyxl\reader\excel.py", line 287, in read
self.read_manifest()
File "E:\Python\theater_management\venv\lib\site-packages\openpyxl\reader\excel.py", line 134, in read_manifest
src = self.archive.read(ARC_CONTENT_TYPES)
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\zipfile.py", line 1472, in read
with self.open(name, "r", pwd) as fp:
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\zipfile.py", line 1523, in open
zef_file = _SharedFile(self.fp, zinfo.header_offset,
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\zipfile.py", line 722, in __init__
self.seekable = file.seekable
AttributeError: 'SpooledTemporaryFile' object has no attribute 'seekable'
2023-02-15 11:41:55 - ERROR - [AnyIO worker thread:json_data():141] - 'SpooledTemporaryFile' object has no attribute 'seekable'
Traceback (most recent call last):
File "E:\Python\theater_management\scripts\core\handlers\api_functions.py", line 125, in json_data
df = pd.read_excel(excel_file)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\util\_decorators.py", line 211, in wrapper
return func(*args, **kwargs)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\util\_decorators.py", line 331, in wrapper
return func(*args, **kwargs)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_base.py", line 482, in read_excel
io = ExcelFile(io, storage_options=storage_options, engine=engine)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_base.py", line 1695, in __init__
self._reader = self._engines[engine](self._io, storage_options=storage_options)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_openpyxl.py", line 557, in __init__
super().__init__(filepath_or_buffer, storage_options=storage_options)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_base.py", line 545, in __init__
self.book = self.load_workbook(self.handles.handle)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_openpyxl.py", line 568, in load_workbook
return load_workbook(
File "E:\Python\theater_management\venv\lib\site-packages\openpyxl\reader\excel.py", line 346, in load_workbook
reader.read()
File "E:\Python\theater_management\venv\lib\site-packages\openpyxl\reader\excel.py", line 287, in read
self.read_manifest()
File "E:\Python\theater_management\venv\lib\site-packages\openpyxl\reader\excel.py", line 134, in read_manifest
src = self.archive.read(ARC_CONTENT_TYPES)
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\zipfile.py", line 1472, in read
with self.open(name, "r", pwd) as fp:
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\zipfile.py", line 1523, in open
zef_file = _SharedFile(self.fp, zinfo.header_offset,
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\zipfile.py", line 722, in __init__
self.seekable = file.seekable
AttributeError: 'SpooledTemporaryFile' object has no attribute 'seekable'
2023-02-15 11:48:24 - ERROR - [AnyIO worker thread:json_data():141] - 'SpooledTemporaryFile' object has no attribute 'seekable'
Traceback (most recent call last):
File "E:\Python\theater_management\scripts\core\handlers\api_functions.py", line 125, in json_data
df = pd.read_excel(excel_file)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\util\_decorators.py", line 211, in wrapper
return func(*args, **kwargs)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\util\_decorators.py", line 331, in wrapper
return func(*args, **kwargs)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_base.py", line 482, in read_excel
io = ExcelFile(io, storage_options=storage_options, engine=engine)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_base.py", line 1695, in __init__
self._reader = self._engines[engine](self._io, storage_options=storage_options)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_openpyxl.py", line 557, in __init__
super().__init__(filepath_or_buffer, storage_options=storage_options)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_base.py", line 545, in __init__
self.book = self.load_workbook(self.handles.handle)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_openpyxl.py", line 568, in load_workbook
return load_workbook(
File "E:\Python\theater_management\venv\lib\site-packages\openpyxl\reader\excel.py", line 346, in load_workbook
reader.read()
File "E:\Python\theater_management\venv\lib\site-packages\openpyxl\reader\excel.py", line 287, in read
self.read_manifest()
File "E:\Python\theater_management\venv\lib\site-packages\openpyxl\reader\excel.py", line 134, in read_manifest
src = self.archive.read(ARC_CONTENT_TYPES)
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\zipfile.py", line 1472, in read
with self.open(name, "r", pwd) as fp:
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\zipfile.py", line 1523, in open
zef_file = _SharedFile(self.fp, zinfo.header_offset,
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\zipfile.py", line 722, in __init__
self.seekable = file.seekable
AttributeError: 'SpooledTemporaryFile' object has no attribute 'seekable'
2023-02-15 11:49:28 - ERROR - [AnyIO worker thread:json_data():141] - 'SpooledTemporaryFile' object has no attribute 'seekable'
Traceback (most recent call last):
File "E:\Python\theater_management\scripts\core\handlers\api_functions.py", line 125, in json_data
df = pd.read_excel(excel_file)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\util\_decorators.py", line 211, in wrapper
return func(*args, **kwargs)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\util\_decorators.py", line 331, in wrapper
return func(*args, **kwargs)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_base.py", line 482, in read_excel
io = ExcelFile(io, storage_options=storage_options, engine=engine)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_base.py", line 1695, in __init__
self._reader = self._engines[engine](self._io, storage_options=storage_options)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_openpyxl.py", line 557, in __init__
super().__init__(filepath_or_buffer, storage_options=storage_options)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_base.py", line 545, in __init__
self.book = self.load_workbook(self.handles.handle)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_openpyxl.py", line 568, in load_workbook
return load_workbook(
File "E:\Python\theater_management\venv\lib\site-packages\openpyxl\reader\excel.py", line 346, in load_workbook
reader.read()
File "E:\Python\theater_management\venv\lib\site-packages\openpyxl\reader\excel.py", line 287, in read
self.read_manifest()
File "E:\Python\theater_management\venv\lib\site-packages\openpyxl\reader\excel.py", line 134, in read_manifest
src = self.archive.read(ARC_CONTENT_TYPES)
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\zipfile.py", line 1472, in read
with self.open(name, "r", pwd) as fp:
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\zipfile.py", line 1523, in open
zef_file = _SharedFile(self.fp, zinfo.header_offset,
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\zipfile.py", line 722, in __init__
self.seekable = file.seekable
AttributeError: 'SpooledTemporaryFile' object has no attribute 'seekable'
2023-02-15 11:57:31 - ERROR - [AnyIO worker thread:json_data():140] -
Traceback (most recent call last):
File "E:\Python\theater_management\scripts\core\handlers\api_functions.py", line 124, in json_data
df = pd.read_excel(filename)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\util\_decorators.py", line 211, in wrapper
return func(*args, **kwargs)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\util\_decorators.py", line 331, in wrapper
return func(*args, **kwargs)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_base.py", line 482, in read_excel
io = ExcelFile(io, storage_options=storage_options, engine=engine)
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_base.py", line 1652, in __init__
ext = inspect_excel_format(
File "E:\Python\theater_management\venv\lib\site-packages\pandas\io\excel\_base.py", line 1534, in inspect_excel_format
assert isinstance(buf, bytes)
AssertionError
2023-02-15 12:21:37 - ERROR - [AnyIO worker thread:json_data():144] - Object of type date is not JSON serializable
Traceback (most recent call last):
File "E:\Python\theater_management\scripts\core\handlers\api_functions.py", line 141, in json_data
json.dump(json_dict, json_file, indent=4)
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\json\__init__.py", line 179, in dump
for chunk in iterable:
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\json\encoder.py", line 431, in _iterencode
yield from _iterencode_dict(o, _current_indent_level)
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\json\encoder.py", line 405, in _iterencode_dict
yield from chunks
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\json\encoder.py", line 325, in _iterencode_list
yield from chunks
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\json\encoder.py", line 405, in _iterencode_dict
yield from chunks
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\json\encoder.py", line 438, in _iterencode
o = _default(o)
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\json\encoder.py", line 179, in default
raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type date is not JSON serializable
2023-02-15 12:31:46 - ERROR - [AnyIO worker thread:json_data():145] - Object of type Timestamp is not JSON serializable
Traceback (most recent call last):
File "E:\Python\theater_management\scripts\core\handlers\api_functions.py", line 142, in json_data
json.dump(json_dict, json_file, indent=4)
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\json\__init__.py", line 179, in dump
for chunk in iterable:
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\json\encoder.py", line 431, in _iterencode
yield from _iterencode_dict(o, _current_indent_level)
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\json\encoder.py", line 405, in _iterencode_dict
yield from chunks
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\json\encoder.py", line 325, in _iterencode_list
yield from chunks
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\json\encoder.py", line 405, in _iterencode_dict
yield from chunks
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\json\encoder.py", line 438, in _iterencode
o = _default(o)
File "C:\Users\ajil.k\AppData\Local\Programs\Python\Python39\lib\json\encoder.py", line 179, in default
raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type Timestamp is not JSON serializable
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment