An importing framework, that makes writing of importers easy, and allows to do a lot of snooping and metrics gathering behind the scenes.
It's considered a work in progress, where it's final form is not yet necessarily there, and developers are encouraged to try and improve it's API, and way of doing things.
Create a virtual environment, and isntall dependencies via make
mkvirtualenv sonny
makeTo see all jobs defined:
./list.pyCopy conf/local.py-dist to conf/local.py, and make sure the details for the
local DB, and Dashboard instance, are correct
To run a job, with FTP/Email/DB access, it's enough to do:
./run.py path.to.importer.package.ImporterClassTo test a job, which mocks most functionality with side effects (eg FTP, DB, etc):
./test.py path.to.importer.package.ImporterClassIn dev/production environment prepend with IMPORT_CONF=<environment>,
where IMPORT_CONF should be the appropriate environment. It defaults to
conf.local.
To pass named arguments:
./run.py importer example=value demo=argument list_argument[]=first list_argument[]=secondTo pass a boolean:
./run.py importer flag1?=True flag2?=FalseTo pass facility settings overrides:
./run.py importer importer_arg=value --FacilityName.setting_name=valueTo limit the amount of logs:
./test.py importer --InMemoryLogger.log_level='INFO'To selectively not mock some facilities, eg don't mock saving to/loading from DB:
./test.py importer --MockRegistry.no_mock_classes[]=DbSaver --MockRegistry.mock_classes[]=DbLoaderOr, to selectively mock only some facilities, eg mock only fetching:
./run.py importer --MockRegistry.mock_classes[]=FtpFetcher --MockRegistry.mock_classes[]=LocalFileDeleterWhen testing locally, you can use the importer's scripts to setup and tear down the DB:
./run.py importer --TemporaryDB.force_run?=TrueIt's enough to do:
./run-tests.shwhich uses nosetests
To use your local dashboard , you can register the jobs available:
./run.py import_jobs.register_jobs_to_dashboard.RegisterJobsToDashboardFrom the Django web framework background, this project is named after Sonny Rollins