update packing.py
Browse files- utils/packing.py +97 -15
utils/packing.py
CHANGED
@@ -1,18 +1,100 @@
|
|
|
|
|
|
1 |
def generate_packing_list(duration, preferences, transportation):
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
if "art" in preferences:
|
8 |
-
|
9 |
-
|
10 |
if "music" in preferences:
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import random
|
2 |
+
|
3 |
def generate_packing_list(duration, preferences, transportation):
|
4 |
+
essentials = [
|
5 |
+
"Water (1.5 gallons per person per day)",
|
6 |
+
"Food and snacks",
|
7 |
+
"Tent or other shelter",
|
8 |
+
"Sleeping bag",
|
9 |
+
"Pillow",
|
10 |
+
"Warm clothing for nights",
|
11 |
+
"Light, loose clothing for days",
|
12 |
+
"Sturdy boots",
|
13 |
+
"Hat with brim",
|
14 |
+
"Sunglasses",
|
15 |
+
"Sunscreen (high SPF)",
|
16 |
+
"Lip balm with SPF",
|
17 |
+
"Headlamp or flashlight (with extra batteries)",
|
18 |
+
"First aid kit",
|
19 |
+
"Prescription medications",
|
20 |
+
"Toiletries",
|
21 |
+
"Hand sanitizer",
|
22 |
+
"Wet wipes",
|
23 |
+
"Toilet paper",
|
24 |
+
"Trash bags",
|
25 |
+
"Reusable water bottle",
|
26 |
+
"Cup or mug with lid",
|
27 |
+
"Plate and utensils",
|
28 |
+
"Can opener",
|
29 |
+
"Dust mask or bandana",
|
30 |
+
"Goggles",
|
31 |
+
"Earplugs",
|
32 |
+
"Bike (strongly recommended)",
|
33 |
+
"Bike lock",
|
34 |
+
"Bike lights",
|
35 |
+
"Bike repair kit",
|
36 |
+
]
|
37 |
+
|
38 |
+
art_supplies = [
|
39 |
+
"Sketchbook",
|
40 |
+
"Pencils/pens",
|
41 |
+
"Paints",
|
42 |
+
"Brushes",
|
43 |
+
"Portable easel",
|
44 |
+
"Craft materials",
|
45 |
+
]
|
46 |
+
|
47 |
+
music_items = [
|
48 |
+
"Portable instrument",
|
49 |
+
"Portable speaker",
|
50 |
+
"Extra batteries or power bank",
|
51 |
+
]
|
52 |
+
|
53 |
+
comfort_items = [
|
54 |
+
"Camp chair",
|
55 |
+
"Shade structure",
|
56 |
+
"Spray bottle (for cooling off)",
|
57 |
+
"Battery-powered fan",
|
58 |
+
"Hammock",
|
59 |
+
"Earplugs",
|
60 |
+
"Eye mask",
|
61 |
+
]
|
62 |
+
|
63 |
+
transportation_items = {
|
64 |
+
"car": ["Vehicle pass", "Extra gas", "Basic tool kit", "Spare tire"],
|
65 |
+
"plane": ["Clear plastic bags for liquids", "Minimal packing", "Collapsible items"],
|
66 |
+
"rideshare": ["Contribution to gas/vehicle pass", "Compact packing"],
|
67 |
+
}
|
68 |
+
|
69 |
+
packing_list = essentials.copy()
|
70 |
+
|
71 |
+
# Add items based on duration
|
72 |
+
if duration >= 5:
|
73 |
+
packing_list.append("Solar shower")
|
74 |
+
packing_list.append("Clothesline and clothespins")
|
75 |
+
|
76 |
+
# Add items based on preferences
|
77 |
if "art" in preferences:
|
78 |
+
packing_list.extend(random.sample(art_supplies, min(3, len(art_supplies))))
|
|
|
79 |
if "music" in preferences:
|
80 |
+
packing_list.extend(random.sample(music_items, min(2, len(music_items))))
|
81 |
+
|
82 |
+
# Add comfort items
|
83 |
+
packing_list.extend(random.sample(comfort_items, min(3, len(comfort_items))))
|
84 |
+
|
85 |
+
# Add transportation-specific items
|
86 |
+
if transportation in transportation_items:
|
87 |
+
packing_list.extend(transportation_items[transportation])
|
88 |
+
|
89 |
+
# Add Burning Man-specific items
|
90 |
+
burning_man_specifics = [
|
91 |
+
"Gifts to share",
|
92 |
+
"Costume pieces",
|
93 |
+
"EL wire or other lighting for nighttime",
|
94 |
+
"Portable ashtray",
|
95 |
+
"Playa-friendly moisturizer",
|
96 |
+
"Electrolyte packets",
|
97 |
+
]
|
98 |
+
packing_list.extend(burning_man_specifics)
|
99 |
+
|
100 |
+
return packing_list
|