Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
StockLlmApp
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
JetBrains YouTrack
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Matthew Antonio
StockLlmApp
Commits
4ef18cea
Commit
4ef18cea
authored
9 months ago
by
David Matthew Antonio
Browse files
Options
Downloads
Patches
Plain Diff
Stuff
parent
cd257018
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app.py
+3
-25
3 additions, 25 deletions
app.py
config.py
+1
-1
1 addition, 1 deletion
config.py
utility/data_fetcher.py
+28
-0
28 additions, 0 deletions
utility/data_fetcher.py
with
32 additions
and
26 deletions
app.py
+
3
−
25
View file @
4ef18cea
...
...
@@ -2,32 +2,10 @@ import config
import
interface
from
controllers
import
stocks
import
multiprocessing
as
mp
from
utility
import
data_fetcher
print
(
"
Acquiring exchanges
"
)
try
:
stocks
.
retrieve_exchanges
()
except
:
print
(
"
Cannot retrieve exchanges from the API
"
)
exit
()
else
:
print
(
"
Exchange list updated!
"
)
# Due to API Limits, only Philippine stocks are considered
print
(
"
Acquiring tickers
"
)
try
:
tickers
=
stocks
.
retrieve_tickers
(
"
PSE
"
)
except
:
print
(
"
Cannot retrieve tickers from the API
"
)
exit
()
else
:
print
(
"
Ticker list updated!
"
)
print
(
"
Acquiring stock data
"
)
processes
=
[
mp
.
Process
(
target
=
stocks
.
retrieve_eod_historical_data
,
args
=
(
"
PSE
"
,
i
[
"
Code
"
]))
for
i
in
tickers
]
for
p
in
processes
:
p
.
start
()
for
p
in
processes
:
p
.
join
()
if
(
config
.
FETCH_ON_RUN
):
data_fetcher
.
run
()
print
(
"
Initializing gradio app
"
)
gradio_app
=
interface
.
initialize
()
...
...
This diff is collapsed.
Click to expand it.
config.py
+
1
−
1
View file @
4ef18cea
...
...
@@ -8,7 +8,7 @@ STOCKS_DIRECTORY = 'stocks/'
EXCHANGES_FILEPATH
=
'
exchanges.json
'
# Some flags
INITIALIZE
_ON_RUN
=
True
FETCH
_ON_RUN
=
True
GRADIO_PUBLIC
=
True
LLM_MODEL
=
"
gpt-4o-mini
"
...
...
This diff is collapsed.
Click to expand it.
utility/data_fetcher.py
0 → 100644
+
28
−
0
View file @
4ef18cea
from
controllers
import
stocks
import
multiprocessing
as
mp
def
run
():
print
(
"
Acquiring exchanges
"
)
try
:
stocks
.
retrieve_exchanges
()
except
:
print
(
"
Cannot retrieve exchanges from the API
"
)
exit
()
else
:
print
(
"
Exchange list updated!
"
)
# Due to API Limits, only Philippine stocks are considered
print
(
"
Acquiring tickers
"
)
try
:
tickers
=
stocks
.
retrieve_tickers
(
"
PSE
"
)
except
:
print
(
"
Cannot retrieve tickers from the API
"
)
exit
()
else
:
print
(
"
Ticker list updated!
"
)
print
(
"
Acquiring stock data
"
)
processes
=
[
mp
.
Process
(
target
=
stocks
.
retrieve_eod_historical_data
,
args
=
(
"
PSE
"
,
i
[
"
Code
"
]))
for
i
in
tickers
]
for
p
in
processes
:
p
.
start
()
for
p
in
processes
:
p
.
join
()
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment