openzim/python-libzim

Support iterators

rgaudin opened this issue · 15 comments

Archive needs support for a few iterators:

  • Archive.iterByPath()
  • Archive.iterByTitle()
  • Archive.iterEfficient() (arguable)
  • Archive.findByPath(path)
  • Archive.findByTitle(title)

Awaiting this to remove Archive.get_entry_by_id(), Entry.index and Item.index as it's the only way to loop over the zim content at the moment and we use it in tests.

It would be nice to have a "default" iterator (iterEfficient?) on Archive itself.

This way we could iterate over archive with :

archive = Archive("foo.zim")
for entry in archive:
    print(entry.title)

absolutely 👍

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.