-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPythonCode
More file actions
88 lines (77 loc) · 2.76 KB
/
Copy pathPythonCode
File metadata and controls
88 lines (77 loc) · 2.76 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import sqlite3
# ----------------------------------
# 1. Connect to (or create) the database
# ----------------------------------
connection = sqlite3.connect("service_design.db")
cursor = connection.cursor()
# ----------------------------------
# 2. Create a table for service design methods
# ----------------------------------
cursor.execute("""
CREATE TABLE IF NOT EXISTS service_design_methods (
id INTEGER PRIMARY KEY AUTOINCREMENT,
method_name TEXT NOT NULL,
phase TEXT NOT NULL,
description TEXT
);
""")
# ----------------------------------
# 3. Insert sample data
# ----------------------------------
# Double Diamond Phases: "Discovery", "Define", "Development", "Delivery", "Evaluate"
methods_data = [
("Empathy Map", "Discovery",
"Helps teams understand user feelings, needs, and pain points."),
("Stakeholder Map", "Discovery",
"Identifies and visualizes all relevant stakeholders and relationships."),
("How Might We Statements", "Define",
"Reframes insights into actionable design challenges."),
("Service Blueprint", "Development",
"Maps out the service process, frontstage and backstage interactions."),
("Prototyping", "Development",
"Creates low- to high-fidelity models of potential solutions."),
("Pilot Testing", "Delivery",
"Implements a small-scale version of the service to gather feedback."),
("Launch Strategy", "Delivery",
"Plans the full rollout, including communications and logistics."),
("Retrospective", "Evaluate",
"Reviews what worked, what didn’t, and opportunities for improvement."),
("Impact Assessment", "Evaluate",
"Measures outcomes against objectives to refine future iterations.")
]
# Insert sample rows
cursor.executemany("""
INSERT INTO service_design_methods (method_name, phase, description)
VALUES (?, ?, ?);
""", methods_data)
connection.commit()
# ----------------------------------
# 4. Example: Querying the database
# ----------------------------------
# a) Retrieve all methods for a specific phase
search_phase = "Discovery"
cursor.execute("""
SELECT method_name, description
FROM service_design_methods
WHERE phase = ?;
""", (search_phase,))
rows = cursor.fetchall()
print(f"Methods in the '{search_phase}' phase:")
for row in rows:
method_name, description = row
print(f" - {method_name}: {description}")
# b) Retrieve all methods, grouped by phase
cursor.execute("""
SELECT phase, method_name, description
FROM service_design_methods
ORDER BY phase;
""")
rows = cursor.fetchall()
print("\nAll methods by phase:")
for row in rows:
phase, method_name, description = row
print(f"[{phase}] {method_name}: {description}")
# ----------------------------------
# 5. Close the connection
# ----------------------------------
connection.close()