Vaibhav84 commited on
Commit
d00da8f
·
1 Parent(s): c474512
SampleCode/Data/Angular1.pdf ADDED
Binary file (209 kB). View file
 
SampleCode/Data/DotNet1.pdf ADDED
Binary file (211 kB). View file
 
SampleCode/Data/React1.pdf ADDED
Binary file (213 kB). View file
 
SampleCode/PHP/UpdateSkill.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // API endpoint URL
3
+ $url = 'https://vaibhav84-resumeapi.hf.space/UpdateSkillDetails/';
4
+
5
+ // Define the input data
6
+ $data = array(
7
+ "SkillName" => "Test4",
8
+ "SkillWeightage" => -3 // Example weightage
9
+ );
10
+
11
+ // Initialize cURL
12
+ $curl = curl_init();
13
+
14
+ // Set cURL options
15
+ curl_setopt_array($curl, array(
16
+ CURLOPT_URL => $url,
17
+ CURLOPT_RETURNTRANSFER => true,
18
+ CURLOPT_CUSTOMREQUEST => "PUT",
19
+ CURLOPT_POSTFIELDS => json_encode($data),
20
+ CURLOPT_HTTPHEADER => array(
21
+ "Content-Type: application/json"
22
+ ),
23
+ ));
24
+
25
+ // Execute the cURL request
26
+ $response = curl_exec($curl);
27
+
28
+ // Check for errors
29
+ if (curl_errno($curl)) {
30
+ echo 'Error: ' . curl_error($curl);
31
+ } else {
32
+ // Print response
33
+ echo "Skill details updated successfully.\n";
34
+ echo "Response: " . $response . "\n";
35
+ }
36
+
37
+ // Close cURL
38
+ curl_close($curl);
39
+ ?>
SampleCode/{SamplephpCall.php → PHP/UploadJD.php} RENAMED
File without changes
SampleCode/SampleAddSkill.py CHANGED
@@ -1,30 +1,32 @@
1
  import requests
2
  from pydantic import BaseModel
3
-
4
  # Define the class for the input data
5
- class AddSkillDetails(BaseModel):
6
- SkillName: str = 'SkillName'
7
- SkillType: str = 'Soft Skill'
8
- SkillScore: int = 10
9
 
10
- # Define the data to be sent to the API
11
- data = AddSkillDetails(
12
- SkillName='TestSkill1',
13
- SkillType='SkillType',
14
- SkillScore=50 # Example score
15
- )
 
 
16
 
17
- # URL of the API endpoint
18
- url = "https://vaibhav84-resumeapi.hf.space/AddSkillDetails/"
19
 
20
- # Make the POST request
21
- response = requests.post(url, json=data.dict())
22
 
23
- # Check the response
24
- if response.status_code == 200:
25
- print("Skill details added successfully.")
26
- print("Response:", response.json())
27
- else:
28
- print("Failed to add skill details.")
29
- print("Status code:", response.status_code)
30
- print("Response:", response.text)
 
1
  import requests
2
  from pydantic import BaseModel
3
+ class UserAddNewSkill:
4
  # Define the class for the input data
5
+ class AddSkillDetails(BaseModel):
6
+ SkillName: str = 'SkillName'
7
+ SkillType: str = 'Soft Skill'
8
+ SkillScore: int = 10
9
 
10
+ # Define the data to be sent to the API
11
+
12
+ def AddNewSkill(API, skillName1,SkillType1,SkillScore1):
13
+ data = UserAddNewSkill.AddSkillDetails(
14
+ SkillName=skillName1,
15
+ SkillType=SkillType1,
16
+ SkillScore=SkillScore1 # Example score
17
+ )
18
 
19
+ # URL of the API endpoint
20
+ #url = "https://vaibhav84-resumeapi.hf.space/AddSkillDetails/"
21
 
22
+ # Make the POST request
23
+ response = requests.post(API, json=data.dict())
24
 
25
+ # Check the response
26
+ if response.status_code == 200:
27
+ print("Skill details added successfully.")
28
+ print("Response:", response.json())
29
+ else:
30
+ print("Failed to add skill details.")
31
+ print("Status code:", response.status_code)
32
+ print("Response:", response.text)
SampleCode/SampleCall.py CHANGED
@@ -19,10 +19,14 @@ def CallAPI(file_path):
19
  total_time = end_time - start_time
20
  # Check if the request was successful (status code 200)
21
  if response.status_code == 200:
 
22
  print("Job description uploaded successfully.", file_name)
 
23
  # Print the response from the API
24
  print(response.text)
 
25
  print("Total time:", total_time, "seconds")
 
26
  else:
27
  print("Failed to upload job description.")
28
  print("Status code:", response.status_code)
 
19
  total_time = end_time - start_time
20
  # Check if the request was successful (status code 200)
21
  if response.status_code == 200:
22
+ print("_____________________________________________________")
23
  print("Job description uploaded successfully.", file_name)
24
+ print("")
25
  # Print the response from the API
26
  print(response.text)
27
+ print("")
28
  print("Total time:", total_time, "seconds")
29
+ print("_____________________________________________________")
30
  else:
31
  print("Failed to upload job description.")
32
  print("Status code:", response.status_code)
SampleCode/SampleCallAdmin.py ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import requests
2
+ import os
3
+ import time
4
+ from pydantic import BaseModel
5
+
6
+ from SampleAddSkill import UserAddNewSkill
7
+ # URL of the API endpoint
8
+ url = "https://vaibhav84-resumeapi.hf.space/"
9
+ class AddSkillDetails(BaseModel):
10
+ SkillName: str = 'SkillName'
11
+ SkillType: str = 'Soft Skill'
12
+ SkillScore: int = 10
13
+
14
+ class UpdateSkillDetails(BaseModel):
15
+ SkillName: str = 'SkillName'
16
+ SkillWeightage: int = -2
17
+
18
+ def CallAPI(API):
19
+
20
+
21
+ # Make the POST request
22
+ response = requests.get(url + API)
23
+
24
+ # Check if the request was successful (status code 200)
25
+ if response.status_code == 200:
26
+ print("_____________________________________________________")
27
+ print("Skill Details")
28
+ print("")
29
+ # Print the response from the API
30
+ print(response.text)
31
+ print("")
32
+ print("_____________________________________________________")
33
+ else:
34
+ print("Failed to get skill details.")
35
+ print("Status code:", response.status_code)
36
+ print("Response:", response.text)
37
+
38
+ #RemoveSkillsByName
39
+ def CallRemoveAPI(API, SkillName):
40
+
41
+ params = {"SkillName": SkillName}
42
+ # Make the POST request
43
+ response = requests.delete(url + API,params=params)
44
+
45
+ # Check if the request was successful (status code 200)
46
+ if response.status_code == 200:
47
+ print("_____________________________________________________")
48
+ print("Skill Deleted ")
49
+ print("")
50
+ # Print the response from the API
51
+ print(response.text)
52
+ print("")
53
+ print("_____________________________________________________")
54
+ else:
55
+ print("Failed to delete skill details.")
56
+ print("Status code:", response.status_code)
57
+ print("Response:", response.text)
58
+
59
+ def CallUpdateSkillAPI(API, SkillName1, weight):
60
+ data = UpdateSkillDetails(
61
+ SkillName=SkillName1,
62
+ SkillWeightage=weight
63
+ )
64
+ print(data)
65
+ # Make the POST request
66
+ response = requests.put(url + API,json=data.dict())
67
+
68
+ # Check if the request was successful (status code 200)
69
+ if response.status_code == 200:
70
+ print("_____________________________________________________")
71
+ print("Skill Updated ")
72
+ print("")
73
+ # Print the response from the API
74
+ print(response.text)
75
+ print("")
76
+ print("_____________________________________________________")
77
+ else:
78
+ print("Failed to update skill details.")
79
+ print("Status code:", response.status_code)
80
+ print("Response:", response.text)
81
+
82
+ def CallAddSkillAPI(API, SkillName1,skilltype, score):
83
+ UserAddNewSkill.AddNewSkill(url + API,SkillName1,skilltype,score)
84
+
85
+
86
+ print("Enter API number to call:")
87
+ print("1. GetAll Skill")
88
+ print("2. Remove Skill")
89
+ print("3. Update Skill")
90
+ print("4. Add Skill")
91
+ userinput = input()
92
+ if(userinput == "1"):
93
+ CallAPI('GetAllSkillDetails/')
94
+ elif(userinput == "2"):
95
+ print("Enter skill which you want to delete")
96
+ userinputskill = input()
97
+ CallRemoveAPI('RemoveSkillsByName',userinputskill)
98
+ elif(userinput == "3"):
99
+ print("Enter skill which you want to update")
100
+ userupdateskill = input()
101
+ print("Enter skill weightage you want to update")
102
+ userwskill = input()
103
+ CallUpdateSkillAPI('UpdateSkillDetails/',userupdateskill,userwskill)
104
+ elif(userinput == "4"):
105
+ print("Enter skill which you want to add")
106
+ uskill = input()
107
+ print("Enter skill type")
108
+ userskilltype = input()
109
+ print("Enter skill score")
110
+ userskillscore = input()
111
+ CallAddSkillAPI('AddSkillDetails/',uskill,userskilltype,userskillscore)
112
+
113
+
114
+ #UpdateSkillDetails
115
+
116
+
SampleCode/UpdateSkill.py ADDED
File without changes
SampleCode/__pycache__/SampleAddSkill.cpython-39.pyc ADDED
Binary file (1.15 kB). View file