jiandong commited on
Commit
4773eba
·
1 Parent(s): e1376fb

Upload with huggingface_hub

Browse files
Files changed (4) hide show
  1. Dockerfile +20 -0
  2. app.py +14 -0
  3. requirements.txt +2 -0
  4. workcell.yaml +10 -0
Dockerfile ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
2
+ # you will also find guides on how best to write your Dockerfile
3
+
4
+ FROM python:3.8
5
+
6
+ # Set up a new user named "user" with user ID 1000
7
+ RUN useradd -m -u 1000 user
8
+ # Switch to the "user" user
9
+ USER user
10
+ # Set home to the user's home directory
11
+ ENV HOME=/home/user \
12
+ PATH=/home/user/.local/bin:$PATH
13
+ # Set the working directory to the user's home directory
14
+ WORKDIR $HOME/app
15
+
16
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
17
+ COPY --chown=user . $HOME/app
18
+ RUN pip install --no-cache-dir --upgrade -r $HOME/app/requirements.txt
19
+
20
+ CMD ["workcell", "serve", "--config", "workcell.yaml", "--host", "0.0.0.0", "--port", "7860"]
app.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from openbb_terminal.sdk import openbb
2
+ from pydantic import BaseModel, Field
3
+ from typing import Optional
4
+ from workcell.integrations.types import PerspectiveTable
5
+
6
+
7
+ class Input(BaseModel):
8
+ ticker: str = Field(default="AAPL", description="A ticker value, like `AAPL`, etc...")
9
+
10
+ def stocks_dd_sec(input: Input) -> PerspectiveTable:
11
+ """List of SEC Filings. Gets a DataFrame of the recent SEC filings submitted by the company and a link to view each one. (openbb.stocks.dd.sec )"""
12
+ df = openbb.stocks.dd.sec(input.ticker).reset_index()
13
+ output = PerspectiveTable(data=df)
14
+ return output
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ workcell==0.0.34
2
+ openbb==2.3.0
workcell.yaml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ workcell_name: stocks_dd_sec
2
+ workcell_provider: huggingface
3
+ workcell_id: weanalyze/stocks_dd_sec
4
+ workcell_version: latest
5
+ workcell_runtime: python3.8
6
+ workcell_entrypoint: app:stocks_dd_sec
7
+ workcell_code:
8
+ ImageUri: ''
9
+ workcell_tags: {}
10
+ workcell_envs: {}