perceval/backends/mozilla/crates.py
def __fetch_crates(self, from_date):
        """Fetch crates"""

        from_date = datetime_to_utc(from_date)

        crates_groups = self.client.crates()

        for raw_crates in crates_groups:
            crates = json.loads(raw_crates)

            for crate_container in crates['crates']:

                if str_to_datetime(crate_container['updated_at']) < from_date:
                    continue

                crate_id = crate_container['id']

                crate = self.__fetch_crate_data(crate_id)
                crate['owner_team_data'] = self.__fetch_crate_owner_team(crate_id)
                crate['owner_user_data'] = self.__fetch_crate_owner_user(crate_id)
                crate['version_downloads_data'] = self.__fetch_crate_version_downloads(crate_id)
                crate['versions_data'] = self.__fetch_crate_versions(crate_id)

                yield crate
def __fetch_crates(self, from_date):
        """Fetch crates"""

        from_date = datetime_to_utc(from_date)

        crates_groups = self.client.crates()

        for raw_crates in crates_groups:
            crates = json.loads(raw_crates)

            for crate_container in crates['crates']:

                if str_to_datetime(crate_container['updated_at']) < from_date:
                    continue

                crate_id = crate_container['id']

                crate = self.__fetch_crate_data(crate_id)
                crate['owner_team_data'] = self.__fetch_crate_owner_team(crate_id)
                crate['owner_user_data'] = self.__fetch_crate_owner_user(crate_id)
                crate['version_downloads_data'] = self.__fetch_crate_version_downloads(crate_id)
                crate['versions_data'] = self.__fetch_crate_versions(crate_id)

                yield crate
def __fetch_crates ( self , from_date ) : from_date = datetime_to_utc ( from_date ) crates_groups = self . client . crates ( ) for raw_crates in crates_groups : crates = json . loads ( raw_crates ) for crate_container in crates [ 'crates' ] : if str_to_datetime ( crate_container [ 'updated_at' ] ) < from_date : continue crate_id = crate_container [ 'id' ] crate = self . __fetch_crate_data ( crate_id ) crate [ 'owner_team_data' ] = self . __fetch_crate_owner_team ( crate_id ) crate [ 'owner_user_data' ] = self . __fetch_crate_owner_user ( crate_id ) crate [ 'version_downloads_data' ] = self . __fetch_crate_version_downloads ( crate_id ) crate [ 'versions_data' ] = self . __fetch_crate_versions ( crate_id ) yield crate
Fetch crates
Fetch crates