Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -35,7 +35,7 @@ if "cik_value" not in st.session_state:
|
|
| 35 |
@st.cache_data(show_spinner=False)
|
| 36 |
def fetch_crowdfunding_rss(page: int) -> pd.DataFrame:
|
| 37 |
"""
|
| 38 |
-
Fetch the crowdfunding
|
| 39 |
"""
|
| 40 |
url = f"https://financialmodelingprep.com/api/v4/crowdfunding-offerings-rss-feed?page={page}&apikey={API_KEY}"
|
| 41 |
try:
|
|
@@ -88,7 +88,7 @@ def main():
|
|
| 88 |
st.title("Crowdfunding Campaigns")
|
| 89 |
st.write(
|
| 90 |
"Access real-time crowdfunding campaign data. "
|
| 91 |
-
"Use the side menu to select
|
| 92 |
"Each page provides a table with specific campaign details."
|
| 93 |
)
|
| 94 |
|
|
@@ -96,23 +96,23 @@ def main():
|
|
| 96 |
with st.sidebar.expander("Navigation and Options", expanded=True):
|
| 97 |
page = st.radio(
|
| 98 |
"Select Page",
|
| 99 |
-
("Crowdfunding
|
| 100 |
help=(
|
| 101 |
-
"Crowdfunding
|
| 102 |
"Crowdfunding Search: Find campaigns by name. "
|
| 103 |
"Crowdfunding By CIK: Show campaigns for a company by its CIK."
|
| 104 |
)
|
| 105 |
)
|
| 106 |
|
| 107 |
-
if page == "Crowdfunding
|
| 108 |
rss_page = st.number_input(
|
| 109 |
-
"
|
| 110 |
min_value=0,
|
| 111 |
value=DEFAULT_RSS_PAGE,
|
| 112 |
-
help="Enter the page number to fetch from the crowdfunding
|
| 113 |
)
|
| 114 |
st.session_state.rss_page = rss_page
|
| 115 |
-
if st.button("Run Crowdfunding
|
| 116 |
st.session_state.run_rss = True
|
| 117 |
elif page == "Crowdfunding Search":
|
| 118 |
search_name = st.text_input(
|
|
@@ -134,20 +134,20 @@ def main():
|
|
| 134 |
st.session_state.run_cik = True
|
| 135 |
|
| 136 |
# Page Output
|
| 137 |
-
if page == "Crowdfunding
|
| 138 |
-
st.header("Crowdfunding
|
| 139 |
st.write(
|
| 140 |
-
"
|
| 141 |
-
"
|
| 142 |
)
|
| 143 |
if st.session_state.run_rss:
|
| 144 |
df_rss = fetch_crowdfunding_rss(st.session_state.rss_page)
|
| 145 |
if df_rss.empty:
|
| 146 |
-
st.error("No data found for
|
| 147 |
else:
|
| 148 |
st.dataframe(df_rss, use_container_width=True)
|
| 149 |
else:
|
| 150 |
-
st.info("Enter the page number in the sidebar and click 'Run Crowdfunding
|
| 151 |
|
| 152 |
elif page == "Crowdfunding Search":
|
| 153 |
st.header("Crowdfunding Search")
|
|
|
|
| 35 |
@st.cache_data(show_spinner=False)
|
| 36 |
def fetch_crowdfunding_rss(page: int) -> pd.DataFrame:
|
| 37 |
"""
|
| 38 |
+
Fetch the crowdfunding live feed data for a specific page.
|
| 39 |
"""
|
| 40 |
url = f"https://financialmodelingprep.com/api/v4/crowdfunding-offerings-rss-feed?page={page}&apikey={API_KEY}"
|
| 41 |
try:
|
|
|
|
| 88 |
st.title("Crowdfunding Campaigns")
|
| 89 |
st.write(
|
| 90 |
"Access real-time crowdfunding campaign data. "
|
| 91 |
+
"Use the side menu to select one of the three pages below. "
|
| 92 |
"Each page provides a table with specific campaign details."
|
| 93 |
)
|
| 94 |
|
|
|
|
| 96 |
with st.sidebar.expander("Navigation and Options", expanded=True):
|
| 97 |
page = st.radio(
|
| 98 |
"Select Page",
|
| 99 |
+
("Crowdfunding Live Feed", "Crowdfunding Search", "Crowdfunding By CIK"),
|
| 100 |
help=(
|
| 101 |
+
"Crowdfunding Live Feed: View up-to-date campaign data. "
|
| 102 |
"Crowdfunding Search: Find campaigns by name. "
|
| 103 |
"Crowdfunding By CIK: Show campaigns for a company by its CIK."
|
| 104 |
)
|
| 105 |
)
|
| 106 |
|
| 107 |
+
if page == "Crowdfunding Live Feed":
|
| 108 |
rss_page = st.number_input(
|
| 109 |
+
"Live Feed Page",
|
| 110 |
min_value=0,
|
| 111 |
value=DEFAULT_RSS_PAGE,
|
| 112 |
+
help="Enter the page number to fetch from the crowdfunding live feed."
|
| 113 |
)
|
| 114 |
st.session_state.rss_page = rss_page
|
| 115 |
+
if st.button("Run Crowdfunding Live Feed"):
|
| 116 |
st.session_state.run_rss = True
|
| 117 |
elif page == "Crowdfunding Search":
|
| 118 |
search_name = st.text_input(
|
|
|
|
| 134 |
st.session_state.run_cik = True
|
| 135 |
|
| 136 |
# Page Output
|
| 137 |
+
if page == "Crowdfunding Live Feed":
|
| 138 |
+
st.header("Crowdfunding Live Feed")
|
| 139 |
st.write(
|
| 140 |
+
"Displays the latest crowdfunding campaigns from a live feed. "
|
| 141 |
+
"Includes details such as company name, form type, offering amount, and more."
|
| 142 |
)
|
| 143 |
if st.session_state.run_rss:
|
| 144 |
df_rss = fetch_crowdfunding_rss(st.session_state.rss_page)
|
| 145 |
if df_rss.empty:
|
| 146 |
+
st.error("No data found for that feed page.")
|
| 147 |
else:
|
| 148 |
st.dataframe(df_rss, use_container_width=True)
|
| 149 |
else:
|
| 150 |
+
st.info("Enter the page number in the sidebar and click 'Run Crowdfunding Live Feed'.")
|
| 151 |
|
| 152 |
elif page == "Crowdfunding Search":
|
| 153 |
st.header("Crowdfunding Search")
|