Beispiel #1
0
    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
Beispiel #2
0
 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
Beispiel #3
0
    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))
Beispiel #4
0
 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
Beispiel #5
0
 def process_item(self, item, spider):
     self.session.add(Repository(**item))
     return item
Beispiel #6
0
 def process_item(self, item, spider):
     item['name'] = item['name']
     item['update_time'] = item['update_time']
     self.session.add(Repository(**item))
     return item