Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

app_design_pull_request #2

Merged
merged 1 commit into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/dit-devops-project.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions .streamlit/config.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[theme]
backgroundColor="#ECE1A2"
secondaryBackgroundColor="#ecdcaa"
backgroundColor="#F5FFFA"
secondaryBackgroundColor="#228B22"
textColor="#0e0f10"
font="serif"
font="monospace"

Binary file modified app/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file removed app/__pycache__/data_app.cpython-310.pyc
Binary file not shown.
63 changes: 35 additions & 28 deletions app/data_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,8 @@
from bs4 import BeautifulSoup as bs


st.markdown("<h1 style='text-align: center;'>DIT DEVOPS PROJECT</h1>", unsafe_allow_html=True)
st.markdown("<p style='text-align: center;'> \
<ul> \
<li>Mouhamadou Adji BARRY</li> \
<li>Amadou Tidiane DIALLO</li> \
<li>Aminata CHERIF</li> \
</u> \
</p>", \
unsafe_allow_html=True)

st.markdown("<h1 style='text-align: center;'>DIT DEVOPS PROJECT : Coin Afrique Scraper</h1>", unsafe_allow_html=True)

st.markdown("""
This app allows you to download scraped data on 'villas', 'terrains' and 'appartements' from coin afrique
Expand Down Expand Up @@ -159,34 +152,48 @@ def load_(dataframe, title, key) :
st.markdown('''<style> .stButton>button {
font-size: 12px;
height: 3em;
width: 25em;
width: 20em;
}</style>''', unsafe_allow_html=True)


page = st.selectbox(
"Page Indexes",
options=[opt for opt in range(1, nbPage) ])
col1, col2 = st.columns(2)

option = st.selectbox(
"Options",
("Scrape data using beautifulSoup", "Download scraped data", "Dashboard of the data", "Fill the form"))
with col2:
st.header("Page Indexes")
page = st.selectbox(
"For scraping only",
options=[opt for opt in range(1, nbPage)])

with col1:
st.header("Choices")
option = st.selectbox(
"Options",
("Scrape data using beautifulSoup", "Load scraped data"))

if option == "Scrape data using beautifulSoup":
load_bs(int(page), 'Villas', '1')
load_bs(int(page), 'Terrains', '2')
load_bs(int(page), 'Appartements', '3')

if option == "Download scraped data":
tab1, tab2, tab3 = st.tabs(["Villas", "Terrains", "Appartements"])

with tab1:
load_bs(int(page), 'Villas load', '1')

with tab2:
load_bs(int(page), 'Terrains load', '2')

with tab3:
load_bs(int(page), 'Appartements load', '3')

if option == "Load scraped data":
# Charger les données
load_(pd.read_csv('data/lien-1.csv'), 'Villas', '1')
load_(pd.read_csv('data/lien-2.csv'), 'Terrains', '2')
load_(pd.read_csv('data/lien-3.csv'), 'Appartements', '3')
tab1, tab2, tab3 = st.tabs(["Villas", "Terrains", "Appartements"])
with tab1:
load_(pd.read_csv('data/lien-1.csv'), 'Villas', '1')

with tab2:
load_(pd.read_csv('data/lien-3.csv'), 'Appartements', '3')

with tab3:
load_(pd.read_csv('data/lien-2.csv'), 'Terrains', '2')


if option == "Fill the form":
st.markdown("<iframe src=https://ee.kobotoolbox.org/i/CvCjdZwE width='800' height='600'></iframe>", unsafe_allow_html=True)

if option == "Dashboard of the data":
st.markdown("<iframe width='800' height='600' src='https://lookerstudio.google.com/embed/reporting/64013115-e577-4ece-a3bd-d9552b7223b8/page/p_4uo6mtorhd' frameborder='0' "
"style='border:0' allowfullscreen sandbox='allow-storage-access-by-user-activation allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox'></iframe>", unsafe_allow_html=True)
5 changes: 5 additions & 0 deletions app/pages/Dashboard.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import streamlit as st

st.subheader("This dashbord summarize some information and links between the data ", divider="rainbow")
st.markdown("<iframe width='800' height='600' src='https://lookerstudio.google.com/embed/reporting/64013115-e577-4ece-a3bd-d9552b7223b8/page/p_4uo6mtorhd' frameborder='0' "
"style='border:1' allowfullscreen sandbox='allow-storage-access-by-user-activation allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox'></iframe>", unsafe_allow_html=True)
4 changes: 4 additions & 0 deletions app/pages/Form.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import streamlit as st

st.subheader("This form allow you to evaluate our work to help us to improve the project", divider="rainbow")
st.markdown("<iframe src=https://ee.kobotoolbox.org/i/CvCjdZwE width='800' height='600'></iframe>", unsafe_allow_html=True)
Empty file added app/pages/__init__.py
Empty file.
Loading