Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mongo_aggregate
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
mongo_aggregate
Commits
63ea265c
Commit
63ea265c
authored
Feb 07, 2023
by
ajil.k
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updateded
parent
1540973e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
5 deletions
+11
-5
conf/application.conf
+5
-2
scripts/constants/application_config.py
+3
-0
scripts/constants/read_file.py
+3
-1
scripts/core/handlers/api_functions.py
+0
-1
scripts/services/api_call.py
+0
-1
No files found.
conf/application.conf
View file @
63ea265c
...
...
@@ -3,4 +3,7 @@ mongo_uri = mongodb://localhost:27017/
[
FastAPI
]
port
=
5000
\ No newline at end of file
port
=
5000
[
Excel_file
]
xlsx_path
=
temp
/
mongodb_data
.
xlsx
\ No newline at end of file
scripts/constants/application_config.py
View file @
63ea265c
...
...
@@ -10,3 +10,6 @@ uri = config.get("MongoDB", "mongo_uri")
# FastAPI Port
port_no
=
config
.
get
(
"FastAPI"
,
"port"
)
# Excel file path
xlsx_path
=
config
.
get
(
"Excel_file"
,
"xlsx_path"
)
scripts/constants/read_file.py
View file @
63ea265c
import
pandas
as
pd
from
scripts.constants.application_config
import
xlsx_path
def
read_excel_file
():
excel_data
=
pd
.
read_excel
(
"temp/mongodb_data.xlsx"
)
# Read data from Excel file
excel_data
=
pd
.
read_excel
(
xlsx_path
)
print
(
"Data Stored on excel file:
\n
"
,
excel_data
)
scripts/core/handlers/api_functions.py
View file @
63ea265c
...
...
@@ -124,7 +124,6 @@ class operations_on_api:
ws
.
cell
(
row
=
i
+
2
,
column
=
j
+
1
,
value
=
record
[
key
])
# Save the Excel Workbook
wb
.
save
(
"temp/mongodb_data.xlsx"
)
except
Exception
as
e
:
print
(
"Generating Excel file error-"
,
e
)
scripts/services/api_call.py
View file @
63ea265c
# Importing Libraries
from
fastapi
import
FastAPI
,
UploadFile
from
scripts.constants.endpoints
import
APIEndpoints
from
scripts.constants.read_file
import
read_excel_file
from
scripts.core.handlers.api_functions
import
operations_on_api
...
...
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