1234567891011121314151617181920212223242526 |
- # -*- coding: utf-8 -*-
- from .__load__ import *
- class Loader(object):
- def get(self, file, param = {}):
- if '.csv' in file:
- loader = 'csv'
- elif '.pdf' in file:
- loader = 'pdf'
- elif '.html' in file:
- loader = 'html'
- elif '.json' in file:
- loader = 'json'
- elif '.xls' in file:
- loader = 'excel'
- elif '.ppt' in file:
- loader = 'ppt'
- elif '.doc' in file:
- loader = 'word'
- elif '.jpg' in file or '.png' in file or '.gif' in file or '.webp' in file:
- loader = 'img'
- elif '.mp3' in file or '.wav' in file or '.m4a' in file or '.3gp' in file or '.amr' in file:
- loader = 'audio'
- else:
- loader = 'text'
- return Demeter.service(loader, 'extract.docs').init(file, param)
|