Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
ticket_booking_task
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ajil.k
ticket_booking_task
Commits
698b2b03
Commit
698b2b03
authored
Feb 15, 2023
by
ajil.k
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
integrated with all modules
parent
0b54d002
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
410 additions
and
5 deletions
+410
-5
external/booking_details.xlsx
+0
-0
external/booking_from_2023-02-12_to_2023-02-13_.xlsx
+0
-0
external/booking_from_2023-02-13_to_2023-02-14_.xlsx
+0
-0
scripts/constants/endpoints.py
+2
-0
scripts/core/handlers/api_functions.py
+30
-2
scripts/services/api_call.py
+10
-3
temp/_ERROR.log
+368
-0
temp/booking_details.xlsx
+0
-0
No files found.
external/booking_details.xlsx
0 → 100644
View file @
698b2b03
File added
temp
/booking_from_2023-02-12_to_2023-02-13_.xlsx
→
external
/booking_from_2023-02-12_to_2023-02-13_.xlsx
View file @
698b2b03
File moved
temp
/booking_from_2023-02-13_to_2023-02-14_.xlsx
→
external
/booking_from_2023-02-13_to_2023-02-14_.xlsx
View file @
698b2b03
File moved
scripts/constants/endpoints.py
View file @
698b2b03
...
@@ -7,3 +7,5 @@ class EndPoints:
...
@@ -7,3 +7,5 @@ class EndPoints:
get_booking_details
=
"/get_booking_details/"
get_booking_details
=
"/get_booking_details/"
show_begin
=
"/show_begin"
show_begin
=
"/show_begin"
get_booking_details_between
=
"/get_booking_details_between/"
get_booking_details_between
=
"/get_booking_details_between/"
booking_details_json
=
"/booking_details_json/"
scripts/core/handlers/api_functions.py
View file @
698b2b03
...
@@ -100,7 +100,7 @@ class Tickets:
...
@@ -100,7 +100,7 @@ class Tickets:
print
(
"-------------------------------Booking Details-------------------------------"
)
print
(
"-------------------------------Booking Details-------------------------------"
)
print
(
df
)
print
(
df
)
# Use pandas to save the DataFrame to an Excel file
# 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
:
except
Exception
as
e
:
logger
.
error
(
e
)
logger
.
error
(
e
)
...
@@ -113,6 +113,34 @@ class Tickets:
...
@@ -113,6 +113,34 @@ class Tickets:
# Use pandas to convert the list of dictionaries to a DataFrame
# Use pandas to convert the list of dictionaries to a DataFrame
df
=
pd
.
DataFrame
(
cleaned_data_dict
)
df
=
pd
.
DataFrame
(
cleaned_data_dict
)
# Use pandas to save the DataFrame to an Excel file
# 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
:
except
Exception
as
e
:
logger
.
error
(
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
)
scripts/services/api_call.py
View file @
698b2b03
# importing libraries
# importing libraries
from
fastapi
import
APIRouter
,
UploadFile
from
fastapi
import
APIRouter
from
scripts.constants.endpoints
import
EndPoints
from
scripts.constants.endpoints
import
EndPoints
from
scripts.constants.schema
import
ticket_booking
from
scripts.constants.schema
import
ticket_booking
from
scripts.core.handlers.api_functions
import
Tickets
from
scripts.core.handlers.api_functions
import
Tickets
...
@@ -60,3 +58,12 @@ def generate_seats():
...
@@ -60,3 +58,12 @@ def generate_seats():
except
Exception
as
e
:
except
Exception
as
e
:
logger
.
error
(
e
)
logger
.
error
(
e
)
print
(
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
)
temp/_ERROR.log
View file @
698b2b03
...
@@ -104,3 +104,371 @@ FROM ticket_details
...
@@ -104,3 +104,371 @@ FROM ticket_details
WHERE ticket_details.preferred_class BETWEEN %(preferred_class_1)s AND %(preferred_class_2)s]
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)}]
[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)
(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
temp/booking_details.xlsx
deleted
100644 → 0
View file @
0b54d002
File deleted
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment