Repository navigation
Conversation
benoit74
force-pushed
the
benoit74/support-iterators
branch
from
October 29, 2026 13:56
9399c81 to
c050d39
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #294 +/- ##
==========================================
+ Coverage 95.29% 95.56% +0.26%
==========================================
Files 1 1
Lines 638 676 +38
==========================================
+ Hits 608 646 +38
Misses 30 30 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
Author
|
Just added a usage example in README.md |
benoit74
force-pushed
the
benoit74/support-iterators
branch
2 times, most recently
from
October 30, 2026 10:11
ec36dfd to
2b33df1
Compare
Add Archive.iter_by_path(), iter_by_title(), iter_efficient(), __iter__() (alias for iter_efficient()), find_by_path() and find_by_title(), wrapping libzim's Archive::iterByPath/iterByTitle/iterEfficient/findByPath/findByTitle. This removes the need to loop over entries via get_entry_by_id() and all_entry_count, as previously required (fixes #94).
benoit74
force-pushed
the
benoit74/support-iterators
branch
from
November 2, 2026 15:06
2b33df1 to
0078565
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Archive.iter_by_path(),Archive.iter_by_title()andArchive.iter_efficient()to iterate over all entries in path order, title order, or the most efficient order to read themArchive.__iter__()as an alias foriter_efficient(), sofor entry in archive:works directlyArchive.find_by_path(path)andArchive.find_by_title(title)to iterate over entries whose path/title starts with a given prefixThese wrap libzim's
Archive::iterByPath/iterByTitle/iterEfficient/findByPath/findByTitle, and remove the need for theget_entry_by_id()+all_entry_countworkaround previously used to loop over ZIM content.Closes #94.