Dhom1 commited on
Commit
bea0baa
·
verified ·
1 Parent(s): 7db8fbc

Upload 6 files

Browse files
README.md CHANGED
@@ -1,12 +1,38 @@
1
- ---
2
- title: Anjez
3
- emoji: 🐢
4
- colorFrom: gray
5
- colorTo: green
6
- sdk: streamlit
7
- sdk_version: 1.45.0
8
- app_file: app.py
9
- pinned: false
10
- ---
11
-
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: Athar Investment Analyzer (Streamlit)
3
+ emoji: 🗺️💡📊
4
+ colorFrom: blue
5
+ colorTo: indigo
6
+ sdk: streamlit
7
+ app_file: streamlit_app.py
8
+ pinned: false
9
+ python_version: 3.11
10
+ ---
11
+
12
+ # مشروع أثر - تحليل فرص الاستثمار التجاري (Streamlit)
13
+
14
+ مرحباً بك في العرض التوضيحي لمشروع "أثر" بواجهة Streamlit!
15
+
16
+ **الوصف:**
17
+ هذه أداة تجريبية تستخدم الذكاء الاصطناعي (عبر نموذج GPT-4o) لتحليل مدى مناسبة فتح نشاط تجاري معين في موقع مقترح داخل **حي الياسمين بمدينة الرياض**. يعتمد التحليل على مجموعة بيانات وهمية تشمل معلومات ديموغرافية أساسية، التراخيص التجارية القائمة، ونقاط الاهتمام في الحي.
18
+
19
+ **كيفية الاستخدام:**
20
+
21
+ 1. **اختر النشاط التجاري:** من القائمة المنسدلة في الشريط الجانبي.
22
+ 2. **حدد الموقع المقترح:** انقر على الخريطة التفاعلية في الشريط الجانبي لتحديد الموقع الذي تفكر فيه لمشروعك. ستظهر الإحداثيات المختارة أسفل الخريطة.
23
+ 3. **اضغط على زر "🚀 تحليل الفرصة"**: انتظر قليلاً حتى يقوم النموذج اللغوي بتحليل البيانات وتقديم توصية.
24
+ 4. **راجع النتائج:** ستظهر التوصية النصية والخريطة التفاعلية المحدثة (في الجزء الرئيسي) التي توضح موقعك المقترح، المنافسين (إن وجدوا بنفس النشاط)، ونقاط الاهتمام العامة في المنطقة.
25
+
26
+ **البيانات المستخدمة:**
27
+ * ملف الحي (`yasmen.json`)
28
+ * التراخيص (`fake_licenses_SA-RIY-YAS_openai.json`)
29
+ * نقاط الاهتمام (`fake_pois_SA-RIY-YAS_openai.json`)
30
+
31
+ **ملاحظة هامة:**
32
+ هذا التطبيق هو للعرض التوضيحي فقط ويستخدم بيانات **وهمية**. لا يجب الاعتماد على نتائجه لاتخاذ قرارات استثمارية حقيقية.
33
+
34
+ **المكتبات الرئيسية المستخدمة:**
35
+ * Streamlit, Streamlit-Folium (للواجهة والخريطة التفاعلية)
36
+ * OpenAI (للنموذج اللغوي)
37
+ * Folium (لإنشاء الخرائط)
38
+ * Geopy (لحساب المسافات)
fake_licenses_SA-RIY-YAS_openai.json ADDED
@@ -0,0 +1,962 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "license_id": "BL-000001",
4
+ "cr_number": "1010123456",
5
+ "business_name_ar": "مطعم الياسمين",
6
+ "business_name_en": "Al Yasmin Restaurant",
7
+ "activity_code_isic": "5610",
8
+ "activity_description_ar": "مطاعم تقديم الطعام",
9
+ "activity_description_en": "Restaurants and Food Service",
10
+ "license_status": "Active",
11
+ "issue_date": "2020-03-15",
12
+ "expiry_date": "2025-03-14",
13
+ "location": {
14
+ "neighborhood_id": "SA-RIY-YAS",
15
+ "street_name_ar": "أنس بن مالك",
16
+ "street_name_en": "Anas Ibn Malik Rd",
17
+ "building_number": "102",
18
+ "postal_code": "13321",
19
+ "latitude": 24.7995,
20
+ "longitude": 46.6312,
21
+ "national_address": "102, Anas Ibn Malik Rd, Al Yasmin, Riyadh, 13321"
22
+ },
23
+ "source_platform": "Balady",
24
+ "last_checked": "2024-06-10T10:15:30Z"
25
+ },
26
+ {
27
+ "license_id": "BL-000002",
28
+ "cr_number": "1010234567",
29
+ "business_name_ar": "مقهى الورد",
30
+ "business_name_en": "Al Ward Cafe",
31
+ "activity_code_isic": "5630",
32
+ "activity_description_ar": "مقاهي",
33
+ "activity_description_en": "Cafes",
34
+ "license_status": "Active",
35
+ "issue_date": "2021-07-20",
36
+ "expiry_date": "2024-07-19",
37
+ "location": {
38
+ "neighborhood_id": "SA-RIY-YAS",
39
+ "street_name_ar": "الثمامة",
40
+ "street_name_en": "Thumamah Rd",
41
+ "building_number": "58",
42
+ "postal_code": "13322",
43
+ "latitude": 24.807,
44
+ "longitude": 46.6398,
45
+ "national_address": "58, Thumamah Rd, Al Yasmin, Riyadh, 13322"
46
+ },
47
+ "source_platform": "Balady",
48
+ "last_checked": "2024-06-10T11:00:00Z"
49
+ },
50
+ {
51
+ "license_id": "BL-000003",
52
+ "cr_number": "1010345678",
53
+ "business_name_ar": "سوبر ماركت الياسمين",
54
+ "business_name_en": "Al Yasmin Supermarket",
55
+ "activity_code_isic": "4711",
56
+ "activity_description_ar": "محلات بقالة",
57
+ "activity_description_en": "Grocery Stores",
58
+ "license_status": "Active",
59
+ "issue_date": "2019-11-05",
60
+ "expiry_date": "2024-11-04",
61
+ "location": {
62
+ "neighborhood_id": "SA-RIY-YAS",
63
+ "street_name_ar": "شارع أبي بكر الصديق",
64
+ "street_name_en": "Abi Bakr As Siddiq Rd",
65
+ "building_number": "215",
66
+ "postal_code": "13325",
67
+ "latitude": 24.8021,
68
+ "longitude": 46.6425,
69
+ "national_address": "215, Abi Bakr As Siddiq Rd, Al Yasmin, Riyadh, 13325"
70
+ },
71
+ "source_platform": "Balady",
72
+ "last_checked": "2024-06-09T09:45:10Z"
73
+ },
74
+ {
75
+ "license_id": "BL-000004",
76
+ "cr_number": "1010456789",
77
+ "business_name_ar": "صيدلية الياسمين",
78
+ "business_name_en": "Al Yasmin Pharmacy",
79
+ "activity_code_isic": "4773",
80
+ "activity_description_ar": "صيدليات",
81
+ "activity_description_en": "Pharmacies",
82
+ "license_status": "Active",
83
+ "issue_date": "2018-05-12",
84
+ "expiry_date": "2023-05-11",
85
+ "location": {
86
+ "neighborhood_id": "SA-RIY-YAS",
87
+ "street_name_ar": "شارع القلم",
88
+ "street_name_en": "Al Qalam St",
89
+ "building_number": "33",
90
+ "postal_code": "13326",
91
+ "latitude": 24.7957,
92
+ "longitude": 46.6299,
93
+ "national_address": "33, Al Qalam St, Al Yasmin, Riyadh, 13326"
94
+ },
95
+ "source_platform": "Balady",
96
+ "last_checked": "2024-06-10T12:30:45Z"
97
+ },
98
+ {
99
+ "license_id": "BL-000005",
100
+ "cr_number": "1010567890",
101
+ "business_name_ar": "عيادة الياسمين الطبية",
102
+ "business_name_en": "Al Yasmin Medical Clinic",
103
+ "activity_code_isic": "8620",
104
+ "activity_description_ar": "عيادات طبية",
105
+ "activity_description_en": "Medical Clinics",
106
+ "license_status": "Active",
107
+ "issue_date": "2022-01-10",
108
+ "expiry_date": "2027-01-09",
109
+ "location": {
110
+ "neighborhood_id": "SA-RIY-YAS",
111
+ "street_name_ar": "أنس بن مالك",
112
+ "street_name_en": "Anas Ibn Malik Rd",
113
+ "building_number": "89",
114
+ "postal_code": "13321",
115
+ "latitude": 24.7984,
116
+ "longitude": 46.635,
117
+ "national_address": "89, Anas Ibn Malik Rd, Al Yasmin, Riyadh, 13321"
118
+ },
119
+ "source_platform": "Balady",
120
+ "last_checked": "2024-06-09T15:20:30Z"
121
+ },
122
+ {
123
+ "license_id": "BL-000006",
124
+ "cr_number": "1010678901",
125
+ "business_name_ar": "مغسلة ومكواة الياسمين",
126
+ "business_name_en": "Al Yasmin Laundry & Ironing",
127
+ "activity_code_isic": "9602",
128
+ "activity_description_ar": "مغاسل الملابس",
129
+ "activity_description_en": "Laundry Services",
130
+ "license_status": "Expired",
131
+ "issue_date": "2017-09-08",
132
+ "expiry_date": "2022-09-07",
133
+ "location": {
134
+ "neighborhood_id": "SA-RIY-YAS",
135
+ "street_name_ar": "الثمامة",
136
+ "street_name_en": "Thumamah Rd",
137
+ "building_number": "44",
138
+ "postal_code": "13322",
139
+ "latitude": 24.805,
140
+ "longitude": 46.6333,
141
+ "national_address": "44, Thumamah Rd, Al Yasmin, Riyadh, 13322"
142
+ },
143
+ "source_platform": "Balady",
144
+ "last_checked": "2024-06-08T08:00:00Z"
145
+ },
146
+ {
147
+ "license_id": "BL-000007",
148
+ "cr_number": "1010789012",
149
+ "business_name_ar": "ورشة الغزال للسيارات",
150
+ "business_name_en": "Al Ghazal Auto Workshop",
151
+ "activity_code_isic": "4520",
152
+ "activity_description_ar": "ورش صيانة السيارات",
153
+ "activity_description_en": "Auto Repair Workshops",
154
+ "license_status": "Active",
155
+ "issue_date": "2019-06-22",
156
+ "expiry_date": "2024-06-21",
157
+ "location": {
158
+ "neighborhood_id": "SA-RIY-YAS",
159
+ "street_name_ar": "شارع الملك عبدالعزيز فرع",
160
+ "street_name_en": "King Abdulaziz Rd Branch",
161
+ "building_number": "77",
162
+ "postal_code": "13325",
163
+ "latitude": 24.7999,
164
+ "longitude": 46.644,
165
+ "national_address": "77, King Abdulaziz Rd Branch, Al Yasmin, Riyadh, 13325"
166
+ },
167
+ "source_platform": "Balady",
168
+ "last_checked": "2024-06-10T13:15:25Z"
169
+ },
170
+ {
171
+ "license_id": "BL-000008",
172
+ "cr_number": "1010890123",
173
+ "business_name_ar": "مكتب النخبة للاستشارات",
174
+ "business_name_en": "Elite Consulting Office",
175
+ "activity_code_isic": "7020",
176
+ "activity_description_ar": "مكاتب استشارية صغيرة",
177
+ "activity_description_en": "Small Consulting Offices",
178
+ "license_status": "Active",
179
+ "issue_date": "2021-10-30",
180
+ "expiry_date": "2026-10-29",
181
+ "location": {
182
+ "neighborhood_id": "SA-RIY-YAS",
183
+ "street_name_ar": "أنس بن مالك",
184
+ "street_name_en": "Anas Ibn Malik Rd",
185
+ "building_number": "6",
186
+ "postal_code": "13321",
187
+ "latitude": 24.8003,
188
+ "longitude": 46.6277,
189
+ "national_address": "6, Anas Ibn Malik Rd, Al Yasmin, Riyadh, 13321"
190
+ },
191
+ "source_platform": "Balady",
192
+ "last_checked": "2024-06-10T14:40:50Z"
193
+ },
194
+ {
195
+ "license_id": "BL-000009",
196
+ "cr_number": "1010901234",
197
+ "business_name_ar": "محل زهرة الياسمين",
198
+ "business_name_en": "Yasmin Flower Shop",
199
+ "activity_code_isic": "4776",
200
+ "activity_description_ar": "محلات بيع الزهور",
201
+ "activity_description_en": "Flower Shops",
202
+ "license_status": "Active",
203
+ "issue_date": "2020-12-12",
204
+ "expiry_date": "2025-12-11",
205
+ "location": {
206
+ "neighborhood_id": "SA-RIY-YAS",
207
+ "street_name_ar": "الثمامة",
208
+ "street_name_en": "Thumamah Rd",
209
+ "building_number": "25",
210
+ "postal_code": "13322",
211
+ "latitude": 24.7978,
212
+ "longitude": 46.6407,
213
+ "national_address": "25, Thumamah Rd, Al Yasmin, Riyadh, 13322"
214
+ },
215
+ "source_platform": "Balady",
216
+ "last_checked": "2024-06-09T07:30:10Z"
217
+ },
218
+ {
219
+ "license_id": "BL-000010",
220
+ "cr_number": "1010112345",
221
+ "business_name_ar": "مكتبة الياسمين",
222
+ "business_name_en": "Al Yasmin Bookstore",
223
+ "activity_code_isic": "4761",
224
+ "activity_description_ar": "محلات بيع الكتب",
225
+ "activity_description_en": "Bookstores",
226
+ "license_status": "Active",
227
+ "issue_date": "2019-02-15",
228
+ "expiry_date": "2024-02-14",
229
+ "location": {
230
+ "neighborhood_id": "SA-RIY-YAS",
231
+ "street_name_ar": "شارع أبي بكر الصديق",
232
+ "street_name_en": "Abi Bakr As Siddiq Rd",
233
+ "building_number": "110",
234
+ "postal_code": "13325",
235
+ "latitude": 24.808,
236
+ "longitude": 46.6321,
237
+ "national_address": "110, Abi Bakr As Siddiq Rd, Al Yasmin, Riyadh, 13325"
238
+ },
239
+ "source_platform": "Balady",
240
+ "last_checked": "2024-06-10T09:50:00Z"
241
+ },
242
+ {
243
+ "license_id": "BL-000011",
244
+ "cr_number": "1010123457",
245
+ "business_name_ar": "مطعم البستان",
246
+ "business_name_en": "Al Bustan Restaurant",
247
+ "activity_code_isic": "5610",
248
+ "activity_description_ar": "مطاعم تقديم الطعام",
249
+ "activity_description_en": "Restaurants and Food Service",
250
+ "license_status": "Expired",
251
+ "issue_date": "2016-08-10",
252
+ "expiry_date": "2021-08-09",
253
+ "location": {
254
+ "neighborhood_id": "SA-RIY-YAS",
255
+ "street_name_ar": "شارع القلم",
256
+ "street_name_en": "Al Qalam St",
257
+ "building_number": "50",
258
+ "postal_code": "13326",
259
+ "latitude": 24.8005,
260
+ "longitude": 46.6275,
261
+ "national_address": "50, Al Qalam St, Al Yasmin, Riyadh, 13326"
262
+ },
263
+ "source_platform": "Balady",
264
+ "last_checked": "2024-06-07T10:10:00Z"
265
+ },
266
+ {
267
+ "license_id": "BL-000012",
268
+ "cr_number": "1010234568",
269
+ "business_name_ar": "مقهى السحاب",
270
+ "business_name_en": "Al Sahab Cafe",
271
+ "activity_code_isic": "5630",
272
+ "activity_description_ar": "مقاهي",
273
+ "activity_description_en": "Cafes",
274
+ "license_status": "Active",
275
+ "issue_date": "2021-04-01",
276
+ "expiry_date": "2026-03-31",
277
+ "location": {
278
+ "neighborhood_id": "SA-RIY-YAS",
279
+ "street_name_ar": "أنس بن مالك",
280
+ "street_name_en": "Anas Ibn Malik Rd",
281
+ "building_number": "150",
282
+ "postal_code": "13321",
283
+ "latitude": 24.7968,
284
+ "longitude": 46.646,
285
+ "national_address": "150, Anas Ibn Malik Rd, Al Yasmin, Riyadh, 13321"
286
+ },
287
+ "source_platform": "Balady",
288
+ "last_checked": "2024-06-10T16:05:00Z"
289
+ },
290
+ {
291
+ "license_id": "BL-000013",
292
+ "cr_number": "1010345679",
293
+ "business_name_ar": "متجر الإلكترونيات المتطورة",
294
+ "business_name_en": "Advanced Electronics Store",
295
+ "activity_code_isic": "4742",
296
+ "activity_description_ar": "محلات بيع الإلكترونيات",
297
+ "activity_description_en": "Electronics Retail Stores",
298
+ "license_status": "Active",
299
+ "issue_date": "2018-10-20",
300
+ "expiry_date": "2023-10-19",
301
+ "location": {
302
+ "neighborhood_id": "SA-RIY-YAS",
303
+ "street_name_ar": "الثمامة",
304
+ "street_name_en": "Thumamah Rd",
305
+ "building_number": "90",
306
+ "postal_code": "13322",
307
+ "latitude": 24.7912,
308
+ "longitude": 46.638,
309
+ "national_address": "90, Thumamah Rd, Al Yasmin, Riyadh, 13322"
310
+ },
311
+ "source_platform": "Balady",
312
+ "last_checked": "2024-06-09T14:25:10Z"
313
+ },
314
+ {
315
+ "license_id": "BL-000014",
316
+ "cr_number": "1010456790",
317
+ "business_name_ar": "صيدلية الندى",
318
+ "business_name_en": "Al Nada Pharmacy",
319
+ "activity_code_isic": "4773",
320
+ "activity_description_ar": "صيدليات",
321
+ "activity_description_en": "Pharmacies",
322
+ "license_status": "Active",
323
+ "issue_date": "2019-07-15",
324
+ "expiry_date": "2024-07-14",
325
+ "location": {
326
+ "neighborhood_id": "SA-RIY-YAS",
327
+ "street_name_ar": "شارع أبي بكر الصديق",
328
+ "street_name_en": "Abi Bakr As Siddiq Rd",
329
+ "building_number": "47",
330
+ "postal_code": "13325",
331
+ "latitude": 24.8033,
332
+ "longitude": 46.6287,
333
+ "national_address": "47, Abi Bakr As Siddiq Rd, Al Yasmin, Riyadh, 13325"
334
+ },
335
+ "source_platform": "Balady",
336
+ "last_checked": "2024-06-10T08:10:30Z"
337
+ },
338
+ {
339
+ "license_id": "BL-000015",
340
+ "cr_number": "1010567891",
341
+ "business_name_ar": "عيادة الشفاء",
342
+ "business_name_en": "Al Shifa Clinic",
343
+ "activity_code_isic": "8620",
344
+ "activity_description_ar": "عيادات طبية",
345
+ "activity_description_en": "Medical Clinics",
346
+ "license_status": "Active",
347
+ "issue_date": "2020-02-28",
348
+ "expiry_date": "2025-02-27",
349
+ "location": {
350
+ "neighborhood_id": "SA-RIY-YAS",
351
+ "street_name_ar": "شارع القلم",
352
+ "street_name_en": "Al Qalam St",
353
+ "building_number": "12",
354
+ "postal_code": "13326",
355
+ "latitude": 24.8085,
356
+ "longitude": 46.6445,
357
+ "national_address": "12, Al Qalam St, Al Yasmin, Riyadh, 13326"
358
+ },
359
+ "source_platform": "Balady",
360
+ "last_checked": "2024-06-09T17:45:55Z"
361
+ },
362
+ {
363
+ "license_id": "BL-000016",
364
+ "cr_number": "1010678902",
365
+ "business_name_ar": "مغسلة وردة الياسمين",
366
+ "business_name_en": "Yasmin Rose Laundry",
367
+ "activity_code_isic": "9602",
368
+ "activity_description_ar": "مغاسل الملابس",
369
+ "activity_description_en": "Laundry Services",
370
+ "license_status": "Active",
371
+ "issue_date": "2021-11-10",
372
+ "expiry_date": "2026-11-09",
373
+ "location": {
374
+ "neighborhood_id": "SA-RIY-YAS",
375
+ "street_name_ar": "أنس بن مالك",
376
+ "street_name_en": "Anas Ibn Malik Rd",
377
+ "building_number": "37",
378
+ "postal_code": "13321",
379
+ "latitude": 24.7942,
380
+ "longitude": 46.6339,
381
+ "national_address": "37, Anas Ibn Malik Rd, Al Yasmin, Riyadh, 13321"
382
+ },
383
+ "source_platform": "Balady",
384
+ "last_checked": "2024-06-10T09:00:00Z"
385
+ },
386
+ {
387
+ "license_id": "BL-000017",
388
+ "cr_number": "1010789013",
389
+ "business_name_ar": "ورشة صيانة النجوم",
390
+ "business_name_en": "Al Nojoom Maintenance Workshop",
391
+ "activity_code_isic": "4520",
392
+ "activity_description_ar": "ورش صيانة السيارات",
393
+ "activity_description_en": "Auto Repair Workshops",
394
+ "license_status": "Expired",
395
+ "issue_date": "2015-05-05",
396
+ "expiry_date": "2020-05-04",
397
+ "location": {
398
+ "neighborhood_id": "SA-RIY-YAS",
399
+ "street_name_ar": "الثمامة",
400
+ "street_name_en": "Thumamah Rd",
401
+ "building_number": "120",
402
+ "postal_code": "13322",
403
+ "latitude": 24.8015,
404
+ "longitude": 46.6317,
405
+ "national_address": "120, Thumamah Rd, Al Yasmin, Riyadh, 13322"
406
+ },
407
+ "source_platform": "Balady",
408
+ "last_checked": "2024-06-06T12:15:00Z"
409
+ },
410
+ {
411
+ "license_id": "BL-000018",
412
+ "cr_number": "1010890124",
413
+ "business_name_ar": "مكتب المستقبل للاستشارات",
414
+ "business_name_en": "Al Mustaqbal Consulting Office",
415
+ "activity_code_isic": "7020",
416
+ "activity_description_ar": "مكاتب استشارية صغيرة",
417
+ "activity_description_en": "Small Consulting Offices",
418
+ "license_status": "Active",
419
+ "issue_date": "2019-09-18",
420
+ "expiry_date": "2024-09-17",
421
+ "location": {
422
+ "neighborhood_id": "SA-RIY-YAS",
423
+ "street_name_ar": "شارع الملك عبدالعزيز فرع",
424
+ "street_name_en": "King Abdulaziz Rd Branch",
425
+ "building_number": "18",
426
+ "postal_code": "13325",
427
+ "latitude": 24.7964,
428
+ "longitude": 46.6268,
429
+ "national_address": "18, King Abdulaziz Rd Branch, Al Yasmin, Riyadh, 13325"
430
+ },
431
+ "source_platform": "Balady",
432
+ "last_checked": "2024-06-10T11:25:45Z"
433
+ },
434
+ {
435
+ "license_id": "BL-000019",
436
+ "cr_number": "1010901235",
437
+ "business_name_ar": "محل جنى للزهور",
438
+ "business_name_en": "Jana Flower Shop",
439
+ "activity_code_isic": "4776",
440
+ "activity_description_ar": "محلات بيع الزهور",
441
+ "activity_description_en": "Flower Shops",
442
+ "license_status": "Active",
443
+ "issue_date": "2022-03-25",
444
+ "expiry_date": "2027-03-24",
445
+ "location": {
446
+ "neighborhood_id": "SA-RIY-YAS",
447
+ "street_name_ar": "أنس بن مالك",
448
+ "street_name_en": "Anas Ibn Malik Rd",
449
+ "building_number": "73",
450
+ "postal_code": "13321",
451
+ "latitude": 24.8037,
452
+ "longitude": 46.6359,
453
+ "national_address": "73, Anas Ibn Malik Rd, Al Yasmin, Riyadh, 13321"
454
+ },
455
+ "source_platform": "Balady",
456
+ "last_checked": "2024-06-10T07:50:30Z"
457
+ },
458
+ {
459
+ "license_id": "BL-000020",
460
+ "cr_number": "1010112346",
461
+ "business_name_ar": "مكتبة الورود",
462
+ "business_name_en": "Al Worood Bookstore",
463
+ "activity_code_isic": "4761",
464
+ "activity_description_ar": "محلات بيع الكتب",
465
+ "activity_description_en": "Bookstores",
466
+ "license_status": "Active",
467
+ "issue_date": "2020-06-14",
468
+ "expiry_date": "2025-06-13",
469
+ "location": {
470
+ "neighborhood_id": "SA-RIY-YAS",
471
+ "street_name_ar": "الثمامة",
472
+ "street_name_en": "Thumamah Rd",
473
+ "building_number": "106",
474
+ "postal_code": "13322",
475
+ "latitude": 24.7927,
476
+ "longitude": 46.6392,
477
+ "national_address": "106, Thumamah Rd, Al Yasmin, Riyadh, 13322"
478
+ },
479
+ "source_platform": "Balady",
480
+ "last_checked": "2024-06-09T18:20:40Z"
481
+ },
482
+ {
483
+ "license_id": "BL-000021",
484
+ "cr_number": "1010123458",
485
+ "business_name_ar": "مطعم الديوان",
486
+ "business_name_en": "Al Diwan Restaurant",
487
+ "activity_code_isic": "5610",
488
+ "activity_description_ar": "مطاعم تقديم الطعام",
489
+ "activity_description_en": "Restaurants and Food Service",
490
+ "license_status": "Active",
491
+ "issue_date": "2022-08-18",
492
+ "expiry_date": "2027-08-17",
493
+ "location": {
494
+ "neighborhood_id": "SA-RIY-YAS",
495
+ "street_name_ar": "شارع الملك عبدالعزيز فرع",
496
+ "street_name_en": "King Abdulaziz Rd Branch",
497
+ "building_number": "59",
498
+ "postal_code": "13325",
499
+ "latitude": 24.7987,
500
+ "longitude": 46.6314,
501
+ "national_address": "59, King Abdulaziz Rd Branch, Al Yasmin, Riyadh, 13325"
502
+ },
503
+ "source_platform": "Balady",
504
+ "last_checked": "2024-06-10T10:40:20Z"
505
+ },
506
+ {
507
+ "license_id": "BL-000022",
508
+ "cr_number": "1010234569",
509
+ "business_name_ar": "مقهى الفجر",
510
+ "business_name_en": "Al Fajr Cafe",
511
+ "activity_code_isic": "5630",
512
+ "activity_description_ar": "مقاهي",
513
+ "activity_description_en": "Cafes",
514
+ "license_status": "Active",
515
+ "issue_date": "2019-12-05",
516
+ "expiry_date": "2024-12-04",
517
+ "location": {
518
+ "neighborhood_id": "SA-RIY-YAS",
519
+ "street_name_ar": "شارع القلم",
520
+ "street_name_en": "Al Qalam St",
521
+ "building_number": "108",
522
+ "postal_code": "13326",
523
+ "latitude": 24.8055,
524
+ "longitude": 46.6283,
525
+ "national_address": "108, Al Qalam St, Al Yasmin, Riyadh, 13326"
526
+ },
527
+ "source_platform": "Balady",
528
+ "last_checked": "2024-06-10T06:50:10Z"
529
+ },
530
+ {
531
+ "license_id": "BL-000023",
532
+ "cr_number": "1010345680",
533
+ "business_name_ar": "متجر التقنية الحديثة",
534
+ "business_name_en": "Modern Tech Store",
535
+ "activity_code_isic": "4742",
536
+ "activity_description_ar": "محلات بيع الإلكترونيات",
537
+ "activity_description_en": "Electronics Retail Stores",
538
+ "license_status": "Active",
539
+ "issue_date": "2020-04-24",
540
+ "expiry_date": "2025-04-23",
541
+ "location": {
542
+ "neighborhood_id": "SA-RIY-YAS",
543
+ "street_name_ar": "أنس بن مالك",
544
+ "street_name_en": "Anas Ibn Malik Rd",
545
+ "building_number": "141",
546
+ "postal_code": "13321",
547
+ "latitude": 24.7948,
548
+ "longitude": 46.6305,
549
+ "national_address": "141, Anas Ibn Malik Rd, Al Yasmin, Riyadh, 13321"
550
+ },
551
+ "source_platform": "Balady",
552
+ "last_checked": "2024-06-09T13:35:00Z"
553
+ },
554
+ {
555
+ "license_id": "BL-000024",
556
+ "cr_number": "1010456791",
557
+ "business_name_ar": "صيدلية الشفاء",
558
+ "business_name_en": "Al Shifa Pharmacy",
559
+ "activity_code_isic": "4773",
560
+ "activity_description_ar": "صيدليات",
561
+ "activity_description_en": "Pharmacies",
562
+ "license_status": "Expired",
563
+ "issue_date": "2017-11-30",
564
+ "expiry_date": "2022-11-29",
565
+ "location": {
566
+ "neighborhood_id": "SA-RIY-YAS",
567
+ "street_name_ar": "الثمامة",
568
+ "street_name_en": "Thumamah Rd",
569
+ "building_number": "62",
570
+ "postal_code": "13322",
571
+ "latitude": 24.7998,
572
+ "longitude": 46.6345,
573
+ "national_address": "62, Thumamah Rd, Al Yasmin, Riyadh, 13322"
574
+ },
575
+ "source_platform": "Balady",
576
+ "last_checked": "2024-06-05T14:00:00Z"
577
+ },
578
+ {
579
+ "license_id": "BL-000025",
580
+ "cr_number": "1010567892",
581
+ "business_name_ar": "عيادة الحياة",
582
+ "business_name_en": "Al Hayat Clinic",
583
+ "activity_code_isic": "8620",
584
+ "activity_description_ar": "عيادات طبية",
585
+ "activity_description_en": "Medical Clinics",
586
+ "license_status": "Active",
587
+ "issue_date": "2022-05-18",
588
+ "expiry_date": "2027-05-17",
589
+ "location": {
590
+ "neighborhood_id": "SA-RIY-YAS",
591
+ "street_name_ar": "شارع أبي بكر الصديق",
592
+ "street_name_en": "Abi Bakr As Siddiq Rd",
593
+ "building_number": "95",
594
+ "postal_code": "13325",
595
+ "latitude": 24.8011,
596
+ "longitude": 46.6372,
597
+ "national_address": "95, Abi Bakr As Siddiq Rd, Al Yasmin, Riyadh, 13325"
598
+ },
599
+ "source_platform": "Balady",
600
+ "last_checked": "2024-06-10T12:00:30Z"
601
+ },
602
+ {
603
+ "license_id": "BL-000026",
604
+ "cr_number": "1010678903",
605
+ "business_name_ar": "مغسلة النخبة",
606
+ "business_name_en": "Elite Laundry",
607
+ "activity_code_isic": "9602",
608
+ "activity_description_ar": "مغاسل الملابس",
609
+ "activity_description_en": "Laundry Services",
610
+ "license_status": "Active",
611
+ "issue_date": "2019-01-22",
612
+ "expiry_date": "2024-01-21",
613
+ "location": {
614
+ "neighborhood_id": "SA-RIY-YAS",
615
+ "street_name_ar": "شارع القلم",
616
+ "street_name_en": "Al Qalam St",
617
+ "building_number": "88",
618
+ "postal_code": "13326",
619
+ "latitude": 24.7923,
620
+ "longitude": 46.6415,
621
+ "national_address": "88, Al Qalam St, Al Yasmin, Riyadh, 13326"
622
+ },
623
+ "source_platform": "Balady",
624
+ "last_checked": "2024-06-09T11:50:00Z"
625
+ },
626
+ {
627
+ "license_id": "BL-000027",
628
+ "cr_number": "1010789014",
629
+ "business_name_ar": "ورشة الصقور",
630
+ "business_name_en": "Al Suqoor Workshop",
631
+ "activity_code_isic": "4520",
632
+ "activity_description_ar": "ورش صيانة السيارات",
633
+ "activity_description_en": "Auto Repair Workshops",
634
+ "license_status": "Active",
635
+ "issue_date": "2020-09-14",
636
+ "expiry_date": "2025-09-13",
637
+ "location": {
638
+ "neighborhood_id": "SA-RIY-YAS",
639
+ "street_name_ar": "أنس بن مالك",
640
+ "street_name_en": "Anas Ibn Malik Rd",
641
+ "building_number": "130",
642
+ "postal_code": "13321",
643
+ "latitude": 24.7963,
644
+ "longitude": 46.629,
645
+ "national_address": "130, Anas Ibn Malik Rd, Al Yasmin, Riyadh, 13321"
646
+ },
647
+ "source_platform": "Balady",
648
+ "last_checked": "2024-06-10T15:45:55Z"
649
+ },
650
+ {
651
+ "license_id": "BL-000028",
652
+ "cr_number": "1010890125",
653
+ "business_name_ar": "مكتب الرؤية الحديثة",
654
+ "business_name_en": "Modern Vision Office",
655
+ "activity_code_isic": "7020",
656
+ "activity_description_ar": "مكاتب استشارية صغيرة",
657
+ "activity_description_en": "Small Consulting Offices",
658
+ "license_status": "Active",
659
+ "issue_date": "2021-03-08",
660
+ "expiry_date": "2026-03-07",
661
+ "location": {
662
+ "neighborhood_id": "SA-RIY-YAS",
663
+ "street_name_ar": "الثمامة",
664
+ "street_name_en": "Thumamah Rd",
665
+ "building_number": "27",
666
+ "postal_code": "13322",
667
+ "latitude": 24.797,
668
+ "longitude": 46.6365,
669
+ "national_address": "27, Thumamah Rd, Al Yasmin, Riyadh, 13322"
670
+ },
671
+ "source_platform": "Balady",
672
+ "last_checked": "2024-06-10T14:10:10Z"
673
+ },
674
+ {
675
+ "license_id": "BL-000029",
676
+ "cr_number": "1010901236",
677
+ "business_name_ar": "محل زهور الرياض",
678
+ "business_name_en": "Riyadh Flowers Shop",
679
+ "activity_code_isic": "4776",
680
+ "activity_description_ar": "محلات بيع الزهور",
681
+ "activity_description_en": "Flower Shops",
682
+ "license_status": "Active",
683
+ "issue_date": "2018-12-21",
684
+ "expiry_date": "2023-12-20",
685
+ "location": {
686
+ "neighborhood_id": "SA-RIY-YAS",
687
+ "street_name_ar": "شارع أبي بكر الصديق",
688
+ "street_name_en": "Abi Bakr As Siddiq Rd",
689
+ "building_number": "81",
690
+ "postal_code": "13325",
691
+ "latitude": 24.7919,
692
+ "longitude": 46.634,
693
+ "national_address": "81, Abi Bakr As Siddiq Rd, Al Yasmin, Riyadh, 13325"
694
+ },
695
+ "source_platform": "Balady",
696
+ "last_checked": "2024-06-09T12:30:00Z"
697
+ },
698
+ {
699
+ "license_id": "BL-000030",
700
+ "cr_number": "1010112347",
701
+ "business_name_ar": "مكتبة القلم",
702
+ "business_name_en": "Al Qalam Bookstore",
703
+ "activity_code_isic": "4761",
704
+ "activity_description_ar": "محلات بيع الكتب",
705
+ "activity_description_en": "Bookstores",
706
+ "license_status": "Active",
707
+ "issue_date": "2020-01-10",
708
+ "expiry_date": "2025-01-09",
709
+ "location": {
710
+ "neighborhood_id": "SA-RIY-YAS",
711
+ "street_name_ar": "شارع القلم",
712
+ "street_name_en": "Al Qalam St",
713
+ "building_number": "70",
714
+ "postal_code": "13326",
715
+ "latitude": 24.8001,
716
+ "longitude": 46.639,
717
+ "national_address": "70, Al Qalam St, Al Yasmin, Riyadh, 13326"
718
+ },
719
+ "source_platform": "Balady",
720
+ "last_checked": "2024-06-10T10:05:05Z"
721
+ },
722
+ {
723
+ "license_id": "BL-000031",
724
+ "cr_number": "1010123459",
725
+ "business_name_ar": "مطعم الصحارى",
726
+ "business_name_en": "Al Sahari Restaurant",
727
+ "activity_code_isic": "5610",
728
+ "activity_description_ar": "مطاعم تقديم الطعام",
729
+ "activity_description_en": "Restaurants and Food Service",
730
+ "license_status": "Active",
731
+ "issue_date": "2021-05-05",
732
+ "expiry_date": "2026-05-04",
733
+ "location": {
734
+ "neighborhood_id": "SA-RIY-YAS",
735
+ "street_name_ar": "أنس بن مالك",
736
+ "street_name_en": "Anas Ibn Malik Rd",
737
+ "building_number": "143",
738
+ "postal_code": "13321",
739
+ "latitude": 24.799,
740
+ "longitude": 46.633,
741
+ "national_address": "143, Anas Ibn Malik Rd, Al Yasmin, Riyadh, 13321"
742
+ },
743
+ "source_platform": "Balady",
744
+ "last_checked": "2024-06-09T16:20:00Z"
745
+ },
746
+ {
747
+ "license_id": "BL-000032",
748
+ "cr_number": "1010234570",
749
+ "business_name_ar": "مقهى النسيم",
750
+ "business_name_en": "Al Naseem Cafe",
751
+ "activity_code_isic": "5630",
752
+ "activity_description_ar": "مقاهي",
753
+ "activity_description_en": "Cafes",
754
+ "license_status": "Expired",
755
+ "issue_date": "2016-07-01",
756
+ "expiry_date": "2021-06-30",
757
+ "location": {
758
+ "neighborhood_id": "SA-RIY-YAS",
759
+ "street_name_ar": "الثمامة",
760
+ "street_name_en": "Thumamah Rd",
761
+ "building_number": "99",
762
+ "postal_code": "13322",
763
+ "latitude": 24.8058,
764
+ "longitude": 46.6418,
765
+ "national_address": "99, Thumamah Rd, Al Yasmin, Riyadh, 13322"
766
+ },
767
+ "source_platform": "Balady",
768
+ "last_checked": "2024-06-05T09:30:00Z"
769
+ },
770
+ {
771
+ "license_id": "BL-000033",
772
+ "cr_number": "1010345681",
773
+ "business_name_ar": "متجر الإلكترونيات الذكية",
774
+ "business_name_en": "Smart Electronics Store",
775
+ "activity_code_isic": "4742",
776
+ "activity_description_ar": "محلات بيع الإلكترونيات",
777
+ "activity_description_en": "Electronics Retail Stores",
778
+ "license_status": "Active",
779
+ "issue_date": "2022-09-10",
780
+ "expiry_date": "2027-09-09",
781
+ "location": {
782
+ "neighborhood_id": "SA-RIY-YAS",
783
+ "street_name_ar": "شارع الملك عبدالعزيز فرع",
784
+ "street_name_en": "King Abdulaziz Rd Branch",
785
+ "building_number": "24",
786
+ "postal_code": "13325",
787
+ "latitude": 24.7982,
788
+ "longitude": 46.6323,
789
+ "national_address": "24, King Abdulaziz Rd Branch, Al Yasmin, Riyadh, 13325"
790
+ },
791
+ "source_platform": "Balady",
792
+ "last_checked": "2024-06-10T13:50:00Z"
793
+ },
794
+ {
795
+ "license_id": "BL-000034",
796
+ "cr_number": "1010456792",
797
+ "business_name_ar": "صيدلية الحياة",
798
+ "business_name_en": "Al Hayat Pharmacy",
799
+ "activity_code_isic": "4773",
800
+ "activity_description_ar": "صيدليات",
801
+ "activity_description_en": "Pharmacies",
802
+ "license_status": "Active",
803
+ "issue_date": "2020-11-22",
804
+ "expiry_date": "2025-11-21",
805
+ "location": {
806
+ "neighborhood_id": "SA-RIY-YAS",
807
+ "street_name_ar": "أنس بن مالك",
808
+ "street_name_en": "Anas Ibn Malik Rd",
809
+ "building_number": "52",
810
+ "postal_code": "13321",
811
+ "latitude": 24.7975,
812
+ "longitude": 46.6279,
813
+ "national_address": "52, Anas Ibn Malik Rd, Al Yasmin, Riyadh, 13321"
814
+ },
815
+ "source_platform": "Balady",
816
+ "last_checked": "2024-06-09T10:40:00Z"
817
+ },
818
+ {
819
+ "license_id": "BL-000035",
820
+ "cr_number": "1010567893",
821
+ "business_name_ar": "عيادة الشفاء الحديثة",
822
+ "business_name_en": "Modern Al Shifa Clinic",
823
+ "activity_code_isic": "8620",
824
+ "activity_description_ar": "عيادات طبية",
825
+ "activity_description_en": "Medical Clinics",
826
+ "license_status": "Active",
827
+ "issue_date": "2018-03-15",
828
+ "expiry_date": "2023-03-14",
829
+ "location": {
830
+ "neighborhood_id": "SA-RIY-YAS",
831
+ "street_name_ar": "الثمامة",
832
+ "street_name_en": "Thumamah Rd",
833
+ "building_number": "77",
834
+ "postal_code": "13322",
835
+ "latitude": 24.8018,
836
+ "longitude": 46.6395,
837
+ "national_address": "77, Thumamah Rd, Al Yasmin, Riyadh, 13322"
838
+ },
839
+ "source_platform": "Balady",
840
+ "last_checked": "2024-06-10T08:55:40Z"
841
+ },
842
+ {
843
+ "license_id": "BL-000036",
844
+ "cr_number": "1010678904",
845
+ "business_name_ar": "مغسلة الغد",
846
+ "business_name_en": "Al Ghad Laundry",
847
+ "activity_code_isic": "9602",
848
+ "activity_description_ar": "مغاسل الملابس",
849
+ "activity_description_en": "Laundry Services",
850
+ "license_status": "Expired",
851
+ "issue_date": "2016-02-10",
852
+ "expiry_date": "2021-02-09",
853
+ "location": {
854
+ "neighborhood_id": "SA-RIY-YAS",
855
+ "street_name_ar": "شارع أبي بكر الصديق",
856
+ "street_name_en": "Abi Bakr As Siddiq Rd",
857
+ "building_number": "65",
858
+ "postal_code": "13325",
859
+ "latitude": 24.7945,
860
+ "longitude": 46.6301,
861
+ "national_address": "65, Abi Bakr As Siddiq Rd, Al Yasmin, Riyadh, 13325"
862
+ },
863
+ "source_platform": "Balady",
864
+ "last_checked": "2024-06-04T07:15:00Z"
865
+ },
866
+ {
867
+ "license_id": "BL-000037",
868
+ "cr_number": "1010789015",
869
+ "business_name_ar": "ورشة الصيانة السريعة",
870
+ "business_name_en": "Fast Maintenance Workshop",
871
+ "activity_code_isic": "4520",
872
+ "activity_description_ar": "ورش صيانة السيارات",
873
+ "activity_description_en": "Auto Repair Workshops",
874
+ "license_status": "Active",
875
+ "issue_date": "2021-06-30",
876
+ "expiry_date": "2026-06-29",
877
+ "location": {
878
+ "neighborhood_id": "SA-RIY-YAS",
879
+ "street_name_ar": "شارع القلم",
880
+ "street_name_en": "Al Qalam St",
881
+ "building_number": "140",
882
+ "postal_code": "13326",
883
+ "latitude": 24.8007,
884
+ "longitude": 46.6337,
885
+ "national_address": "140, Al Qalam St, Al Yasmin, Riyadh, 13326"
886
+ },
887
+ "source_platform": "Balady",
888
+ "last_checked": "2024-06-10T14:55:30Z"
889
+ },
890
+ {
891
+ "license_id": "BL-000038",
892
+ "cr_number": "1010890126",
893
+ "business_name_ar": "مكتب الريادة للاستشارات",
894
+ "business_name_en": "Al Riada Consulting Office",
895
+ "activity_code_isic": "7020",
896
+ "activity_description_ar": "مكاتب استشارية صغيرة",
897
+ "activity_description_en": "Small Consulting Offices",
898
+ "license_status": "Active",
899
+ "issue_date": "2019-08-02",
900
+ "expiry_date": "2024-08-01",
901
+ "location": {
902
+ "neighborhood_id": "SA-RIY-YAS",
903
+ "street_name_ar": "أنس بن مالك",
904
+ "street_name_en": "Anas Ibn Malik Rd",
905
+ "building_number": "121",
906
+ "postal_code": "13321",
907
+ "latitude": 24.7935,
908
+ "longitude": 46.6357,
909
+ "national_address": "121, Anas Ibn Malik Rd, Al Yasmin, Riyadh, 13321"
910
+ },
911
+ "source_platform": "Balady",
912
+ "last_checked": "2024-06-09T10:10:20Z"
913
+ },
914
+ {
915
+ "license_id": "BL-000039",
916
+ "cr_number": "1010901237",
917
+ "business_name_ar": "محل زهرة الخليج",
918
+ "business_name_en": "Gulf Flower Shop",
919
+ "activity_code_isic": "4776",
920
+ "activity_description_ar": "محلات بيع الزهور",
921
+ "activity_description_en": "Flower Shops",
922
+ "license_status": "Active",
923
+ "issue_date": "2020-10-05",
924
+ "expiry_date": "2025-10-04",
925
+ "location": {
926
+ "neighborhood_id": "SA-RIY-YAS",
927
+ "street_name_ar": "الثمامة",
928
+ "street_name_en": "Thumamah Rd",
929
+ "building_number": "83",
930
+ "postal_code": "13322",
931
+ "latitude": 24.8013,
932
+ "longitude": 46.6374,
933
+ "national_address": "83, Thumamah Rd, Al Yasmin, Riyadh, 13322"
934
+ },
935
+ "source_platform": "Balady",
936
+ "last_checked": "2024-06-10T11:35:45Z"
937
+ },
938
+ {
939
+ "license_id": "BL-000040",
940
+ "cr_number": "1010112348",
941
+ "business_name_ar": "مكتبة العلم",
942
+ "business_name_en": "Al Elm Bookstore",
943
+ "activity_code_isic": "4761",
944
+ "activity_description_ar": "محلات بيع الكتب",
945
+ "activity_description_en": "Bookstores",
946
+ "license_status": "Active",
947
+ "issue_date": "2021-01-18",
948
+ "expiry_date": "2026-01-17",
949
+ "location": {
950
+ "neighborhood_id": "SA-RIY-YAS",
951
+ "street_name_ar": "شارع أبي بكر الصديق",
952
+ "street_name_en": "Abi Bakr As Siddiq Rd",
953
+ "building_number": "39",
954
+ "postal_code": "13325",
955
+ "latitude": 24.7992,
956
+ "longitude": 46.6297,
957
+ "national_address": "39, Abi Bakr As Siddiq Rd, Al Yasmin, Riyadh, 13325"
958
+ },
959
+ "source_platform": "Balady",
960
+ "last_checked": "2024-06-09T09:05:10Z"
961
+ }
962
+ ]
fake_pois_SA-RIY-YAS_openai.json ADDED
@@ -0,0 +1,212 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "poi_id": "POI-YAS-EDU-01",
4
+ "name_ar": "مدرسة الياسمين الابتدائية",
5
+ "name_en": "Al Yasmin Elementary School",
6
+ "category": "Education",
7
+ "subcategory": "Public School",
8
+ "location": {
9
+ "neighborhood_id": "SA-RIY-YAS",
10
+ "latitude": 24.7992,
11
+ "longitude": 46.6357
12
+ },
13
+ "source": "MOMRAH",
14
+ "last_verified": "2023-11-15"
15
+ },
16
+ {
17
+ "poi_id": "POI-YAS-EDU-02",
18
+ "name_ar": "روضة الياسمين الخاصة",
19
+ "name_en": "Al Yasmin Private Kindergarten",
20
+ "category": "Education",
21
+ "subcategory": "Kindergarten",
22
+ "location": {
23
+ "neighborhood_id": "SA-RIY-YAS",
24
+ "latitude": 24.8054,
25
+ "longitude": 46.6282
26
+ },
27
+ "source": "Field Survey",
28
+ "last_verified": "2024-01-20"
29
+ },
30
+ {
31
+ "poi_id": "POI-YAS-HEA-01",
32
+ "name_ar": "مستشفى الياسمين التخصصي",
33
+ "name_en": "Al Yasmin Specialist Hospital",
34
+ "category": "Healthcare",
35
+ "subcategory": "Hospital",
36
+ "location": {
37
+ "neighborhood_id": "SA-RIY-YAS",
38
+ "latitude": 24.8079,
39
+ "longitude": 46.6431
40
+ },
41
+ "source": "Ministry Website",
42
+ "last_verified": "2023-08-05"
43
+ },
44
+ {
45
+ "poi_id": "POI-YAS-HEA-02",
46
+ "name_ar": "عيادة الياسمين الطبية",
47
+ "name_en": "Al Yasmin Medical Clinic",
48
+ "category": "Healthcare",
49
+ "subcategory": "Clinic",
50
+ "location": {
51
+ "neighborhood_id": "SA-RIY-YAS",
52
+ "latitude": 24.7964,
53
+ "longitude": 46.6338
54
+ },
55
+ "source": "OpenStreetMap",
56
+ "last_verified": "2024-04-10"
57
+ },
58
+ {
59
+ "poi_id": "POI-YAS-HEA-03",
60
+ "name_ar": "صيدلية الياسمين",
61
+ "name_en": "Al Yasmin Pharmacy",
62
+ "category": "Healthcare",
63
+ "subcategory": "Pharmacy",
64
+ "location": {
65
+ "neighborhood_id": "SA-RIY-YAS",
66
+ "latitude": 24.8011,
67
+ "longitude": 46.6399
68
+ },
69
+ "source": "Commercial Listing",
70
+ "last_verified": "2023-12-02"
71
+ },
72
+ {
73
+ "poi_id": "POI-YAS-SHO-01",
74
+ "name_ar": "مركز الياسمين التجاري",
75
+ "name_en": "Al Yasmin Shopping Center",
76
+ "category": "Shopping",
77
+ "subcategory": "Mall",
78
+ "location": {
79
+ "neighborhood_id": "SA-RIY-YAS",
80
+ "latitude": 24.7998,
81
+ "longitude": 46.6415
82
+ },
83
+ "source": "GASTAT",
84
+ "last_verified": "2024-02-28"
85
+ },
86
+ {
87
+ "poi_id": "POI-YAS-SHO-02",
88
+ "name_ar": "سوق الياسمين الشعبي",
89
+ "name_en": "Al Yasmin Souq",
90
+ "category": "Shopping",
91
+ "subcategory": "Souq",
92
+ "location": {
93
+ "neighborhood_id": "SA-RIY-YAS",
94
+ "latitude": 24.7923,
95
+ "longitude": 46.6247
96
+ },
97
+ "source": "Field Survey",
98
+ "last_verified": "2023-09-18"
99
+ },
100
+ {
101
+ "poi_id": "POI-YAS-SHO-03",
102
+ "name_ar": "سوبر ماركت الياسمين",
103
+ "name_en": "Al Yasmin Supermarket",
104
+ "category": "Shopping",
105
+ "subcategory": "Supermarket",
106
+ "location": {
107
+ "neighborhood_id": "SA-RIY-YAS",
108
+ "latitude": 24.8037,
109
+ "longitude": 46.6364
110
+ },
111
+ "source": "OpenStreetMap",
112
+ "last_verified": "2024-05-12"
113
+ },
114
+ {
115
+ "poi_id": "POI-YAS-REC-01",
116
+ "name_ar": "حديقة الياسمين العامة",
117
+ "name_en": "Al Yasmin Public Park",
118
+ "category": "Recreation",
119
+ "subcategory": "Park",
120
+ "location": {
121
+ "neighborhood_id": "SA-RIY-YAS",
122
+ "latitude": 24.8083,
123
+ "longitude": 46.631
124
+ },
125
+ "source": "MOMRAH",
126
+ "last_verified": "2023-07-30"
127
+ },
128
+ {
129
+ "poi_id": "POI-YAS-GOV-01",
130
+ "name_ar": "مركز خدمات البلدية بالياسمين",
131
+ "name_en": "Al Yasmin Municipality Service Center",
132
+ "category": "Government",
133
+ "subcategory": "Municipality Office",
134
+ "location": {
135
+ "neighborhood_id": "SA-RIY-YAS",
136
+ "latitude": 24.7976,
137
+ "longitude": 46.6427
138
+ },
139
+ "source": "Ministry Website",
140
+ "last_verified": "2024-03-15"
141
+ },
142
+ {
143
+ "poi_id": "POI-YAS-REL-01",
144
+ "name_ar": "مسجد الياسمين الكبير",
145
+ "name_en": "Al Yasmin Grand Mosque",
146
+ "category": "Religious",
147
+ "subcategory": "Mosque",
148
+ "location": {
149
+ "neighborhood_id": "SA-RIY-YAS",
150
+ "latitude": 24.794,
151
+ "longitude": 46.6295
152
+ },
153
+ "source": "Field Survey",
154
+ "last_verified": "2023-10-22"
155
+ },
156
+ {
157
+ "poi_id": "POI-YAS-SER-01",
158
+ "name_ar": "مصرف الياسمين",
159
+ "name_en": "Al Yasmin Bank",
160
+ "category": "Services",
161
+ "subcategory": "Bank",
162
+ "location": {
163
+ "neighborhood_id": "SA-RIY-YAS",
164
+ "latitude": 24.8005,
165
+ "longitude": 46.6383
166
+ },
167
+ "source": "Commercial Listing",
168
+ "last_verified": "2024-06-01"
169
+ },
170
+ {
171
+ "poi_id": "POI-YAS-SER-02",
172
+ "name_ar": "صراف الياسمين الآلي",
173
+ "name_en": "Al Yasmin ATM",
174
+ "category": "Services",
175
+ "subcategory": "ATM",
176
+ "location": {
177
+ "neighborhood_id": "SA-RIY-YAS",
178
+ "latitude": 24.8029,
179
+ "longitude": 46.6345
180
+ },
181
+ "source": "OpenStreetMap",
182
+ "last_verified": "2023-11-29"
183
+ },
184
+ {
185
+ "poi_id": "POI-YAS-TRN-01",
186
+ "name_ar": "محطة حافلات الياسمين",
187
+ "name_en": "Al Yasmin Bus Station",
188
+ "category": "Transportation",
189
+ "subcategory": "Bus Station",
190
+ "location": {
191
+ "neighborhood_id": "SA-RIY-YAS",
192
+ "latitude": 24.7932,
193
+ "longitude": 46.6459
194
+ },
195
+ "source": "MOMRAH",
196
+ "last_verified": "2024-04-25"
197
+ },
198
+ {
199
+ "poi_id": "POI-YAS-EDU-03",
200
+ "name_ar": "مدرسة الياسمين العالمية",
201
+ "name_en": "Al Yasmin International School",
202
+ "category": "Education",
203
+ "subcategory": "Private School",
204
+ "location": {
205
+ "neighborhood_id": "SA-RIY-YAS",
206
+ "latitude": 24.8041,
207
+ "longitude": 46.6298
208
+ },
209
+ "source": "GASTAT",
210
+ "last_verified": "2023-12-17"
211
+ }
212
+ ]
requirements.txt ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ openai
2
+ folium
3
+ geopy
4
+ streamlit>=1.30.0
5
+ streamlit-folium>=0.14.0
6
+ python-dotenv # للاختبار المحلي للمفاتيح السرية
streamlit_app.py ADDED
@@ -0,0 +1,348 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ import streamlit as st
3
+ import os
4
+ import json
5
+ from openai import OpenAI
6
+ import folium
7
+ from folium.plugins import MarkerCluster
8
+ from geopy.distance import geodesic
9
+ from streamlit_folium import st_folium # <- لاستخدام الخرائط التفاعلية في Streamlit
10
+ import time
11
+
12
+ # --- Page Configuration (Set Title, Icon, Layout) ---
13
+ st.set_page_config(
14
+ page_title="Athar Analyzer | تحليل أثر",
15
+ page_icon="🗺️",
16
+ layout="wide",
17
+ initial_sidebar_state="expanded"
18
+ )
19
+
20
+ # --- Constants and File Paths ---
21
+ NEIGHBORHOOD_ID_TO_ANALYZE = "SA-RIY-YAS"
22
+ LAT_MIN, LAT_MAX = 24.79, 24.81
23
+ LON_MIN, LON_MAX = 46.62, 46.65
24
+ DEFAULT_MAP_CENTER = [24.80, 46.635] # مركز افتراضي لحي الياسمين
25
+ DEFAULT_MAP_ZOOM = 13
26
+
27
+ PROFILE_FILE = 'yasmen.json'
28
+ LICENSES_FILE = 'fake_licenses_SA-RIY-YAS_openai.json'
29
+ POIS_FILE = 'fake_pois_SA-RIY-YAS_openai.json'
30
+
31
+ # --- Load API Key (Use Streamlit Secrets for Deployment) ---
32
+ client = None
33
+ try:
34
+ # For Hugging Face Spaces / Streamlit Community Cloud, use st.secrets
35
+ api_key = st.secrets.get("OPENAI_API_KEY")
36
+ if not api_key:
37
+ st.warning("لم يتم العثور على مفتاح OpenAI API في Streamlit Secrets (OPENAI_API_KEY). قد لا تعمل وظائف التحليل.", icon="⚠️")
38
+ else:
39
+ client = OpenAI(api_key=api_key)
40
+ print("Streamlit App: OpenAI Client initialized successfully.")
41
+ except Exception as e:
42
+ # Fallback for local testing if .streamlit/secrets.toml doesn't exist
43
+ # Requires a .env file in the root with OPENAI_API_KEY=...
44
+ # You need to run: pip install python-dotenv
45
+ try:
46
+ from dotenv import load_dotenv
47
+ load_dotenv()
48
+ api_key = os.environ.get("OPENAI_API_KEY")
49
+ if api_key:
50
+ client = OpenAI(api_key=api_key)
51
+ print("Streamlit App: OpenAI Client initialized locally via .env.")
52
+ else:
53
+ st.error("خطأ فادح: لم يتم العثور على مفتاح OpenAI API لا في Secrets ولا في .env. يرجى إعداده.", icon="🚨")
54
+ except ImportError:
55
+ st.error("لتشغيل التطبيق محليًا مع مفتاح API، يرجى تثبيت python-dotenv وإنشاء ملف .env", icon="🚨")
56
+ except Exception as inner_e:
57
+ st.error(f"فشل إعداد OpenAI Client: {inner_e}", icon="🚨")
58
+
59
+
60
+ # --- Data Loading with Caching ---
61
+ @st.cache_data # Cache data to avoid reloading on every interaction
62
+ def load_data(profile_file, licenses_file, pois_file):
63
+ """Loads all necessary JSON data files."""
64
+ profile = None
65
+ licenses = None
66
+ pois = None
67
+ success = True
68
+ try:
69
+ script_dir = os.path.dirname(__file__)
70
+ profile_path = os.path.join(script_dir, profile_file)
71
+ with open(profile_path, 'r', encoding='utf-8') as f:
72
+ profile = json.load(f)
73
+ print(f"Streamlit App: Data loaded successfully from {profile_file}")
74
+ except Exception as e:
75
+ st.error(f"فشل تحميل ملف بيانات الحي '{profile_file}': {e}", icon="❌")
76
+ success = False
77
+
78
+ try:
79
+ script_dir = os.path.dirname(__file__)
80
+ licenses_path = os.path.join(script_dir, licenses_file)
81
+ with open(licenses_path, 'r', encoding='utf-8') as f:
82
+ licenses = json.load(f)
83
+ print(f"Streamlit App: Data loaded successfully from {licenses_file}")
84
+ except Exception as e:
85
+ st.error(f"فشل تحميل ملف التراخيص '{licenses_file}': {e}", icon="❌")
86
+ success = False
87
+
88
+ try:
89
+ script_dir = os.path.dirname(__file__)
90
+ pois_path = os.path.join(script_dir, pois_file)
91
+ with open(pois_path, 'r', encoding='utf-8') as f:
92
+ pois = json.load(f)
93
+ print(f"Streamlit App: Data loaded successfully from {pois_file}")
94
+ except Exception as e:
95
+ st.error(f"فشل تحميل ملف نقاط الاهتمام '{pois_file}': {e}", icon="❌")
96
+ # Non-critical, app might still work partially
97
+ pois = [] # Default to empty list
98
+
99
+ return profile, licenses, pois, success
100
+
101
+ neighborhood_profile, licenses_data, pois_data, data_loaded_successfully = load_data(PROFILE_FILE, LICENSES_FILE, POIS_FILE)
102
+
103
+ # --- Prepare Activity List for Dropdown (run only once after loading) ---
104
+ if 'available_activities_list' not in st.session_state and licenses_data:
105
+ activities = []
106
+ if isinstance(licenses_data, list):
107
+ seen_descs = set()
108
+ for lic in licenses_data:
109
+ desc = lic.get('activity_description_ar')
110
+ if desc and desc not in seen_descs:
111
+ activities.append(desc)
112
+ seen_descs.add(desc)
113
+ activities.sort()
114
+ st.session_state.available_activities_list = activities
115
+ print(f"Streamlit App: Found {len(activities)} unique activities.")
116
+ elif 'available_activities_list' not in st.session_state:
117
+ st.session_state.available_activities_list = []
118
+
119
+
120
+ # --- Helper Functions (Context Prep, LLM Call, Map Creation - adapted for Streamlit) ---
121
+ # (These functions remain largely the same logic as before, just ensure they work with the loaded data)
122
+ def prepare_enhanced_context_for_llm(profile, licenses, pois, selected_activity, prop_lat, prop_lon):
123
+ # ...(Implementation from previous responses)...
124
+ # Returns: context_string, proposed_location_tuple, competitors_list
125
+ if not all([profile, licenses, pois, selected_activity, prop_lat, prop_lon]): return None, None, []
126
+ neighborhood_name = profile.get('neighborhood_name_ar','N/A'); population = profile.get('demographics',{}).get('total_population','N/A')
127
+ age_dist = profile.get('demographics',{}).get('age_distribution',{}); youth_ratio_18_35 = age_dist.get('18-35',0.0)
128
+ income = profile.get('socio_economic',{}).get('estimated_avg_monthly_income_sar','N/A'); proposed_location = (prop_lat,prop_lon)
129
+ competitors = []; MAX_COMPETITORS_IN_CONTEXT = 5
130
+ for lic in licenses:
131
+ if lic.get('location',{}).get('neighborhood_id')==NEIGHBORHOOD_ID_TO_ANALYZE and lic.get('activity_description_ar')==selected_activity:
132
+ loc = lic.get('location',{}); comp_lat=loc.get('latitude'); comp_lon=loc.get('longitude')
133
+ if comp_lat and comp_lon:
134
+ try: distance = geodesic(proposed_location,(comp_lat,comp_lon)).km
135
+ except: distance = None
136
+ competitors.append({"name":lic.get('business_name_ar','N/A'),"lat":comp_lat,"lon":comp_lon,"distance_km":round(distance,2) if distance is not None else None})
137
+ competitor_count = len(competitors)
138
+ competitors.sort(key=lambda x: x.get('distance_km') if x.get('distance_km') is not None else float('inf'))
139
+ nearest_comp_info="لا يوجد منافسون." ; comp_loc_list_str="[]"
140
+ if competitors:
141
+ if competitors[0].get('distance_km') is not None: nearest_comp_info = f"أقرب منافس ~{competitors[0]['distance_km']:.2f} كم."
142
+ comp_loc_list_str=json.dumps([{'lat':c['lat'],'lon':c['lon'],'dist_km':c['distance_km']} for c in competitors[:MAX_COMPETITORS_IN_CONTEXT]], ensure_ascii=False)
143
+
144
+ poi_summary = {}; important_cats=['Education','Healthcare','Shopping','Recreation','Religious','Services']; nearby_pois=[]; MAX_NEARBY_KM=1.0
145
+ if pois:
146
+ for poi in pois:
147
+ cat=poi.get('category','N/A'); poi_summary[cat]=poi_summary.get(cat,0)+1
148
+ if cat in important_cats:
149
+ loc=poi.get('location',{}); poi_lat=loc.get('latitude'); poi_lon=loc.get('longitude')
150
+ if poi_lat and poi_lon:
151
+ try:
152
+ dist=geodesic(proposed_location,(poi_lat,poi_lon)).km
153
+ if dist<=MAX_NEARBY_KM: nearby_pois.append({"name":poi.get('name_ar','N/A'),"cat":cat,"dist_km":round(dist,2)})
154
+ except: pass
155
+ nearby_pois.sort(key=lambda x: x['dist_km'])
156
+ poi_context = "ملخص POIs: "+", ".join([f"{c}: {n}" for c,n in poi_summary.items()]) if poi_summary else "لا توجد بيانات POI."
157
+ nearby_poi_context = f"POIs هامة قريبة (ضمن {MAX_NEARBY_KM} كم): "
158
+ if nearby_pois: nearby_poi_context += ", ".join([f"{p['name']}({p['cat']})-{p['dist_km']:.2f}كم" for p in nearby_pois[:5]]) # Show top 5 nearby
159
+ else: nearby_poi_context += "لا يوجد."
160
+
161
+ context = f"""ملخص لـ {neighborhood_name}: نشاط '{selected_activity}' موقع ({prop_lat:.5f}, {prop_lon:.5f}).
162
+ - سكان: {population}, شباب(18-35): {youth_ratio_18_35:.1%}, دخل شهري: {income} ريال.
163
+ - منافسة: {competitor_count} منافسين. {nearest_comp_info}. مواقع أقرب {MAX_COMPETITORS_IN_CONTEXT}: {comp_loc_list_str}.
164
+ - محيط: {poi_context}. {nearby_poi_context}."""
165
+ print("Streamlit App: Context prepared.")
166
+ return context, proposed_location, competitors # Return competitors for map
167
+
168
+ def get_athar_analysis_enhanced(llm_client, context_summary):
169
+ # ...(Implementation from previous responses - ensure error handling)...
170
+ if not llm_client: return "خطأ: OpenAI Client غير مهيأ."
171
+ if not context_summary: return "خطأ: سياق البيانات فارغ."
172
+ analysis_prompt = f"أنت مساعد ذكي في مشروع «أثر» لتحليل فرص الاستثمار التجاري في المملكة العربية السعودية. استلم البيانات التالية وقدّم توصية استثمارية واضحة ضمن أحد الخيارات التالية: فرصة واعدة، ممكنة مع مراعاة اعتبارات محددة، موقع مشبع/غير مثالي. يرجى تضمين شرح يربط بين: مستوى المنافسة في السوق، الموقع المقترح، الخصائص الديموغرافية والاقتصادية للحي، ونقاط الاهتمام القريبة. اكتب الرد باللغة العربية ��بأسلوب مهني وواضح. البيانات: {context_summary}"
173
+ try:
174
+ print("Streamlit App: Sending request to LLM...")
175
+ completion = llm_client.chat.completions.create(
176
+ model="o4-mini", messages=[ {"role": "system", "content": "مساعد تحليل استثماري متخصص."}, {"role": "user", "content": analysis_prompt} ] )
177
+ analysis_result = completion.choices[0].message.content
178
+ print("Streamlit App: Received response from LLM.")
179
+ return analysis_result
180
+ except Exception as e:
181
+ print(f"Streamlit App Error: LLM API call failed - {e}")
182
+ st.error(f"حدث خطأ أثناء التواصل مع النموذج اللغوي: {e}", icon="🌐")
183
+ return f"عذرًا، حدث خطأ أثناء محاولة تحليل البيانات."
184
+
185
+
186
+ def create_integrated_output_map(profile, pois, competitors_list, proposed_loc, selected_activity):
187
+ """Creates the final Folium map object (does not save to file)."""
188
+ # ...(Implementation from previous responses - MUST RETURN MAP OBJECT)...
189
+ if not profile or not proposed_loc: return None
190
+ center_lat, center_lon = proposed_loc[0], proposed_loc[1]
191
+ zoom_start = 15
192
+ output_map = folium.Map(location=[center_lat, center_lon], zoom_start=zoom_start, tiles='CartoDB positron')
193
+ # Add Proposed Loc marker
194
+ folium.Marker(location=proposed_loc, popup=f"<b>الموقع المقترح</b><br>{selected_activity}", tooltip="الموقع المقترح", icon=folium.Icon(color='green', icon='star', prefix='fa')).add_to(output_map)
195
+ # Add Competitors
196
+ if competitors_list:
197
+ comp_cluster = MarkerCluster(name=f"منافسون ({selected_activity})", overlay=False, control=False).add_to(output_map) # control=False to prevent separate layer control for cluster
198
+ for comp in competitors_list:
199
+ dist_text = f"{comp['distance_km']:.2f} كم" if comp.get('distance_km') is not None else "N/A"
200
+ popup_html = f"<b>{comp['name']}</b><br><i>منافس</i><br>المسافة: {dist_text}"
201
+ folium.Marker(location=[comp['lat'], comp['lon']], popup=folium.Popup(popup_html, max_width=250),
202
+ tooltip=f"{comp['name']} (منافس)", icon=folium.Icon(color='red', icon='briefcase', prefix='fa')
203
+ ).add_to(comp_cluster)
204
+ # Add POIs
205
+ if pois:
206
+ poi_cluster = MarkerCluster(name="نقاط الاهتمام", overlay=False, control=False).add_to(output_map)
207
+ for poi in pois:
208
+ try:
209
+ loc = poi.get('location', {})
210
+ lat = loc.get('latitude'); lon = loc.get('longitude')
211
+ if lat is not None and lon is not None:
212
+ name = poi.get('name_ar','N/A'); category = poi.get('category','N/A'); subcategory = poi.get('subcategory','')
213
+ icon_name = 'info-circle'; icon_color = 'blue'
214
+ # Simplified icon logic
215
+ if 'edu' in category.lower(): icon_name='graduation-cap'; icon_color='darkblue'
216
+ elif 'health' in category.lower(): icon_name='hospital-o'; icon_color='red'
217
+ elif 'shop' in category.lower(): icon_name='shopping-cart'; icon_color='purple'
218
+ elif 'recr' in category.lower(): icon_name='tree'; icon_color='green'
219
+ elif 'relig' in category.lower(): icon_name='moon-o'; icon_color='darkgreen'
220
+ elif 'servi' in category.lower(): icon_name='bank'; icon_color='cadetblue'
221
+ popup_html = f"<b>{name}</b><br>{category} ({subcategory})"
222
+ folium.Marker(location=[lat, lon], popup=folium.Popup(popup_html, max_width=300),
223
+ tooltip=name, icon=folium.Icon(color=icon_color, icon=icon_name, prefix='fa', icon_size=(20,20))
224
+ ).add_to(poi_cluster)
225
+ except Exception as e: print(f"Map Error adding POI {poi.get('poi_id', '')}: {e}")
226
+ # Don't add LayerControl if using clusters this way, keep map cleaner
227
+ # folium.LayerControl().add_to(output_map)
228
+ print("Streamlit App: Output map object created.")
229
+ return output_map # Return the Folium map object
230
+
231
+ # --- Streamlit App UI ---
232
+
233
+ # --- Sidebar for Inputs ---
234
+ with st.sidebar:
235
+ st.image("https://raw.githubusercontent.com/MohammadAlzhrani/Athar/main/athar-high-resolution-logo-transparent.png", width=150) # استبدل برابط شعار أثر إذا وجد
236
+ st.title("📍 مدخلات تحليل أثر")
237
+ st.markdown("اختر النشاط وحدد الموقع المقترح على الخريطة.")
238
+
239
+ # 1. Activity Selection
240
+ selected_activity = st.selectbox(
241
+ "1. اختر النشاط التجاري:",
242
+ options=st.session_state.get('available_activities_list', ["الرجاء الانتظار..."]),
243
+ index=None, # No default selection
244
+ placeholder="اختر نشاطًا..."
245
+ )
246
+
247
+ # 2. Location Input Map
248
+ st.markdown("2. حدد الموقع المقترح بالنقر على الخريطة:")
249
+ # Initialize map centered on Yasmin
250
+ input_map = folium.Map(location=DEFAULT_MAP_CENTER, zoom_start=DEFAULT_MAP_ZOOM, tiles="CartoDB positron")
251
+ # Add polygon for context (optional)
252
+ try:
253
+ poly_coords = neighborhood_profile['geometry']['coordinates'][0]
254
+ folium_poly_coords = [(coord[1], coord[0]) for coord in poly_coords]
255
+ folium.Polygon(locations=folium_poly_coords, color='grey', fill=False, weight=1, tooltip="حدود حي الياسمين (تقريبي)").add_to(input_map)
256
+ except Exception as e:
257
+ print(f"Streamlit Warning: Could not draw neighborhood polygon on input map - {e}")
258
+
259
+ # Use st_folium for interactive map input
260
+ # Set a default key to avoid issues on first load if nothing is clicked
261
+ if 'map_data' not in st.session_state:
262
+ st.session_state['map_data'] = {'last_clicked': None}
263
+
264
+ map_interaction = st_folium(
265
+ input_map,
266
+ center=DEFAULT_MAP_CENTER,
267
+ zoom=DEFAULT_MAP_ZOOM,
268
+ key="input_map_interaction", # Unique key for this map instance
269
+ height=300, # Adjust height
270
+ width=700, # Adjust width
271
+ returned_objects=['last_clicked'] # We only need the last click data
272
+ )
273
+
274
+ # Store clicked coordinates in session state
275
+ if map_interaction and map_interaction.get('last_clicked'):
276
+ st.session_state['map_data'] = map_interaction # Store the whole interaction data which includes last_clicked
277
+
278
+ # Display selected coordinates for confirmation
279
+ prop_lat = None
280
+ prop_lon = None
281
+ if st.session_state['map_data'] and st.session_state['map_data'].get('last_clicked'):
282
+ clicked_data = st.session_state['map_data']['last_clicked']
283
+ prop_lat = clicked_data['lat']
284
+ prop_lon = clicked_data['lng'] # Note: st_folium uses 'lng' not 'lon'
285
+ st.info(f"📍 الموقع المحدد: ({prop_lat:.6f}, {prop_lon:.6f})", icon="✅")
286
+ else:
287
+ st.warning("الرجاء النقر على الخريطة لتحديد الموقع المقترح.", icon="👆")
288
+
289
+
290
+ # 3. Analysis Button
291
+ analyze_button = st.button("🚀 تحليل الفرصة", type="primary", disabled=(not selected_activity or prop_lat is None))
292
+
293
+ # --- Main Area for Outputs ---
294
+ st.title("📊 نتائج تحليل أثر")
295
+
296
+ if analyze_button:
297
+ if client and data_loaded_successfully and selected_activity and prop_lat and prop_lon:
298
+ st.info(f"جاري تحليل فرصة '{selected_activity}' في الموقع ({prop_lat:.5f}, {prop_lon:.5f})...", icon="⏳")
299
+
300
+ with st.spinner("جاري استدعاء النموذج وتحضير النتائج..."):
301
+ # 1. Prepare Context
302
+ analysis_context, proposed_location_tuple, competitors_list = prepare_enhanced_context_for_llm(
303
+ neighborhood_profile, licenses_data, pois_data,
304
+ selected_activity, prop_lat, prop_lon
305
+ )
306
+
307
+ # 2. Get LLM Analysis
308
+ analysis_text = "فشل في الحصول على التحليل."
309
+ if analysis_context:
310
+ analysis_text = get_athar_analysis_enhanced(client, analysis_context)
311
+
312
+ # 3. Create Output Map
313
+ output_map_object = None
314
+ if proposed_location_tuple:
315
+ output_map_object = create_integrated_output_map(
316
+ neighborhood_profile, pois_data, competitors_list,
317
+ proposed_location_tuple, selected_activity
318
+ )
319
+
320
+ # 4. Display Results
321
+ st.subheader("التوصية والتحليل:")
322
+ st.markdown(analysis_text) # Display LLM analysis as markdown
323
+
324
+ st.divider()
325
+
326
+ st.subheader("الخريطة التفاعلية للنتائج:")
327
+ if output_map_object:
328
+ # Use st_folium again to render the output map
329
+ st_folium(output_map_object,
330
+ key="output_map_display", # Different key for output map
331
+ height=500,
332
+ width=700,
333
+ returned_objects=[]) # No need to return anything from output map
334
+ else:
335
+ st.error("لم يتم إنشاء الخريطة النهائية.", icon="🗺️")
336
+
337
+ else:
338
+ # Handle missing prerequisites before analysis
339
+ if not selected_activity: st.error("الرجاء اختيار نشاط تجاري من الشريط الجانبي أولاً.", icon="👈")
340
+ if prop_lat is None or prop_lon is None: st.error("الرجاء تحديد الموقع المقترح على الخريطة في الشريط الجانبي أولاً.", icon="👈")
341
+ if not client: st.error("خطأ في تهيئة OpenAI. يرجى التحقق من المفتاح السري.", icon="🔑")
342
+ if not data_loaded_successfully: st.error("فشل ت��ميل البيانات الأساسية. لا يمكن إجراء التحليل.", icon="💾")
343
+
344
+ else:
345
+ st.info("اختر نشاطًا وحدد موقعًا من الشريط الجانبي ثم اضغط على زر التحليل.")
346
+
347
+ st.sidebar.markdown("---")
348
+ st.sidebar.markdown("*بيانات وهمية لأغراض العرض.*")
yasmen.json ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "neighborhood_id": "SA-RIY-YAS",
3
+ "neighborhood_name_ar": "الياسمين",
4
+ "neighborhood_name_en": "Al Yasmin",
5
+ "city_ar": "الرياض",
6
+ "city_en": "Riyadh",
7
+ "province_ar": "منطقة الرياض",
8
+ "province_en": "Riyadh Province",
9
+ "geometry": {
10
+ "type": "Polygon",
11
+ "coordinates": [
12
+ [
13
+ [46.63, 24.79],
14
+ [46.65, 24.80],
15
+ [46.64, 24.81],
16
+ [46.62, 24.80],
17
+ [46.63, 24.79]
18
+ ]
19
+ ]
20
+ },
21
+ "demographics": {
22
+ "data_as_of": "2024-12-31",
23
+ "total_population": 55200,
24
+ "population_density_km2": 4500,
25
+ "age_distribution": {
26
+ "0-17": 0.25,
27
+ "18-35": 0.40,
28
+ "36-55": 0.28,
29
+ "56+": 0.07
30
+ },
31
+ "household_avg_size": 4.5
32
+ },
33
+ "socio_economic": {
34
+ "data_as_of": "2024-12-31",
35
+ "estimated_avg_monthly_income_sar": 11500,
36
+ "estimated_spending_power_index": 1.15
37
+ },
38
+ "infrastructure": {
39
+ "schools_count": 15,
40
+ "hospitals_clinics_count": 8,
41
+ "parks_count": 5,
42
+ "major_roads": [
43
+ "King Salman Rd",
44
+ "Abu Bakr As Siddiq Branch Rd"
45
+ ]
46
+ },
47
+ "last_updated": "2025-04-28T14:30:00Z"
48
+ }