{
"total": <total number of resources on the item>,
"start": <the first record index in the response>,
"num": <the number of resources in the response>,
"nextStart": <the next entry index>,
"resources": [
{
"resource": "<resource1>",
"created": <resource1 created datetime>,
"size": <resource1 size>
},
{
"resource": "<resource2>",
"created": <resource2 created datetime>,
"size": <resource2 size>
},
{
"resource": "<resource3>",
"created": <resource3 created datetime>,
"size": <resource3 size>
}
]
}
Solved! Go to Solution.
It's coming from the Item class, but there do seem to be a number of properties there that are not fully documented in the API docs. Calling dir(Item) on a Feature Layer, for instance, I see:
[
...
'title',
'type',
'snippet',
...
]
And other properties not listed. Interestingly, the documentation for the Item.update() method lists the various item properties that can be updated, and such properties are listed there!
I've also noticed that the contents of dir(Item) actually changes based on the item's type.
for i in gis.content.search('', max_items=-1):
print(f'Length of dir: {len(dir(i))} Type: {i.type}')
Length of dir: 143 Type: PDF Length of dir: 145 Type: Feature Service Length of dir: 144 Type: Feature Service Length of dir: 142 Type: Form Length of dir: 142 Type: Web Map
But that may be besides the point. The size property does seem to be consistently present across item types. There have been instances when the API docs just needed correcting.You could always submit a bug report at the Python API's GitHub repo.
It's coming from the Item class, but there do seem to be a number of properties there that are not fully documented in the API docs. Calling dir(Item) on a Feature Layer, for instance, I see:
[
...
'title',
'type',
'snippet',
...
]
And other properties not listed. Interestingly, the documentation for the Item.update() method lists the various item properties that can be updated, and such properties are listed there!
I've also noticed that the contents of dir(Item) actually changes based on the item's type.
for i in gis.content.search('', max_items=-1):
print(f'Length of dir: {len(dir(i))} Type: {i.type}')
Length of dir: 143 Type: PDF Length of dir: 145 Type: Feature Service Length of dir: 144 Type: Feature Service Length of dir: 142 Type: Form Length of dir: 142 Type: Web Map
But that may be besides the point. The size property does seem to be consistently present across item types. There have been instances when the API docs just needed correcting.You could always submit a bug report at the Python API's GitHub repo.
Nice, thanks @jcarlson
dot tab after item did not show in the docstring any size property, but like you said, dir() does:
Also just noticed that in the second for loop in the try block of the API code sample, it should be user.items(folder=f), not user.folders(folder=f).
The API does not have any folders method for any of the classes in the arcgis.gis module
I will raise an issue in the API repo.