I am trying to get all data from view(Lotus Notes) with lotusscript and Python(noteslib module) and export it to csv, but problem is that this takes too much time. I have tried two ways with loop through all documents:
import noteslib
db = noteslib.Database('database','file.nsf')
view = db.GetView('My View')
doc = view.GetFirstDocument()
data = list()
while doc:
data.append(doc.ColumnValues)
doc = view.GetNextDocument(doc)
To get about 1000 lines of data it took me 70 seconds, but view has about 85000 lines so get all data will be too much time, because manually when I use File->Export in Lotus Notes it is about 2 minutes to export all data to csv.
And I tried second way with AllEntries, but it was even slower:
database = []
ec = view.AllEntries
ent = ec.Getfirstentry()
while ent:
row = []
for v in ent.Columnvalues:
row.append(v)
database.append(row)
ent = ec.GetNextEntry(ent)
Everything that I found on the Internet is based on "NextDocument" or "AllEntries". Is there any way to do it faster?
NotesViewNavigator. That's very efficient, but I don't know if the Python module has something similar. Fwiw, here's the documentation onNotesViewNavigator: ibm.com/support/knowledgecenter/en/SSVRGU_9.0.1/basic/… - Dave Delaydb = noteslib.CurrentDatabase view = db.GetView('My view') nav = view.CreateViewNav() doc = nav.GetFirst() view.AutoUpdate = False list_of_data = [] for i in range(1000): list_of_data.append(doc.ColumnValues) doc = nav.Getnext(doc)It took about 146 seconds to get 1000 rows of data. - Ala Cris