Bläddra i källkod

upload pages and related files

Pranshu Raj 1 år sedan
förälder
incheckning
ccb91e4c09

+ 58 - 0
Quine Package Quests/Job-finder/pages/analysis.py

@@ -0,0 +1,58 @@
+from taipy import Gui 
+import pandas as pd
+from taipy.gui import builder as tgb
+import plotly.graph_objects as go
+import plotly.offline as pyo
+
+
+data = pd.read_csv('data/aggregate/aggregate.csv')
+
+location_counts = data['location'].value_counts(sort=True)
+
+location_fig = go.Figure(data=go.Bar(x=location_counts.index, y=location_counts.values))
+location_fig.update_layout(title_text='Location counts', xaxis_title='index', yaxis_title='values')
+
+# md='''
+# # Analysis of sourced data
+
+# <|{location_counts}|chart|type=bar|x=index|y=values|>'''
+
+# Figures are as observed on March 18, 2024
+demand={
+    "python developer": 7947,
+    "data analyst": 5221,
+    "machine learning engineer": 27829,
+    "software engineer": 46596,
+    "backend developer": 18583,
+    "devops engineer": 1785,
+    "automation engineer": 12976,
+    "network engineer": 10513,
+    "vuejs developer": 1444,
+    "react developer": 6112,
+    "nodejs developer": 4883,
+    "frontend developer": 12399,
+    "full stack developer": 7006,
+    "ui developer": 9303,
+    "web application developer": 19582,
+    "javascript engineer": 6797,
+    "mobile app developer": 4191,
+}
+
+
+
+demand = pd.DataFrame.from_dict(demand, orient = 'index', columns=['demand'])
+demand.reset_index(inplace=True)
+demand.columns=['Query','Demand']
+
+
+with tgb.Page() as analysis_page:
+    tgb.text('Analysis of sourced data',class_name='h1')
+    tgb.html('br')
+    tgb.text('Demand of jobs as sourced on 18 March 2024.', class_name='h4')
+    with tgb.part('card'):
+        tgb.text('Demand of jobs sourced')
+        tgb.table('{demand}')
+    #tgb.html()
+
+# todo : add the plotly charts - store as image then use html(md is hard, no docs for py)
+#Gui(analysis_page).run()

+ 50 - 0
Quine Package Quests/Job-finder/pages/create_visuals.py

@@ -0,0 +1,50 @@
+import pandas as pd
+import plotly.graph_objects as go
+import plotly.offline as pyo
+import plotly.io as pio
+
+
+data = pd.read_csv('data/aggregate/aggregate.csv')
+
+location_counts = data['location'].value_counts(sort=True)
+
+location_fig = go.Figure(data=go.Bar(x=location_counts.index, y=location_counts.values))
+location_fig.update_layout(title_text='Location counts', xaxis_title='index', yaxis_title='values')
+
+
+demand={
+    "python developer": 7947,
+    "data analyst": 5221,
+    "machine learning engineer": 27829,
+    "software engineer": 46596,
+    "backend developer": 18583,
+    "devops engineer": 1785,
+    "automation engineer": 12976,
+    "network engineer": 10513,
+    "vuejs developer": 1444,
+    "react developer": 6112,
+    "nodejs developer": 4883,
+    "frontend developer": 12399,
+    "full stack developer": 7006,
+    "ui developer": 9303,
+    "web application developer": 19582,
+    "javascript engineer": 6797,
+    "mobile app developer": 4191,
+}
+
+
+
+demand = pd.DataFrame.from_dict(demand, orient = 'index', columns=['demand'])
+demand.reset_index(inplace=True)
+demand.columns=['Query','Demand']
+
+
+demand_fig = go.Figure(data=go.Bar(x=demand['Query'], y=demand['Demand']))
+demand_fig.update_layout(title_text='Job Demand', xaxis_title='Job', yaxis_title='Demand')
+graph_div = pyo.plot(demand_fig, output_type='div')
+
+with open('static/demand.html','w') as f:
+    f.write(graph_div)
+
+pio.write_image(demand_fig,'static/job_demand.png')
+pio.write_image(location_fig, 'static/location_counts.png')

+ 15 - 0
Quine Package Quests/Job-finder/pages/jobs.css

@@ -0,0 +1,15 @@
+.taipy-card{
+    display: flex;
+    flex-direction:column;
+    justify-content: space-between;
+    min-height: 200px;
+}
+.taipy-button {
+    position:relative;
+    display: block;
+    margin: auto;
+    text-transform: none;
+    align-self: center;
+    margin-top: 10vh;
+    /* bottom:100vh; */
+}

+ 61 - 0
Quine Package Quests/Job-finder/pages/search.py

@@ -0,0 +1,61 @@
+import logging
+from taipy.gui import builder as tgb
+from taipy.gui import navigate
+import pandas as pd
+
+
+
+logging.basicConfig(level=logging.INFO)
+
+df = pd.read_csv("data/aggregate/aggregate.csv")
+
+filtered_df = df
+locations = list(df["location"].unique())
+queries = [
+    "python developer",
+    "data analyst",
+    "machine learning engineer",
+    "software engineer",
+    "backend developer",
+    "devops engineer",
+    "automation engineer",
+    "network engineer",
+    "vuejs developer",
+    "react developer",
+    "nodejs developer",
+    "frontend developer",
+    "full stack developer",
+    "ui developer",
+    "web application developer",
+    "javascript engineer",
+    "mobile app developer",
+]
+sources = ["indeed", "yc"]
+links = {}
+chunk_index = 0
+selected_locations, selected_queries, selected_sources = [], [], []
+filter_options=['location','source','title']
+selected_options =''
+
+
+def choose_filter_option(state):
+    if state.selected_option=='location':
+        tgb.selector()
+
+
+with tgb.Page() as search_page:
+    tgb.text('Filter by', class_name='h3')
+    tgb.html('br')
+    with tgb.layout('1 1 1'):
+        with tgb.part('card'):
+            tgb.text('Job Title', class_name='h4')
+            tgb.html('br')
+            tgb.selector(value='{selected_queries}', lov=queries, multiple=False, dropdown=True)
+        with tgb.part('card'):
+            tgb.text('Location', class_name='h4')
+            tgb.html('br')
+            tgb.selector(value='{selected_locations}', lov=locations, multiple=False, dropdown=True)
+        with tgb.part('card'):
+            tgb.text('Job Source')
+            tgb.html('br')
+            tgb.selector(value='{selected_sources}', lov=sources, multiple=False, dropdown=True)