|
35 | 35 | },
|
36 | 36 | {
|
37 | 37 | "cell_type": "code",
|
38 |
| - "execution_count": 8, |
| 38 | + "execution_count": 1, |
39 | 39 | "metadata": {},
|
40 | 40 | "outputs": [],
|
41 | 41 | "source": [
|
|
44 | 44 | "\n",
|
45 | 45 | "import pandas as pd\n",
|
46 | 46 | "\n",
|
47 |
| - "from arcgis.gis import GIS\n", |
48 |
| - "\n", |
| 47 | + "from arcgis.gis import GIS" |
| 48 | + ] |
| 49 | + }, |
| 50 | + { |
| 51 | + "cell_type": "code", |
| 52 | + "execution_count": 2, |
| 53 | + "metadata": {}, |
| 54 | + "outputs": [], |
| 55 | + "source": [ |
49 | 56 | "gis = GIS(\"home\")"
|
50 | 57 | ]
|
51 | 58 | },
|
52 | 59 | {
|
53 | 60 | "cell_type": "markdown",
|
54 | 61 | "metadata": {},
|
55 | 62 | "source": [
|
56 |
| - "Then, let's create a list containing strings that represent all the values that your organization requires (beyond the required attributes for a valid user profile)." |
| 63 | + "Then, let's create a list containing strings that represent all the values that your organization requires (beyond the required attributes for a valid user profile).\n", |
| 64 | + "\n", |
| 65 | + "`access_type` refers to the `User.access` property of a user and it indicates the level of access of the user: private, org, or public.\n", |
| 66 | + "\n", |
| 67 | + "While `access_type` may not be a requirement for your organization to validate a user profile, we have added it here to demonstrate how other useful properties can also be extracted for each user profile to learn more about them. " |
57 | 68 | ]
|
58 | 69 | },
|
59 | 70 | {
|
60 | 71 | "cell_type": "code",
|
61 |
| - "execution_count": 2, |
| 72 | + "execution_count": 3, |
62 | 73 | "metadata": {},
|
63 | 74 | "outputs": [],
|
64 | 75 | "source": [
|
65 |
| - "complete_profile = ['description', 'thumbnail', 'access']" |
| 76 | + "complete_profile = ['description', 'thumbnail', 'access', 'access_type']" |
66 | 77 | ]
|
67 | 78 | },
|
68 | 79 | {
|
|
74 | 85 | },
|
75 | 86 | {
|
76 | 87 | "cell_type": "code",
|
77 |
| - "execution_count": 3, |
| 88 | + "execution_count": 4, |
78 | 89 | "metadata": {},
|
79 | 90 | "outputs": [],
|
80 | 91 | "source": [
|
81 | 92 | "def get_missing_profile_attrs(member):\n",
|
82 | 93 | " non_compliance = []\n",
|
83 | 94 | " for attr in complete_profile:\n",
|
84 |
| - " if getattr(member, attr) == None:\n", |
85 |
| - " non_compliance.append(False)\n", |
| 95 | + " if attr=='access_type':\n", |
| 96 | + " non_compliance.append(member.access)\n", |
86 | 97 | " else:\n",
|
87 |
| - " non_compliance.append(True)\n", |
| 98 | + " if getattr(member, attr) == None: \n", |
| 99 | + " non_compliance.append(False)\n", |
| 100 | + " else:\n", |
| 101 | + " non_compliance.append(True)\n", |
88 | 102 | " return non_compliance"
|
89 | 103 | ]
|
90 | 104 | },
|
|
97 | 111 | },
|
98 | 112 | {
|
99 | 113 | "cell_type": "code",
|
100 |
| - "execution_count": 4, |
| 114 | + "execution_count": 5, |
101 | 115 | "metadata": {},
|
102 | 116 | "outputs": [],
|
103 | 117 | "source": [
|
|
116 | 130 | },
|
117 | 131 | {
|
118 | 132 | "cell_type": "code",
|
119 |
| - "execution_count": 5, |
| 133 | + "execution_count": 6, |
120 | 134 | "metadata": {},
|
121 | 135 | "outputs": [
|
122 | 136 | {
|
|
143 | 157 | " <th>description</th>\n",
|
144 | 158 | " <th>thumbnail</th>\n",
|
145 | 159 | " <th>access</th>\n",
|
| 160 | + " <th>access_type</th>\n", |
146 | 161 | " </tr>\n",
|
147 | 162 | " </thead>\n",
|
148 | 163 | " <tbody>\n",
|
149 | 164 | " <tr>\n",
|
150 |
| - " <th>user001</th>\n", |
| 165 | + " <th>achapkowski_geosaurus</th>\n", |
151 | 166 | " <td>False</td>\n",
|
152 | 167 | " <td>False</td>\n",
|
153 | 168 | " <td>True</td>\n",
|
| 169 | + " <td>org</td>\n", |
154 | 170 | " </tr>\n",
|
155 | 171 | " <tr>\n",
|
156 |
| - " <th>viewer002</th>\n", |
157 |
| - " <td>False</td>\n", |
158 |
| - " <td>False</td>\n", |
| 172 | + " <th>amani_geosaurus</th>\n", |
| 173 | + " <td>True</td>\n", |
| 174 | + " <td>True</td>\n", |
159 | 175 | " <td>True</td>\n",
|
| 176 | + " <td>public</td>\n", |
160 | 177 | " </tr>\n",
|
161 | 178 | " <tr>\n",
|
162 |
| - " <th>primary_admin</th>\n", |
163 |
| - " <td>False</td>\n", |
164 |
| - " <td>False</td>\n", |
| 179 | + " <th>andrew57</th>\n", |
| 180 | + " <td>True</td>\n", |
165 | 181 | " <td>True</td>\n",
|
| 182 | + " <td>True</td>\n", |
| 183 | + " <td>private</td>\n", |
166 | 184 | " </tr>\n",
|
167 | 185 | " <tr>\n",
|
168 |
| - " <th>publisher001</th>\n", |
| 186 | + " <th>api_data_owner</th>\n", |
169 | 187 | " <td>False</td>\n",
|
170 | 188 | " <td>False</td>\n",
|
171 | 189 | " <td>True</td>\n",
|
| 190 | + " <td>org</td>\n", |
| 191 | + " </tr>\n", |
| 192 | + " <tr>\n", |
| 193 | + " <th>arcgis_python</th>\n", |
| 194 | + " <td>True</td>\n", |
| 195 | + " <td>True</td>\n", |
| 196 | + " <td>True</td>\n", |
| 197 | + " <td>public</td>\n", |
172 | 198 | " </tr>\n",
|
173 | 199 | " </tbody>\n",
|
174 | 200 | "</table>\n",
|
175 | 201 | "</div>"
|
176 | 202 | ],
|
177 | 203 | "text/plain": [
|
178 |
| - " description thumbnail access\n", |
179 |
| - "user001 False False True\n", |
180 |
| - "viewer002 False False True\n", |
181 |
| - "primary_admin False False True\n", |
182 |
| - "publisher001 False False True" |
| 204 | + " description thumbnail access access_type\n", |
| 205 | + "achapkowski_geosaurus False False True org\n", |
| 206 | + "amani_geosaurus True True True public\n", |
| 207 | + "andrew57 True True True private\n", |
| 208 | + "api_data_owner False False True org\n", |
| 209 | + "arcgis_python True True True public" |
183 | 210 | ]
|
184 | 211 | },
|
185 |
| - "execution_count": 5, |
| 212 | + "execution_count": 6, |
186 | 213 | "metadata": {},
|
187 | 214 | "output_type": "execute_result"
|
188 | 215 | }
|
189 | 216 | ],
|
190 | 217 | "source": [
|
191 | 218 | "user_profile_df = pd.DataFrame(data=user_profile_status, index=complete_profile).T\n",
|
192 |
| - "user_profile_df" |
| 219 | + "user_profile_df.head()" |
193 | 220 | ]
|
194 | 221 | },
|
195 | 222 | {
|
|
201 | 228 | },
|
202 | 229 | {
|
203 | 230 | "cell_type": "code",
|
204 |
| - "execution_count": 9, |
| 231 | + "execution_count": 7, |
205 | 232 | "metadata": {},
|
206 | 233 | "outputs": [],
|
207 | 234 | "source": [
|
|
221 | 248 | },
|
222 | 249 | {
|
223 | 250 | "cell_type": "code",
|
224 |
| - "execution_count": 10, |
| 251 | + "execution_count": 8, |
225 | 252 | "metadata": {},
|
226 | 253 | "outputs": [
|
227 | 254 | {
|
228 | 255 | "data": {
|
229 | 256 | "text/html": [
|
230 | 257 | "<div class=\"item_container\" style=\"height: auto; overflow: hidden; border: 1px solid #cfcfcf; border-radius: 2px; background: #f6fafa; line-height: 1.21429em; padding: 10px;\">\n",
|
231 | 258 | " <div class=\"item_left\" style=\"width: 210px; float: left;\">\n",
|
| 259 | + " <a href='https://geosaurus.maps.arcgis.com/home/item.html?id=9f077933498c41fbb222ee95fee23102' target='_blank'>\n", |
| 260 | + " <img src='http://static.arcgis.com/images/desktopapp.png' class=\"itemThumbnail\">\n", |
| 261 | + " </a>\n", |
232 | 262 | " </div>\n",
|
233 | 263 | "\n",
|
234 | 264 | " <div class=\"item_right\" style=\"float: none; width: auto; overflow: hidden;\">\n",
|
235 |
| - " <b>output_org_user_profile_1547747903</b>\n", |
236 |
| - " <br/>CSV by primary_admin\n", |
237 |
| - " <br/>Last Modified: January 17, 2019\n", |
| 265 | + " <a href='https://geosaurus.maps.arcgis.com/home/item.html?id=9f077933498c41fbb222ee95fee23102' target='_blank'><b>output_org_user_profile_1686349431</b>\n", |
| 266 | + " </a>\n", |
| 267 | + " <br/><img src='https://geosaurus.maps.arcgis.com/home/js/jsapi/esri/css/images/item_type_icons/layers16.png' style=\"vertical-align:middle;\">CSV by MMajumdar_geosaurus\n", |
| 268 | + " <br/>Last Modified: June 09, 2023\n", |
238 | 269 | " <br/>0 comments, 0 views\n",
|
239 | 270 | " </div>\n",
|
240 | 271 | " </div>\n",
|
241 | 272 | " "
|
242 | 273 | ],
|
243 | 274 | "text/plain": [
|
244 |
| - "<Item title:\"output_org_user_profile_1547747903\" type:CSV owner:primary_admin>" |
| 275 | + "<Item title:\"output_org_user_profile_1686349431\" type:CSV owner:MMajumdar_geosaurus>" |
245 | 276 | ]
|
246 | 277 | },
|
247 |
| - "execution_count": 10, |
| 278 | + "execution_count": 8, |
248 | 279 | "metadata": {},
|
249 | 280 | "output_type": "execute_result"
|
250 | 281 | }
|
|
253 | 284 | "gis.content.add({}, output_dir + out_file)"
|
254 | 285 | ]
|
255 | 286 | },
|
| 287 | + { |
| 288 | + "cell_type": "markdown", |
| 289 | + "metadata": {}, |
| 290 | + "source": [ |
| 291 | + "You may download this item if you wish, and if you decide to delete this item after having used it, you may run the script below by updating the `item_id` with the id of this file in your organization." |
| 292 | + ] |
| 293 | + }, |
| 294 | + { |
| 295 | + "cell_type": "code", |
| 296 | + "execution_count": null, |
| 297 | + "metadata": {}, |
| 298 | + "outputs": [], |
| 299 | + "source": [ |
| 300 | + "item = gis.content.get(item_id)\n", |
| 301 | + "item.delete()" |
| 302 | + ] |
| 303 | + }, |
256 | 304 | {
|
257 | 305 | "cell_type": "markdown",
|
258 | 306 | "metadata": {},
|
|
283 | 331 | "name": "python",
|
284 | 332 | "nbconvert_exporter": "python",
|
285 | 333 | "pygments_lexer": "ipython3",
|
286 |
| - "version": "3.9.11" |
| 334 | + "version": "3.7.16" |
287 | 335 | },
|
288 | 336 | "toc": {
|
289 | 337 | "base_numbering": 1,
|
|
0 commit comments