-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcreate_db.py
55 lines (49 loc) · 2.18 KB
/
create_db.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# create_db.py
import sqlite3
def create_programs_db():
conn = sqlite3.connect('programs.db')
cursor = conn.cursor()
# Create the program_info table with a structured schema
cursor.execute('''
CREATE TABLE IF NOT EXISTS program_info (
program_id INTEGER PRIMARY KEY AUTOINCREMENT,
program_name TEXT NOT NULL,
description TEXT,
eligibility_criteria TEXT,
exclusions TEXT,
application_procedure TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)
''')
# Sample data for the Kisan Samman Nidhi program
sample_program = {
'program_name': 'OpenG2P Kisan Samman Nidhi',
'description': 'Financial assistance program for farmer families',
'eligibility_criteria': 'All landholding farmers\' families, which have cultivable land holding in their names are eligible to get benefit under the scheme.',
'exclusions': '''The following categories of beneficiaries of higher economic status shall not be eligible:
1. All Institutional Land holders.
2. Farmer families in which one or more of its members belong to following categories
3. Former and present holders of constitutional posts
4. Former and present Ministers/State Ministers and former/present Members of LokSabha/RajyaSabha
5. All serving or retired officers and employees of Central/State Government
6. All superannuated/retired pensioners whose monthly pension is Rs.10,000/-or more
7. All Persons who paid Income Tax in last assessment year
8. Professionals like Doctors, Engineers, Lawyers registered with Professional bodies''',
'application_procedure': 'Visit the nearest government help centre.'
}
# Insert the sample program
cursor.execute('''
INSERT INTO program_info (
program_name, description, eligibility_criteria, exclusions, application_procedure
) VALUES (?, ?, ?, ?, ?)
''', (
sample_program['program_name'],
sample_program['description'],
sample_program['eligibility_criteria'],
sample_program['exclusions'],
sample_program['application_procedure']
))
conn.commit()
conn.close()
if __name__ == "__main__":
create_programs_db()