<?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: Retrieve with a File limit and File count in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Re-Retrieve-with-a-File-limit-and-File-count/m-p/383396#M21337</link>
    <description>&lt;P&gt;I'm looking for a way to get the count of entries from this python api call:&lt;/P&gt;
&lt;PRE&gt;e=dbx.files_list_folder('/myfolder').entries&lt;/PRE&gt;
&lt;P&gt;None of the following work:&lt;/P&gt;
&lt;PRE&gt;&amp;gt;&amp;gt;&amp;gt; print(e.count)
&amp;lt;built-in method count of list object at 0x107dcd098&amp;gt;

&amp;gt;&amp;gt;&amp;gt; print(e.size)
Traceback (most recent call last):
  File "&amp;lt;stdin&amp;gt;", line 1, in &amp;lt;module&amp;gt;
AttributeError: 'list' object has no attribute 'size'

&amp;gt;&amp;gt;&amp;gt; print(e.list)
Traceback (most recent call last):
  File "&amp;lt;stdin&amp;gt;", line 1, in &amp;lt;module&amp;gt;
AttributeError: 'list' object has no attribute 'list'&lt;/PRE&gt;
&lt;P&gt;I can iterate and increment in a for loop but would prefer to use an existing method:&lt;/P&gt;
&lt;PRE&gt;i=0
for entry in dbx.files_list_folder('/myfolder').entries:
    i=i+1

print(i)&lt;/PRE&gt;
&lt;P&gt;Is there a way to get the count of the files returned without actually iterating through the list?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 10 Dec 2019 17:12:28 GMT</pubDate>
    <dc:creator>ipico</dc:creator>
    <dc:date>2019-12-10T17:12:28Z</dc:date>
    <item>
      <title>Re: Retrieve with a File limit and File count</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Re-Retrieve-with-a-File-limit-and-File-count/m-p/383396#M21337</link>
      <description>&lt;P&gt;I'm looking for a way to get the count of entries from this python api call:&lt;/P&gt;
&lt;PRE&gt;e=dbx.files_list_folder('/myfolder').entries&lt;/PRE&gt;
&lt;P&gt;None of the following work:&lt;/P&gt;
&lt;PRE&gt;&amp;gt;&amp;gt;&amp;gt; print(e.count)
&amp;lt;built-in method count of list object at 0x107dcd098&amp;gt;

&amp;gt;&amp;gt;&amp;gt; print(e.size)
Traceback (most recent call last):
  File "&amp;lt;stdin&amp;gt;", line 1, in &amp;lt;module&amp;gt;
AttributeError: 'list' object has no attribute 'size'

&amp;gt;&amp;gt;&amp;gt; print(e.list)
Traceback (most recent call last):
  File "&amp;lt;stdin&amp;gt;", line 1, in &amp;lt;module&amp;gt;
AttributeError: 'list' object has no attribute 'list'&lt;/PRE&gt;
&lt;P&gt;I can iterate and increment in a for loop but would prefer to use an existing method:&lt;/P&gt;
&lt;PRE&gt;i=0
for entry in dbx.files_list_folder('/myfolder').entries:
    i=i+1

print(i)&lt;/PRE&gt;
&lt;P&gt;Is there a way to get the count of the files returned without actually iterating through the list?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2019 17:12:28 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Re-Retrieve-with-a-File-limit-and-File-count/m-p/383396#M21337</guid>
      <dc:creator>ipico</dc:creator>
      <dc:date>2019-12-10T17:12:28Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve with a File limit and File count</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Re-Retrieve-with-a-File-limit-and-File-count/m-p/383419#M21338</link>
      <description>&lt;P&gt;The&amp;nbsp;&lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/files.html#dropbox.files.ListFolderResult.entries" target="_self"&gt;ListFolderResult.entries&lt;/A&gt; returned by&amp;nbsp;&lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox.Dropbox.files_list_folder" target="_self"&gt;files_list_folder&lt;/A&gt; is a 'list' so you can use Python's '&lt;A href="https://docs.python.org/3.6/library/functions.html#len" target="_self"&gt;len&lt;/A&gt;' function to get its length, like this:&lt;/P&gt;
&lt;PRE&gt;print(len(dbx.files_list_folder('/myfolder').entries))&lt;/PRE&gt;
&lt;P&gt;Please note though that you're not guaranteed&amp;nbsp;to get all of the files/folders in a particular folder back in a single call to&amp;nbsp;&lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox.Dropbox.files_list_folder" target="_self"&gt;files_list_folder&lt;/A&gt;. If&amp;nbsp;&lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/files.html#dropbox.files.ListFolderResult.has_more" target="_self"&gt;ListFolderResult.has_more&lt;/A&gt; is 'true' you need to call back to&amp;nbsp;&lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox.Dropbox.files_list_folder_continue" target="_self"&gt;files_list_folder_continue&lt;/A&gt; for more entries. Check out &lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox.Dropbox.files_list_folder" target="_self"&gt;the&amp;nbsp;files_list_folder documentation&lt;/A&gt; for more information.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2019 17:08:49 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Re-Retrieve-with-a-File-limit-and-File-count/m-p/383419#M21338</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2019-12-10T17:08:49Z</dc:date>
    </item>
  </channel>
</rss>

