Skip to content

Commit

Permalink
Update 08. Explore URL ACC Extract.ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
chuongmep committed Mar 7, 2024
1 parent 3200366 commit cb0025b
Showing 1 changed file with 116 additions and 4 deletions.
120 changes: 116 additions & 4 deletions APSToolkitPython/Tutorials/08. Explore URL ACC Extract.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -26,7 +26,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 2,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -83,7 +83,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 3,
"metadata": {},
"outputs": [
{
Expand All @@ -104,6 +104,118 @@
"urn = urn.replace(\"/\", \"_\")\n",
"print(f\"Derivative URN Of Version {version}: {urn}\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This URN not it correct urn we need : https://stackoverflow.com/questions/78118458/convert-urn-from-item-version-have-problem/78120646#78120646"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## This is next step to get derivative URN\n"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"from aps_toolkit import BIM360\n",
"from aps_toolkit import Auth"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"token = Auth().auth2leg()\n",
"bim360 = BIM360(token)"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>item_id</th>\n",
" <th>version</th>\n",
" <th>derivative_urn</th>\n",
" <th>last_modified_time</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>urn%3Aadsk.wipprod%3Adm.lineage%3AoxAqhUL0SISd...</td>\n",
" <td>2</td>\n",
" <td>dXJuOmFkc2sud2lwcHJvZDpmcy5maWxlOnZmLm94QXFoVU...</td>\n",
" <td>2024-03-06T13:59:04.0000000Z</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" item_id ... last_modified_time\n",
"0 urn%3Aadsk.wipprod%3Adm.lineage%3AoxAqhUL0SISd... ... 2024-03-06T13:59:04.0000000Z\n",
"\n",
"[1 rows x 4 columns]"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df = bim360.batch_report_item_versions(info['ProjectId'], info['entityId'])\n",
"df"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"dXJuOmFkc2sud2lwcHJvZDpmcy5maWxlOnZmLm94QXFoVUwwU0lTZGtQY05MemVoYWc_dmVyc2lvbj0y\n"
]
}
],
"source": [
"print(df.iloc[0]['derivative_urn'])"
]
}
],
"metadata": {
Expand All @@ -122,7 +234,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.5"
"version": "3.11.1"
}
},
"nbformat": 4,
Expand Down

0 comments on commit cb0025b

Please sign in to comment.