@@ -705,35 +705,32 @@ you can delete entries using the low-level
705705
706706
707707
708- .. _ pagination :
708+ .. _ opml :
709709
710- Pagination
711- ----------
710+ OPML import / export
711+ --------------------
712712
713- :meth: ` ~Reader.get_feeds `, :meth: ` ~Reader.get_entries `,
714- and :meth: `~Reader.search_entries `
715- can be used in a paginated fashion.
713+ You can import and export feeds from and to an ` OPML subscription list `_
714+ by using the :meth: `~Reader.import_feeds `
715+ and :meth: ` ~Reader.export_feeds ` methods::
716716
717- The ``limit `` argument allows limiting the number of results returned;
718- the ``starting_after `` argument allows skipping results until after
719- a specific one.
720-
721- To get the first page, use only ``limit ``::
722-
723- >>> for entry in reader.get_entries(limit=2):
724- ... print(entry.title)
717+ >>> export = reader.export_feeds()
718+ >>> export.filename
719+ 'reader-feeds-2026-04-24-10-00-00.opml'
720+ >>> with open(export.filename, 'wb') as f:
721+ ... f.write(export.content)
725722 ...
726- H.I. #136: Dog Bingo
727- H.I. #135: Place Your Bets
723+ >>> # with another reader instance
724+ >>> reader = make_reader(':memory:')
725+ >>> with open(export.filename, 'rb') as f:
726+ ... reader.import_feeds(f)
728727
729- To get the next page, use the last result from a call as
730- `` starting_after `` in the next call::
728+ For more detailed control over which feeds are imported,
729+ see :meth: ` ~Reader.import_feeds_iter ` and the :mod: ` reader.opml ` module.
731730
732- >>> for entry in reader.get_entries(limit=2, starting_after=entry):
733- ... print(entry.title)
734- ...
735- # H.I. 134: Boxing Day
736- Star Wars: The Rise of Skywalker, Hello Internet Christmas Special
731+ .. _OPML subscription list : https://opml.org/spec2.opml#subscriptionLists
732+
733+ .. versionadded :: 3.23
737734
738735
739736
@@ -831,6 +828,38 @@ Some examples of how this is useful:
831828
832829
833830
831+ .. _pagination :
832+
833+ Pagination
834+ ----------
835+
836+ :meth: `~Reader.get_feeds `, :meth: `~Reader.get_entries `,
837+ and :meth: `~Reader.search_entries `
838+ can be used in a paginated fashion.
839+
840+ The ``limit `` argument allows limiting the number of results returned;
841+ the ``starting_after `` argument allows skipping results until after
842+ a specific one.
843+
844+ To get the first page, use only ``limit ``::
845+
846+ >>> for entry in reader.get_entries(limit=2):
847+ ... print(entry.title)
848+ ...
849+ H.I. #136: Dog Bingo
850+ H.I. #135: Place Your Bets
851+
852+ To get the next page, use the last result from a call as
853+ ``starting_after `` in the next call::
854+
855+ >>> for entry in reader.get_entries(limit=2, starting_after=entry):
856+ ... print(entry.title)
857+ ...
858+ # H.I. 134: Boxing Day
859+ Star Wars: The Rise of Skywalker, Hello Internet Christmas Special
860+
861+
862+
834863.. _reserved names :
835864
836865Reserved names
0 commit comments