3
Be_	                 @   s$   d dl Zd dlZd dlZdd ZdS )    Nc           	   C   s"  t jddddddt jjd} d}| j }|j| |j }td	|j td
 xV|D ]N}td|d  td|d  td|d  td|d d td|d d qTW t	j
|dddddgd}|jd d}| j }|j| |j }td	|j t	j
|ddddddgd}|jd | j  d S )Nz9cldy-hub-db-dev-do-user-1524670-0.a.db.ondigitalocean.comZappuserZs7xnwc7aeyq9vbzkZ	defaultdbia  Zutf8mb4)hostuserpasswddbportcharsetZcursorclasszJselect id, title, details, city, state_province from jobs order by id desczTotal number of rows is: z
Printing each recordzId = idztitle = titlezdetails  = detailszcity  = Zcity
zstate_province  = Zstate_province)columnszC/var/www/html/talenthub/backend/ai/resume-to-job-match/jobs_des.csvzselect r.id, r.person_id, p.job_profile as title, r.resume_details, p.city, p.state_province from resumes r, person p where r.person_id = p.id and r.person_id is not null and r.resume_details is not null order by r.id desc 	resume_id	person_idresume_detailszF/var/www/html/talenthub/backend/ai/resume-to-job-match/resumes_des.csv)pymysqlconnectZcursorsZ
DictCursorcursorexecutefetchallprintrowcountpd	DataFrameto_csvclose)r   Zsql_select_Queryr   recordsrowj_dfr_df r   Q/var/www/html/talenthub/backend/ai/resume-to-job-match/export_jobs_resumes_csv.pyget_jobs_resumes_csv   s<    





r!   )pandasr   Zpymysql.cursorsr   r!   r   r   r   r    <module>   s   