Example #1
0
 def handle(self, *args, **options):
     print('Importing data from {}'.format(options['dir']))
     prefixes = ['sp', 'su', 'fa']
     paths = [
         glob.glob(options['dir'] + '/sp*.csv'),
         glob.glob(options['dir'] + '/su*.csv'),
         glob.glob(options['dir'] + '/fa*.csv'),
     ]
     processed_paths = 0
     total_paths = sum([len(path_list) for path_list in paths])
     for season, path_list in enumerate(paths):
         for path in path_list:
             year = int(path.split(prefixes[season])[-1][:4])
             create_objects(season, year, path)
             processed_paths += 1
             print("import_dir: processed {0} ({1} of {2})".\
                 format(path, processed_paths, total_paths))
Example #2
0
 def handle(self, *args, **options):
     verbosity = options['verbosity']
     prefixes = ['sp', 'su', 'fa']
     paths = [
         glob.glob(options['dir'] + 'sp*.csv'),
         glob.glob(options['dir'] + 'su*.csv'),
         glob.glob(options['dir'] + 'fa*.csv'),
     ]
     processed_paths = 0
     total_paths = sum([len(path_list) for path_list in paths])
     for season, path_list in enumerate(paths):
         for path in path_list:
             year = int(path.split(prefixes[season])[-1][:4])
             create_objects(season, year, path, verbosity)
             processed_paths += 1
             if verbosity >= 1:
                 print "import_dir: processed {0} ({1} of {2})".\
                       format(path, processed_paths, total_paths)
Example #3
0
 def handle(self, *args, **options):
     verbosity = options['verbosity']
     prefixes = ['sp', 'su', 'fa']
     paths = [
         glob.glob(options['dir'] + 'sp*.csv'),
         glob.glob(options['dir'] + 'su*.csv'),
         glob.glob(options['dir'] + 'fa*.csv'),
     ]
     processed_paths = 0
     total_paths = sum([len(path_list) for path_list in paths])
     for season, path_list in enumerate(paths):
         for path in path_list:
             year = int(path.split(prefixes[season])[-1][:4])
             create_objects(season, year, path, verbosity)
             processed_paths += 1
             if verbosity >= 1:
                 print "import_dir: processed {0} ({1} of {2})".\
                       format(path, processed_paths, total_paths)