o
    {i	                     @   s   d Z ddlZddlmZ ddlmZ ee jjd Z	ee	 dd Z
e
 Zee jd Zejd	d
 eeddZg dZg dZeZdS )zj
Configuration for the churn prediction ML pipeline.
Reads database credentials from Laravel's .env file.
    N)Path)load_dotenvz.envc                  C   s   t d} | r#ddlm} || }|j|jpd|jd|j|j	dS t ddt
t d	dt d
dt ddt dddS )z?Parse DATABASE_URL if available, otherwise use individual vars.DATABASE_URLr   )urlparsei8  /)hostportdbnameuserpasswordDB_HOSTz	127.0.0.1DB_PORTDB_DATABASE	sms_adminDB_USERNAMEpostgresDB_PASSWORD )osgetenvurllib.parser   hostnamer   pathlstripusernamer   int)urlr   parsed r   H/home/areeb/Downloads/sms104/multitv-sms_admin-d31c13c67891/ml/config.py_parse_db_url   s    


	


r    modelsT)exist_okCHURN_APP_ID0)customer_tenure_daysdays_since_last_logintotal_subscriptionsactive_subscription_countdays_until_expiryauto_renew_enabledsubscription_pricefailed_payment_count_30dfailed_payment_count_90dpayment_failure_ratesubscription_gap_dayshas_downgradedtotal_revenueavg_order_valuerevenue_trendcoupon_userrenewal_ratehas_ever_churnedchurns_count)watch_count_7dwatch_count_30dwatch_count_90dtotal_watch_duration_30davg_watch_durationdays_since_last_watchwatch_count_decline_pctduration_decline_pctunique_categories_30dbinge_sessions_30dis_currently_watchingcontent_type_diversity)__doc__r   pathlibr   dotenvr   __file__resolveparent	_env_pathr    	DB_CONFIG	MODEL_DIRmkdirr   r   DEFAULT_APP_IDPHASE1_FEATURE_COLUMNSPHASE2_FEATURE_COLUMNSFEATURE_COLUMNSr   r   r   r   <module>   s    