swh.lister.pubdev.lister module#

class swh.lister.pubdev.lister.PubDevLister(scheduler: SchedulerInterface, url: str = 'https://pub.dev/', instance: str = 'pubdev', credentials: Dict[str, Dict[str, List[Dict[str, str]]]] | None = None, max_origins_per_page: int | None = None, max_pages: int | None = None, enable_origins: bool = True)[source]#

Bases: StatelessLister[List[str]]

List pub.dev (Dart, Flutter) origins.

LISTER_NAME: str = 'pubdev'#
VISIT_TYPE = 'pubdev'#
INSTANCE = 'pubdev'#
BASE_URL = 'https://pub.dev/'#
PACKAGE_NAMES_URL_PATTERN = '{base_url}api/package-names'#
PACKAGE_INFO_URL_PATTERN = '{base_url}api/packages/{pkgname}'#
ORIGIN_URL_PATTERN = '{base_url}packages/{pkgname}'#
get_pages() Iterator[List[str]][source]#

Yield an iterator which returns ‘page’

It uses the api provided by https://pub.dev/api/ to find Dart and Flutter package origins.

The http api call get “{base_url}package-names” to retrieve a sorted list of all package names.

There is only one page that list all origins url based on “{base_url}packages/{pkgname}”

get_origins_from_page(page: List[str]) Iterator[ListedOrigin][source]#

Iterate on all pages and yield ListedOrigin instances.