Spaces:
Sleeping
Sleeping
| def evaluate_eligibility(scheme_id, p): | |
| if scheme_id == "MGNREGS": | |
| return p.get('age', 0) >= 18 and p.get('area') == 'Rural' and p.get('willing_unskilled_work', False) | |
| elif scheme_id == "PMAY-G": | |
| return p.get('area') == 'Rural' and p.get('housing') in ['Houseless', 'Kutcha'] and \ | |
| p.get('monthly_income', 0) < 15000 and not p.get('has_pucca_house', False) | |
| elif scheme_id == "PMGSY": | |
| return p.get('area') == 'Rural' and p.get('unconnected_village', False) | |
| elif scheme_id == "NSAP": | |
| return p.get('bpl', False) and (p.get('age', 0) >= 60 or \ | |
| (p.get('age', 0) >= 18 and p.get('disability', False)) or \ | |
| (p.get('age', 0) >= 40 and p.get('widow', False)) or \ | |
| p.get('destitute', False)) | |
| elif scheme_id == "DAY-NRLM": | |
| return p.get('area') == 'Rural' and p.get('bpl', False) | |
| elif scheme_id == "PMAY-U": | |
| return p.get('area') == 'Urban' and p.get('income', 0) <= 1800000 and not p.get('has_pucca_house', False) | |
| elif scheme_id == "AMRUT": | |
| return p.get('area') == 'Urban' # Generalized for urban residents | |
| elif scheme_id == "SBM-U": | |
| return p.get('area') == 'Urban' and p.get('lack_toilet', False) | |
| elif scheme_id == "DAY-NULM": | |
| return p.get('area') == 'Urban' and p.get('bpl', False) and p.get('age', 0) >= 18 | |
| elif scheme_id == "SMART_CITIES": | |
| return p.get('area') == 'Urban' and p.get('smart_city_resident', False) | |
| elif scheme_id == "JJM": | |
| return p.get('area') == 'Rural' and p.get('lack_tap_water', False) | |
| elif scheme_id == "SBM-G": | |
| return p.get('area') == 'Rural' and p.get('lack_toilet', False) | |
| elif scheme_id == "ATAL_BHUJAL": | |
| return p.get('area') == 'Rural' and p.get('water_stressed_gp', False) | |
| elif scheme_id == "NHM": | |
| return True # Universal access, focuses heavily on BPL | |
| elif scheme_id == "PMJAY": | |
| if p.get('age', 0) >= 70: | |
| return True | |
| return p.get('bpl', False) or p.get('category') in ['SC', 'ST'] or p.get('informal_worker', False) | |
| elif scheme_id == "NDHM": | |
| return p.get('aadhaar', False) | |
| elif scheme_id == "SAMAGRA": | |
| return p.get('is_student', False) and 6 <= p.get('age', 0) <= 18 and p.get('school_type') == 'Government' | |
| elif scheme_id == "PM_POSHAN": | |
| return p.get('is_student', False) and 3 <= p.get('age', 0) <= 14 and p.get('school_type') == 'Government' | |
| elif scheme_id == "NMS": | |
| return p.get('is_student', False) and p.get('student_class', 0) >= 8 and \ | |
| p.get('income', 0) <= 350000 and p.get('school_type') == 'Government' | |
| elif scheme_id == "PMKSY": | |
| return p.get('is_farmer', False) and p.get('land_size_hectares', 0) <= 5 and p.get('aadhaar', False) | |
| elif scheme_id == "PMFBY": | |
| return p.get('is_farmer', False) # Generalized for notified crops | |
| elif scheme_id == "NFSM": | |
| return p.get('is_farmer', False) | |
| elif scheme_id == "NMSA": | |
| return p.get('is_farmer', False) and p.get('soil_health_card', False) | |
| elif scheme_id == "AGRI_MECH": | |
| return p.get('is_farmer', False) and p.get('aadhaar', False) | |
| elif scheme_id == "POSHAN_ABHIYAAN": | |
| return (0 <= p.get('age', 0) <= 6) or (10 <= p.get('age', 0) <= 19 and p.get('gender') == 'Female') or p.get('pregnant', False) or p.get('lactating', False) | |
| elif scheme_id == "MISSION_SHAKTI": | |
| return p.get('gender') == 'Female' | |
| elif scheme_id == "MISSION_VATSALYA": | |
| return p.get('age', 0) < 18 and (p.get('orphan', False) or p.get('abandoned', False)) | |
| elif scheme_id == "ANGANWADI": | |
| return (0 <= p.get('age', 0) <= 6) or p.get('pregnant', False) or p.get('lactating', False) | |
| return False | |
| SCHEMES = [ | |
| { | |
| "id": "MGNREGS", | |
| "name": "Mahatma Gandhi National Rural Employment Guarantee Scheme (MGNREGS)", | |
| "ministry": "Ministry of Rural Development", | |
| "description": "Guarantees 100 days of wage employment in a financial year to a rural household whose adult members volunteer to do unskilled manual work.", | |
| "benefits": "Minimum 100 days of guaranteed wage employment per household per year. Wages paid equally to men and women via DBT within 15 days." | |
| }, | |
| { | |
| "id": "PMAY-G", | |
| "name": "Pradhan Mantri Awas Yojana - Gramin (PMAY-G)", | |
| "ministry": "Ministry of Rural Development", | |
| "description": "Housing for poor in rural areas.", | |
| "benefits": "₹1.20 lakh in plain areas; ₹1.30 lakh in hilly areas. Additional ₹12,000 for toilet via convergence." | |
| }, | |
| { | |
| "id": "PMGSY", | |
| "name": "Pradhan Mantri Gram Sadak Yojana (PMGSY)", | |
| "ministry": "Ministry of Rural Development", | |
| "description": "All-weather road connectivity to unconnected rural habitations.", | |
| "benefits": "Improved access to healthcare, education, markets; economic growth." | |
| }, | |
| { | |
| "id": "NSAP", | |
| "name": "National Social Assistance Programme (NSAP)", | |
| "ministry": "Ministry of Rural Development", | |
| "description": "Financial assistance to the elderly, widows, and persons with disabilities in the form of social pensions.", | |
| "benefits": "₹200-₹500/month depending on age and category." | |
| }, | |
| { | |
| "id": "DAY-NRLM", | |
| "name": "Deendayal Antyodaya Yojana-National Rural Livelihoods Mission", | |
| "ministry": "Ministry of Rural Development", | |
| "description": "Creating efficient and effective institutional platforms for the rural poor.", | |
| "benefits": "Revolving fund: ₹15,000 per SHG; Community Investment Fund: up to ₹2.5 lakh." | |
| }, | |
| { | |
| "id": "PMAY-U", | |
| "name": "Pradhan Mantri Awas Yojana - Urban (PMAY-U)", | |
| "ministry": "Ministry of Housing & Urban Affairs", | |
| "description": "Housing for all in urban areas.", | |
| "benefits": "Credit Linked Subsidy, Central assistance up to ₹2.67 lakh." | |
| }, | |
| { | |
| "id": "AMRUT", | |
| "name": "Atal Mission for Rejuvenation and Urban Transformation (AMRUT)", | |
| "ministry": "Ministry of Housing & Urban Affairs", | |
| "description": "Focused on water supply, sewerage/septage management, storm water drainage, urban transport and parks.", | |
| "benefits": "Universal water supply/sewerage connections; stormwater drainage; parks/green spaces." | |
| }, | |
| { | |
| "id": "SBM-U", | |
| "name": "Swachh Bharat Mission - Urban (SBM-U)", | |
| "ministry": "Ministry of Housing & Urban Affairs", | |
| "description": "To make urban India free from open defecation and achieving 100% scientific management of municipal solid waste.", | |
| "benefits": "Financial assistance for Individual Household Latrines (IHHL) construction." | |
| }, | |
| { | |
| "id": "DAY-NULM", | |
| "name": "Deendayal Antyodaya Yojana-National Urban Livelihoods Mission", | |
| "ministry": "Ministry of Housing & Urban Affairs", | |
| "description": "To reduce poverty and vulnerability of the urban poor households.", | |
| "benefits": "Skill training stipend, self-employment loans up to ₹2 lakh." | |
| }, | |
| { | |
| "id": "SMART_CITIES", | |
| "name": "Smart Cities Mission", | |
| "ministry": "Ministry of Housing & Urban Affairs", | |
| "description": "To promote cities that provide core infrastructure and give a decent quality of life.", | |
| "benefits": "Core infrastructure improvements: water, sanitation, mobility, IT, safety." | |
| }, | |
| { | |
| "id": "JJM", | |
| "name": "Jal Jeevan Mission", | |
| "ministry": "Ministry of Jal Shakti", | |
| "description": "To provide safe and adequate drinking water through individual household tap connections by 2024 to all households in rural India.", | |
| "benefits": "Functional Household Tap Connection (FHTC) with 55 lpcd safe drinking water." | |
| }, | |
| { | |
| "id": "SBM-G", | |
| "name": "Swachh Bharat Mission - Gramin (SBM-G)", | |
| "ministry": "Ministry of Jal Shakti", | |
| "description": "To accelerate the efforts to achieve universal sanitation coverage and to put focus on sanitation.", | |
| "benefits": "₹12,000 incentive per IHHL for eligible households." | |
| }, | |
| { | |
| "id": "ATAL_BHUJAL", | |
| "name": "Atal Bhujal Yojana", | |
| "ministry": "Ministry of Jal Shakti", | |
| "description": "To improve ground water management through community participation in identified priority areas.", | |
| "benefits": "Subsidies/assistance for efficient water practices." | |
| }, | |
| { | |
| "id": "NHM", | |
| "name": "National Health Mission (NHM)", | |
| "ministry": "Ministry of Health & Family Welfare", | |
| "description": "Achievement of universal access to equitable, affordable & quality health care services that are accountable and responsive to people's needs.", | |
| "benefits": "Free primary/secondary healthcare, immunization, maternal/child health services." | |
| }, | |
| { | |
| "id": "PMJAY", | |
| "name": "Ayushman Bharat PM-JAY", | |
| "ministry": "Ministry of Health & Family Welfare", | |
| "description": "To provide a health cover of Rs. 5 lakhs per family per year for secondary and tertiary care hospitalization.", | |
| "benefits": "Health insurance cover up to ₹5 lakh per family per year for secondary/tertiary hospitalization." | |
| }, | |
| { | |
| "id": "NDHM", | |
| "name": "Ayushman Bharat Digital Mission (NDHM)", | |
| "ministry": "Ministry of Health & Family Welfare", | |
| "description": "To develop the backbone necessary to support the integrated digital health infrastructure of the country.", | |
| "benefits": "ABHA (Ayushman Bharat Health Account) ID for accessing consolidated health records." | |
| }, | |
| { | |
| "id": "SAMAGRA", | |
| "name": "Samagra Shiksha", | |
| "ministry": "Ministry of Education", | |
| "description": "An overarching programme for the school education sector extending from pre-school to class 12.", | |
| "benefits": "Free uniforms, textbooks, infrastructure, teacher training, vocational education." | |
| }, | |
| { | |
| "id": "PM_POSHAN", | |
| "name": "Pradhan Mantri Poshan Shakti Nirman (PM POSHAN)", | |
| "ministry": "Ministry of Education", | |
| "description": "One hot cooked meal in Government and Government – aided Schools.", | |
| "benefits": "One hot cooked meal per school day." | |
| }, | |
| { | |
| "id": "NMS", | |
| "name": "National Means-cum-Merit Scholarship Scheme (NMMSS)", | |
| "ministry": "Ministry of Education", | |
| "description": "To award scholarships to meritorious students of economically weaker sections to arrest their drop out at class VIII.", | |
| "benefits": "₹12,000 per annum from Class IX to XII." | |
| }, | |
| { | |
| "id": "PMKSY", | |
| "name": "Pradhan Mantri Krishi Sinchayee Yojana (PMKSY)", | |
| "ministry": "Ministry of Agriculture", | |
| "description": "To achieve convergence of investments in irrigation at the field level, expand cultivable area under assured irrigation.", | |
| "benefits": "55% subsidy for small/marginal farmers, 45% for others on micro-irrigation systems." | |
| }, | |
| { | |
| "id": "PMFBY", | |
| "name": "Pradhan Mantri Fasal Bima Yojana (PMFBY)", | |
| "ministry": "Ministry of Agriculture", | |
| "description": "To provide insurance coverage and financial support to the farmers in the event of failure of any of the notified crop.", | |
| "benefits": "Comprehensive crop insurance covering yield losses." | |
| }, | |
| { | |
| "id": "NFSM", | |
| "name": "National Food Security Mission (NFSM)", | |
| "ministry": "Ministry of Agriculture", | |
| "description": "Increasing production of rice, wheat, pulses and coarse cereals through area expansion and productivity enhancement.", | |
| "benefits": "Comprehensive crop insurance, subsidies on inputs." | |
| }, | |
| { | |
| "id": "NMSA", | |
| "name": "National Mission for Sustainable Agriculture (NMSA)", | |
| "ministry": "Ministry of Agriculture", | |
| "description": "For enhancing agricultural productivity especially in rainfed areas focusing on integrated farming, water use efficiency, etc.", | |
| "benefits": "Demonstrations on integrated farming systems. Subsidies for soil health management." | |
| }, | |
| { | |
| "id": "AGRI_MECH", | |
| "name": "Sub-Mission on Agricultural Mechanization", | |
| "ministry": "Ministry of Agriculture", | |
| "description": "To reach the unreached by bringing custom hiring centres to small and marginal farmers.", | |
| "benefits": "50% subsidy for SC/ST/small/marginal/women; 40% general on farm machinery." | |
| }, | |
| { | |
| "id": "POSHAN_ABHIYAAN", | |
| "name": "POSHAN Abhiyaan", | |
| "ministry": "Ministry of Women & Child Development", | |
| "description": "To improve nutritional outcomes for children, pregnant women and lactating mothers.", | |
| "benefits": "Supplementary nutrition at Anganwadi centres, growth monitoring, early childhood care." | |
| }, | |
| { | |
| "id": "MISSION_SHAKTI", | |
| "name": "Mission Shakti", | |
| "ministry": "Ministry of Women & Child Development", | |
| "description": "An integrated women empowerment programme for safety, security and empowerment of women.", | |
| "benefits": "Zero-interest loans up to ₹1 lakh for women enterprises, working women hostels, maternity benefits." | |
| }, | |
| { | |
| "id": "MISSION_VATSALYA", | |
| "name": "Mission Vatsalya", | |
| "ministry": "Ministry of Women & Child Development", | |
| "description": "To secure a healthy and happy childhood for each and every child in India, focus on children needing care.", | |
| "benefits": "₹4,000/month per child for sponsorship, foster care, aftercare." | |
| }, | |
| { | |
| "id": "ANGANWADI", | |
| "name": "Anganwadi Services", | |
| "ministry": "Ministry of Women & Child Development", | |
| "description": "To lay the foundation for proper psychological, physical and social development of the child.", | |
| "benefits": "Supplementary nutrition, pre-school education, nutrition/health education, immunization." | |
| } | |
| ] | |
| def get_eligible_schemes(profile): | |
| eligible = [] | |
| for scheme in SCHEMES: | |
| if evaluate_eligibility(scheme["id"], profile): | |
| eligible.append(scheme) | |
| return eligible | |