HarshEra commited on
Commit
88336b5
·
verified ·
1 Parent(s): 765363d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +29 -28
app.py CHANGED
@@ -61,44 +61,45 @@ def finance_management_plan(budget: float, habits: str, goal: str, period: str)
61
  f"{new_habits_str}\n"
62
  f"This will help you stay on track with your financial goals."
63
  )
64
- # Example usage:
 
65
  print(finance_management_plan(1000.0, "Monday: $50, Tuesday: $30, Wednesday: $40, Thursday: $20, Friday: $60, Saturday: $80, Sunday: $70", "Save $500 for a vacation", "month"))
66
 
67
 
68
 
69
- @tool
70
- def webscraping_jobs(search_term: str, location: str, results_wanted: int = 20, hours_old: int = 72, country_indeed: str = 'USA') -> str:
71
- """
72
- A tool that scrapes job listings from multiple websites based on jobspy library.
73
 
74
- Args:
75
- search_term (str): The job title or keywords to search for (e.g., 'software engineer').
76
- location (str): The location to search for jobs (e.g., 'San Francisco, CA').
77
- results_wanted (int, optional): Number of results to retrieve (default is 20).
78
- hours_old (int, optional): Maximum age of job postings in hours (default is 72).
79
- country_indeed (str, optional): Country filter for Indeed searches (default is 'USA').
80
 
81
- Returns:
82
- str: A message with the number of jobs found and saves results to 'jobs.csv'.
83
- """
84
 
85
- jobs = scrape_jobs(
86
- site_name=["indeed", "LinkedIn", "google", "bayt", "naukri","Tanitjobs"], # other "zip_recruiter", "glassdoor",
87
- search_term=search_term,
88
- google_search_term=f"{search_term} jobs near {location} since yesterday",
89
- location=location,
90
- results_wanted=results_wanted,
91
- hours_old=hours_old,
92
- country_indeed=country_indeed,
93
- )
94
 
95
- if jobs.empty:
96
- return f"No jobs found for '{search_term}' in '{location}'."
97
 
98
- # Save results to CSV
99
- jobs.to_csv("jobs.csv", quoting=csv.QUOTE_NONNUMERIC, escapechar="\\", index=False)
100
 
101
- return f"Found {len(jobs)} jobs for '{search_term}' in '{location}'. Results saved to 'jobs.csv'."
102
 
103
 
104
  @tool
 
61
  f"{new_habits_str}\n"
62
  f"This will help you stay on track with your financial goals."
63
  )
64
+
65
+ Example usage:
66
  print(finance_management_plan(1000.0, "Monday: $50, Tuesday: $30, Wednesday: $40, Thursday: $20, Friday: $60, Saturday: $80, Sunday: $70", "Save $500 for a vacation", "month"))
67
 
68
 
69
 
70
+ # @tool
71
+ # def webscraping_jobs(search_term: str, location: str, results_wanted: int = 20, hours_old: int = 72, country_indeed: str = 'USA') -> str:
72
+ # """
73
+ # A tool that scrapes job listings from multiple websites based on jobspy library.
74
 
75
+ # Args:
76
+ # search_term (str): The job title or keywords to search for (e.g., 'software engineer').
77
+ # location (str): The location to search for jobs (e.g., 'San Francisco, CA').
78
+ # results_wanted (int, optional): Number of results to retrieve (default is 20).
79
+ # hours_old (int, optional): Maximum age of job postings in hours (default is 72).
80
+ # country_indeed (str, optional): Country filter for Indeed searches (default is 'USA').
81
 
82
+ # Returns:
83
+ # str: A message with the number of jobs found and saves results to 'jobs.csv'.
84
+ # """
85
 
86
+ # jobs = scrape_jobs(
87
+ # site_name=["indeed", "LinkedIn", "google", "bayt", "naukri","Tanitjobs"], # other "zip_recruiter", "glassdoor",
88
+ # search_term=search_term,
89
+ # google_search_term=f"{search_term} jobs near {location} since yesterday",
90
+ # location=location,
91
+ # results_wanted=results_wanted,
92
+ # hours_old=hours_old,
93
+ # country_indeed=country_indeed,
94
+ # )
95
 
96
+ # if jobs.empty:
97
+ # return f"No jobs found for '{search_term}' in '{location}'."
98
 
99
+ # # Save results to CSV
100
+ # jobs.to_csv("jobs.csv", quoting=csv.QUOTE_NONNUMERIC, escapechar="\\", index=False)
101
 
102
+ # return f"Found {len(jobs)} jobs for '{search_term}' in '{location}'. Results saved to 'jobs.csv'."
103
 
104
 
105
  @tool