Spaces:
Sleeping
Sleeping
Change
Browse files- SampleCall.py +0 -30
- SampleDbConnection.py +0 -23
SampleCall.py
DELETED
@@ -1,30 +0,0 @@
|
|
1 |
-
import requests
|
2 |
-
import os
|
3 |
-
|
4 |
-
# URL of the API endpoint
|
5 |
-
url = "https://vaibhav84-resumeapi.hf.space/UploadJobDescription/"
|
6 |
-
|
7 |
-
# Path to the file you want to upload
|
8 |
-
file_path = "d:/hug/job_desc_front_end_engineer.pdf"
|
9 |
-
file_name = os.path.basename(file_path)
|
10 |
-
|
11 |
-
# Open the file in binary mode
|
12 |
-
with open(file_path, "rb") as file:
|
13 |
-
# Prepare the file to be sent in the request
|
14 |
-
files = {"file": (file_path, file)}
|
15 |
-
|
16 |
-
# Additional parameters for the request
|
17 |
-
params = {"FileName": file_name} # Adjust FileName if necessary
|
18 |
-
|
19 |
-
# Make the POST request
|
20 |
-
response = requests.post(url, files=files, params=params)
|
21 |
-
|
22 |
-
# Check if the request was successful (status code 200)
|
23 |
-
if response.status_code == 200:
|
24 |
-
print("Job description uploaded successfully.")
|
25 |
-
# Print the response from the API
|
26 |
-
print(response.text)
|
27 |
-
else:
|
28 |
-
print("Failed to upload job description.")
|
29 |
-
print("Status code:", response.status_code)
|
30 |
-
print("Response:", response.text)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SampleDbConnection.py
DELETED
@@ -1,23 +0,0 @@
|
|
1 |
-
import pymysql
|
2 |
-
|
3 |
-
timeout = 10
|
4 |
-
db_params = {}
|
5 |
-
connection = pymysql.connect(
|
6 |
-
charset="utf8mb4",
|
7 |
-
connect_timeout=timeout,
|
8 |
-
cursorclass=pymysql.cursors.DictCursor,
|
9 |
-
db="defaultdb",
|
10 |
-
host="mysql-anu-xboxgames1900-aebf.a.aivencloud.com",
|
11 |
-
password="AVNS_TGfs_uHRKteMjB9pFnq",
|
12 |
-
read_timeout=timeout,
|
13 |
-
port=25227,
|
14 |
-
user="avnadmin",
|
15 |
-
write_timeout=timeout,
|
16 |
-
)
|
17 |
-
|
18 |
-
try:
|
19 |
-
cursor = connection.cursor()
|
20 |
-
cursor.execute("SELECT * FROM skillmaster")
|
21 |
-
print(cursor.fetchall())
|
22 |
-
finally:
|
23 |
-
connection.close()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|