huggingface112 commited on
Commit
588011f
β€’
1 Parent(s): 495c7e3

reconfig db path

Browse files
.gitignore ADDED
@@ -0,0 +1,259 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # File created using '.gitignore Generator' for Visual Studio Code: https://bit.ly/vscode-gig
2
+ # Created by https://www.toptal.com/developers/gitignore/api/visualstudiocode,macos,python,pythonvanilla
3
+ # Edit at https://www.toptal.com/developers/gitignore?templates=visualstudiocode,macos,python,pythonvanilla
4
+
5
+ ### macOS ###
6
+ # General
7
+ .DS_Store
8
+ .AppleDouble
9
+ .LSOverride
10
+
11
+ # Icon must end with two \r
12
+ Icon
13
+
14
+
15
+ # Thumbnails
16
+ ._*
17
+
18
+ # Files that might appear in the root of a volume
19
+ .DocumentRevisions-V100
20
+ .fseventsd
21
+ .Spotlight-V100
22
+ .TemporaryItems
23
+ .Trashes
24
+ .VolumeIcon.icns
25
+ .com.apple.timemachine.donotpresent
26
+
27
+ # Directories potentially created on remote AFP share
28
+ .AppleDB
29
+ .AppleDesktop
30
+ Network Trash Folder
31
+ Temporary Items
32
+ .apdisk
33
+
34
+ ### macOS Patch ###
35
+ # iCloud generated files
36
+ *.icloud
37
+
38
+ ### Python ###
39
+ # Byte-compiled / optimized / DLL files
40
+ __pycache__/
41
+ *.py[cod]
42
+ *$py.class
43
+
44
+ # C extensions
45
+ *.so
46
+
47
+ # Distribution / packaging
48
+ .Python
49
+ build/
50
+ develop-eggs/
51
+ dist/
52
+ downloads/
53
+ eggs/
54
+ .eggs/
55
+ lib/
56
+ lib64/
57
+ parts/
58
+ sdist/
59
+ var/
60
+ wheels/
61
+ share/python-wheels/
62
+ *.egg-info/
63
+ .installed.cfg
64
+ *.egg
65
+ MANIFEST
66
+
67
+ # PyInstaller
68
+ # Usually these files are written by a python script from a template
69
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
70
+ *.manifest
71
+ *.spec
72
+
73
+ # Installer logs
74
+ pip-log.txt
75
+ pip-delete-this-directory.txt
76
+
77
+ # Unit test / coverage reports
78
+ htmlcov/
79
+ .tox/
80
+ .nox/
81
+ .coverage
82
+ .coverage.*
83
+ .cache
84
+ nosetests.xml
85
+ coverage.xml
86
+ *.cover
87
+ *.py,cover
88
+ .hypothesis/
89
+ .pytest_cache/
90
+ cover/
91
+
92
+ # Translations
93
+ *.mo
94
+ *.pot
95
+
96
+ # Django stuff:
97
+ *.log
98
+ local_settings.py
99
+ db.sqlite3
100
+ db.sqlite3-journal
101
+
102
+ # Flask stuff:
103
+ # instance/
104
+ .webassets-cache
105
+
106
+ # Scrapy stuff:
107
+ .scrapy
108
+
109
+ # Sphinx documentation
110
+ docs/_build/
111
+
112
+ # PyBuilder
113
+ .pybuilder/
114
+ target/
115
+
116
+ # Jupyter Notebook
117
+ .ipynb_checkpoints
118
+
119
+ # IPython
120
+ profile_default/
121
+ ipython_config.py
122
+
123
+ # pyenv
124
+ # For a library or package, you might want to ignore these files since the code is
125
+ # intended to run in multiple environments; otherwise, check them in:
126
+ # .python-version
127
+
128
+ # pipenv
129
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
130
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
131
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
132
+ # install all needed dependencies.
133
+ #Pipfile.lock
134
+
135
+ # poetry
136
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
137
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
138
+ # commonly ignored for libraries.
139
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
140
+ #poetry.lock
141
+
142
+ # pdm
143
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
144
+ #pdm.lock
145
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
146
+ # in version control.
147
+ # https://pdm.fming.dev/#use-with-ide
148
+ .pdm.toml
149
+
150
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
151
+ __pypackages__/
152
+
153
+ # Celery stuff
154
+ celerybeat-schedule
155
+ celerybeat.pid
156
+
157
+ # SageMath parsed files
158
+ *.sage.py
159
+
160
+ # Environments
161
+ .env
162
+ .venv
163
+ env/
164
+ venv/
165
+ ENV/
166
+ env.bak/
167
+ venv.bak/
168
+
169
+ # Spyder project settings
170
+ .spyderproject
171
+ .spyproject
172
+
173
+ # Rope project settings
174
+ .ropeproject
175
+
176
+ # mkdocs documentation
177
+ /site
178
+
179
+ # mypy
180
+ .mypy_cache/
181
+ .dmypy.json
182
+ dmypy.json
183
+
184
+ # Pyre type checker
185
+ .pyre/
186
+
187
+ # pytype static type analyzer
188
+ .pytype/
189
+
190
+ # Cython debug symbols
191
+ cython_debug/
192
+
193
+ # PyCharm
194
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
195
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
196
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
197
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
198
+ #.idea/
199
+
200
+ ### Python Patch ###
201
+ # Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
202
+ poetry.toml
203
+
204
+ # ruff
205
+ .ruff_cache/
206
+
207
+ # LSP config files
208
+ pyrightconfig.json
209
+
210
+ ### PythonVanilla ###
211
+ # Byte-compiled / optimized / DLL files
212
+
213
+ # C extensions
214
+
215
+ # Distribution / packaging
216
+
217
+ # Installer logs
218
+
219
+ # Unit test / coverage reports
220
+
221
+ # Translations
222
+
223
+ # pyenv
224
+ # For a library or package, you might want to ignore these files since the code is
225
+ # intended to run in multiple environments; otherwise, check them in:
226
+ # .python-version
227
+
228
+ # pipenv
229
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
230
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
231
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
232
+ # install all needed dependencies.
233
+
234
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
235
+
236
+
237
+ ### VisualStudioCode ###
238
+ .vscode/*
239
+ !.vscode/settings.json
240
+ !.vscode/tasks.json
241
+ !.vscode/launch.json
242
+ !.vscode/extensions.json
243
+ !.vscode/*.code-snippets
244
+
245
+ # Local History for Visual Studio Code
246
+ .history/
247
+
248
+ # Built Visual Studio Code Extensions
249
+ *.vsix
250
+
251
+ ### VisualStudioCode Patch ###
252
+ # Ignore all local history of files
253
+ .history
254
+ .ionide
255
+
256
+ # End of https://www.toptal.com/developers/gitignore/api/visualstudiocode,macos,python,pythonvanilla
257
+
258
+ # Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option)
259
+
Dockerfile CHANGED
@@ -8,9 +8,16 @@ RUN python3 -m pip install --no-cache-dir --upgrade -r /code/requirements.txt
8
 
9
  COPY . /code
10
 
11
- CMD ["panel", "serve", "/code/portfolioEditingPage.py", "--address", "0.0.0.0", "--port", "7860", "--allow-websocket-origin", "lamonkey-portfolio-management.hf.space"]
12
 
 
 
 
 
 
13
  RUN mkdir /.cache
14
  RUN chmod 777 /.cache
15
  RUN mkdir .chroma
16
  RUN chmod 777 .chroma
 
 
 
8
 
9
  COPY . /code
10
 
11
+ # Create a directory to hold the volume content
12
 
13
+ VOLUME /code/instance
14
+
15
+
16
+ # CMD ["panel", "serve", "/code/portfolioEditingPage.py", "--address", "0.0.0.0", "--port", "7860", "--allow-websocket-origin", "lamonkey-portfolio-management.hf.space"]
17
+ CMD ["panel", "serve", "/code/portfolioEditingPage.py", "--address", "0.0.0.0", "--port", "7860", "--allow-websocket-origin", "*"]
18
  RUN mkdir /.cache
19
  RUN chmod 777 /.cache
20
  RUN mkdir .chroma
21
  RUN chmod 777 .chroma
22
+
23
+
api.py CHANGED
@@ -10,7 +10,7 @@ from typing import List, Optional
10
  from sqlalchemy import create_engine
11
  import table_schema as ts
12
  import os
13
- db_url = 'sqlite:///local.db'
14
  load_dotenv()
15
  user_name = os.environ.get('JQDATA_USER')
16
  password = os.environ.get('JQDATA_PASSWORD')
 
10
  from sqlalchemy import create_engine
11
  import table_schema as ts
12
  import os
13
+ db_url = 'sqlite:///instance/local.db'
14
  load_dotenv()
15
  user_name = os.environ.get('JQDATA_USER')
16
  password = os.environ.get('JQDATA_PASSWORD')
app.ipynb CHANGED
@@ -191,7 +191,7 @@
191
  "from panel.viewable import Viewer\n",
192
  "import param\n",
193
  "# pn.extension('plotly')\n",
194
- "db_url = 'sqlite:///local.db'\n",
195
  "engine = create_engine(db_url)"
196
  ]
197
  },
 
191
  "from panel.viewable import Viewer\n",
192
  "import param\n",
193
  "# pn.extension('plotly')\n",
194
+ "db_url = 'sqlite:///instance/local.db'\n",
195
  "engine = create_engine(db_url)"
196
  ]
197
  },
app_ini.ipynb CHANGED
@@ -55,7 +55,7 @@
55
  "import pytz\n",
56
  "import numpy as np\n",
57
  "import hvplot.pandas\n",
58
- "db_url = 'sqlite:///local.db'\n",
59
  "engine = create_engine(db_url)\n"
60
  ]
61
  },
 
55
  "import pytz\n",
56
  "import numpy as np\n",
57
  "import hvplot.pandas\n",
58
+ "db_url = 'sqlite:///instance/local.db'\n",
59
  "engine = create_engine(db_url)\n"
60
  ]
61
  },
find_outlier.ipynb CHANGED
@@ -12,7 +12,7 @@
12
  "from sqlalchemy import create_engine\n",
13
  "import hvplot.pandas\n",
14
  "pn.extension()\n",
15
- "db_url = 'sqlite:///local.db'\n",
16
  "engine = create_engine(db_url)"
17
  ]
18
  },
 
12
  "from sqlalchemy import create_engine\n",
13
  "import hvplot.pandas\n",
14
  "pn.extension()\n",
15
+ "db_url = 'sqlite:///instance/local.db'\n",
16
  "engine = create_engine(db_url)"
17
  ]
18
  },
index_page.py CHANGED
@@ -21,7 +21,7 @@ pn.extension('mathjax')
21
  # warnings.filterwarnings("ignore", category=pd.core.common.SettingWithCopyWarning)
22
  pn.extension('plotly')
23
  pn.extension('tabulator')
24
- db_url = 'sqlite:///local.db'
25
  engine = create_engine(db_url)
26
 
27
 
 
21
  # warnings.filterwarnings("ignore", category=pd.core.common.SettingWithCopyWarning)
22
  pn.extension('plotly')
23
  pn.extension('tabulator')
24
+ db_url = 'sqlite:///instance/local.db'
25
  engine = create_engine(db_url)
26
 
27
 
initialize_db.py CHANGED
@@ -1,7 +1,7 @@
1
  from sqlalchemy import create_engine
2
  import pandas as pd
3
  import table_schema as ts
4
- db_url = "sqlite:///local.db"
5
 
6
 
7
  def _create_table_with_schema(table_name: str, table_schema: dict):
 
1
  from sqlalchemy import create_engine
2
  import pandas as pd
3
  import table_schema as ts
4
+ db_url = 'sqlite:///instance/local.db'
5
 
6
 
7
  def _create_table_with_schema(table_name: str, table_schema: dict):
local.db β†’ instance/local.db RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:10045194655e10eaf80a30a4af73e819c5ae2422721e6f68b84ca24abb3ef170
3
- size 2224128
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a2632f2fc19c31d921f35ffccc198fed0f6fa32e43f93f0bdbd80d1024884366
3
+ size 2236416
pipeline.py CHANGED
@@ -27,7 +27,7 @@ stock_price_stream = Stream()
27
  # import settings
28
 
29
  # run using --setup
30
- db_url = "sqlite:///local.db"
31
 
32
 
33
  def create_portfolio_profile_df(stocks: list[dict]):
 
27
  # import settings
28
 
29
  # run using --setup
30
+ db_url = 'sqlite:///instance/local.db'
31
 
32
 
33
  def create_portfolio_profile_df(stocks: list[dict]):
portfolioEditingPage.py CHANGED
@@ -13,7 +13,7 @@ from sqlalchemy import create_engine
13
  from pipeline import update_portfolio_profile_to_db
14
  import table_schema
15
  import pipeline
16
- db_url = 'sqlite:///local.db'
17
  pn.extension()
18
  pn.extension('tabulator')
19
  pn.extension('plotly')
 
13
  from pipeline import update_portfolio_profile_to_db
14
  import table_schema
15
  import pipeline
16
+ db_url = 'sqlite:///instance/local.db'
17
  pn.extension()
18
  pn.extension('tabulator')
19
  pn.extension('plotly')
testing_pipeline.ipynb CHANGED
@@ -12,7 +12,7 @@
12
  "import pandas as pd\n",
13
  "import datetime as dt\n",
14
  "import api\n",
15
- "db_url = 'sqlite:///local.db'"
16
  ]
17
  },
18
  {
 
12
  "import pandas as pd\n",
13
  "import datetime as dt\n",
14
  "import api\n",
15
+ "db_url = 'sqlite:///instance/local.db'"
16
  ]
17
  },
18
  {
total_return.ipynb CHANGED
@@ -136,7 +136,7 @@
136
  "from script import processing\n",
137
  "import numpy as np\n",
138
  "pn.extension()\n",
139
- "db_url = 'sqlite:///local.db'\n",
140
  "engine = create_engine(db_url)\n",
141
  "import plotly.express as px\n",
142
  "pn.extension('mathjax')"
 
136
  "from script import processing\n",
137
  "import numpy as np\n",
138
  "pn.extension()\n",
139
+ "db_url = 'sqlite:///instance/local.db'\n",
140
  "engine = create_engine(db_url)\n",
141
  "import plotly.express as px\n",
142
  "pn.extension('mathjax')"