def process_item(self, item, spider): item['update_time'] = datetime.strptime(item['update_time'], '%Y-%m-%dT%H:%M:%SZ') x = item['commits'] x = x.replace(',', '') item['commits'] = int(x) item['branches'] = int(item['branches']) y = item['releases'] y = y.replace(',', '') item['releases'] = int(y) self.session.add(Repository(**item)) return item
def process_item(self, item, spider): item['update_time'] = datetime.strptime( item['update_time'], '%Y-%m-%dT%H:%M:%SZ') self.session.add(Repository(**item)) return item
def _process_repository_item(self, item): item['name'] = item['name'] item['update_time'] = datetime.strptime(item['update_time'], '%Y-%m-%dT%H:%M:%SZ') self.session.add(Repository(**item))
def process_item(self, item, spider): item['commits'] = int(''.join(item['commits'].strip().split(','))) item['branches'] = int(item['branches']) item['releases'] = int(item['releases']) self.session.add(Repository(**item)) return item
def process_item(self, item, spider): self.session.add(Repository(**item)) return item
def process_item(self, item, spider): item['name'] = item['name'] item['update_time'] = item['update_time'] self.session.add(Repository(**item)) return item