unitedstates/congress — pull request #111 by dvogel (2014-02-19 22:28:30+00:00)
Title: Added --patch option to run.

The core change is a new option to run (--patch) that would facilitate monkey-patching task modules. The module specified by the user would be expected to contain a 'patch' method that would be responsible for the actual monkey-patching. I've included an example of how to use it in contrib/beanstalkd.py. I have plans to experiment with significant modifications to how these scrapers deal with IO. I think this approach is minimally invasive while enabling me to keep my fork from drifting too far.

The use of importlib instead of __import__ is due to their return value. importlib plays nicer with packaged modules.