<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Calculate folder size to identify empty/0 bytes folders using python API in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Calculate-folder-size-to-identify-empty-0-bytes-folders-using/m-p/628133#M29034</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1578873"&gt;@_shintaku_&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;I can't find 'size' attribute for folders in my requests response, my code is:-&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Hi &lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1578873"&gt;@_shintaku_&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;You can't find 'size' attribute cosa there is NOT such. Only files eventually residing in particular folder have such attribute on enumeration. To calculate total size, you need to enumerate entire folder content recursively and sum all files size (I'm still not certain that you need it actually).&lt;/P&gt;&lt;P&gt;You task can get up much easier if you check only for available entries in particular folder. If there are no any entries (files or folders) the folder is... empty. Isn't it much easier (no recursion, no calculations, etc)? On the post you provide link to, Greg posted some additional helpful tips, able to help&amp;nbsp;automation for such a process (changes detection). Is something left no clear there?&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
    <pubDate>Sun, 09 Oct 2022 13:03:35 GMT</pubDate>
    <dc:creator>Здравко</dc:creator>
    <dc:date>2022-10-09T13:03:35Z</dc:date>
    <item>
      <title>Calculate folder size to identify empty/0 bytes folders using python API</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Calculate-folder-size-to-identify-empty-0-bytes-folders-using/m-p/628105#M29033</link>
      <description>&lt;P&gt;Am trying to implement an API automation process to identify empty/0 bytes folders so I can delete them, similar to what was asked &lt;A href="https://www.dropboxforum.com/t5/Apps-and-Installations/Automation/m-p/513984#M32289" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can't find 'size' attribute for folders in my requests response, my code is:-&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;import requests
import json

url = "https://api.dropboxapi.com/2/files/list_folder"

headers = {
"Authorization": "Bearer &amp;lt;access-token&amp;gt;",
"Content-Type": "application/json"
}

data = {
"path": "/Cat Watching Test",
"recursive": True
}

r = requests.post(url, headers=headers, data=json.dumps(data))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do I calculate the size of folders from the API?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2022-10-09 091339.png" style="width: 800px;"&gt;&lt;img src="https://www.dropboxforum.com/t5/image/serverpage/image-id/32262i53B7354B934B735E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2022-10-09 091339.png" alt="Screenshot 2022-10-09 091339.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 09:29:48 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Calculate-folder-size-to-identify-empty-0-bytes-folders-using/m-p/628105#M29033</guid>
      <dc:creator>_shintaku_</dc:creator>
      <dc:date>2022-10-10T09:29:48Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate folder size to identify empty/0 bytes folders using python API</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Calculate-folder-size-to-identify-empty-0-bytes-folders-using/m-p/628133#M29034</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1578873"&gt;@_shintaku_&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;I can't find 'size' attribute for folders in my requests response, my code is:-&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Hi &lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1578873"&gt;@_shintaku_&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;You can't find 'size' attribute cosa there is NOT such. Only files eventually residing in particular folder have such attribute on enumeration. To calculate total size, you need to enumerate entire folder content recursively and sum all files size (I'm still not certain that you need it actually).&lt;/P&gt;&lt;P&gt;You task can get up much easier if you check only for available entries in particular folder. If there are no any entries (files or folders) the folder is... empty. Isn't it much easier (no recursion, no calculations, etc)? On the post you provide link to, Greg posted some additional helpful tips, able to help&amp;nbsp;automation for such a process (changes detection). Is something left no clear there?&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Sun, 09 Oct 2022 13:03:35 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Calculate-folder-size-to-identify-empty-0-bytes-folders-using/m-p/628133#M29034</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2022-10-09T13:03:35Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate folder size to identify empty/0 bytes folders using python API</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Calculate-folder-size-to-identify-empty-0-bytes-folders-using/m-p/629312#M29063</link>
      <description>&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Your suggestion on checking folder for entries was what I used.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 15:49:14 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Calculate-folder-size-to-identify-empty-0-bytes-folders-using/m-p/629312#M29063</guid>
      <dc:creator>_shintaku_</dc:creator>
      <dc:date>2022-10-14T15:49:14Z</dc:date>
    </item>
  </channel>
</rss>

