예제 #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
예제 #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
예제 #3
0
파일: pipelines.py 프로젝트: fywest/python
    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))
예제 #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
예제 #5
0
 def process_item(self, item, spider):
     self.session.add(Repository(**item))
     return item
예제 #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