EmailHarvester
EmailHarvester copied to clipboard
Module Setup
This is to make the harvester importable and usable as a python module for other python projects. CLI has been broken out into its own script, and utilizes setuptools console_scripts entrypoint.
This also is ready for PyPi upload and pip install from there, and should simplify the distribution of your project.
- https://packaging.python.org/guides/distributing-packages-using-setuptools/#packaging-your-project
- https://packaging.python.org/guides/distributing-packages-using-setuptools/#uploading-your-project-to-pypi
Upon pip install, a new executable is added to PATH (email_harvester
) which will invoke the CLI.
Additional work is really needed for a full module (ergo, returning data from EmailHarvester
class instead of just printing/logging), but this is 98% of the work. I have just run out of time for today (will add it sooner or later myself if it isn't added by the time I get back to this).
- remove
sys.exit
calls from everything but CLI (shouldn't exit someone elses python app if they are using the module). - better separation of logging and console output.
- return discovered emails so when imported as a module, the app importing the harvester has easy/expected access to the data.