Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
task8-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
mohammed.shibili
task8-aggregate
Commits
1265e9eb
Commit
1265e9eb
authored
Feb 06, 2023
by
mohammed.shibili
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
corrections done
parent
3a694a1d
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
2 deletions
+9
-2
.idea/sonarlint/issuestore/index.pb
+5
-0
scripts/core/handlers/api_function.py
+1
-0
scripts/service/ApiCalls.py
+3
-2
temp/data.xlsx
+0
-0
No files found.
.idea/sonarlint/issuestore/index.pb
View file @
1265e9eb
No preview for this file type
scripts/core/handlers/api_function.py
View file @
1265e9eb
...
...
@@ -38,6 +38,7 @@ class OperationsOnApi:
values
=
list
(
self
.
collection_name
.
aggregate
(
self
.
data_to_exel
))
dataframe
=
pd
.
DataFrame
(
values
)
dataframe
.
to_excel
(
Endpoints
()
.
folder
+
Endpoints
()
.
exel_file
)
# download file
return
f
'data inserted to path {Endpoints().folder}{Endpoints().exel_file}'
except
Exception
as
e
:
return
"exel conversion failed"
,
e
scripts/service/ApiCalls.py
View file @
1265e9eb
from
fastapi
import
APIRouter
,
UploadFile
from
fastapi
import
APIRouter
,
UploadFile
,
Response
from
scripts.core.handlers.api_function
import
OperationsOnApi
from
scripts.constants.const
import
Endpoints
...
...
@@ -31,4 +31,5 @@ async def get_no_violation():
@files.get
(
Endpoints
()
.
get_to_exel
,
tags
=
[
'Aggregation'
])
async
def
convert_exel
():
print
(
OperationsOnApi
()
.
create_exel_file
())
return
"exel file created"
return
Response
(
content
=
open
(
Endpoints
()
.
folder
+
Endpoints
()
.
exel_file
,
"rb"
)
.
read
(),
media_type
=
"application/msexcel"
)
temp/data.xlsx
View file @
1265e9eb
No preview for this file type
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