masterscraper/masterscraper/core/meta_type.py

13 lines
512 B
Python

#!/usr/bin/env python3
#--------[ Get Variable Type ]--------#
def meta_type(self):
for key in self.info['keys']:
if key == 'country.name': self.meta['type'] = 'global'
elif key == 'year': self.meta['type'] = 'historical'
elif key == 'date': self.meta['type'] = 'historical'
elif key == 'us.county.fips': self.meta['type'] = 'regional'
elif key == 'uk.constituency.name': self.meta['type'] = 'regional'
if self.meta['type'] == None: self.meta['type'] = 'unkown'