search.py 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import logging
  2. from taipy.gui import builder as tgb
  3. from taipy.gui import navigate
  4. import pandas as pd
  5. logging.basicConfig(level=logging.INFO)
  6. df = pd.read_csv("data/aggregate/aggregate.csv")
  7. filtered_df = df
  8. locations = list(df["location"].unique())
  9. queries = [
  10. "python developer",
  11. "data analyst",
  12. "machine learning engineer",
  13. "software engineer",
  14. "backend developer",
  15. "devops engineer",
  16. "automation engineer",
  17. "network engineer",
  18. "vuejs developer",
  19. "react developer",
  20. "nodejs developer",
  21. "frontend developer",
  22. "full stack developer",
  23. "ui developer",
  24. "web application developer",
  25. "javascript engineer",
  26. "mobile app developer",
  27. ]
  28. sources = ["indeed", "yc"]
  29. links = {}
  30. chunk_index = 0
  31. selected_locations, selected_queries, selected_sources = [], [], []
  32. filter_options=['location','source','title']
  33. selected_options =''
  34. def choose_filter_option(state):
  35. if state.selected_option=='location':
  36. tgb.selector()
  37. with tgb.Page() as search_page:
  38. tgb.text('Filter by', class_name='h3')
  39. tgb.html('br')
  40. with tgb.layout('1 1 1'):
  41. with tgb.part('card'):
  42. tgb.text('Job Title', class_name='h4')
  43. tgb.html('br')
  44. tgb.selector(value='{selected_queries}', lov=queries, multiple=False, dropdown=True)
  45. with tgb.part('card'):
  46. tgb.text('Location', class_name='h4')
  47. tgb.html('br')
  48. tgb.selector(value='{selected_locations}', lov=locations, multiple=False, dropdown=True)
  49. with tgb.part('card'):
  50. tgb.text('Job Source')
  51. tgb.html('br')
  52. tgb.selector(value='{selected_sources}', lov=sources, multiple=False, dropdown=True)