I have a very simple package, which I eventually want to release through PyPI, which has a directory tree like the following:
daterangeparser/
__init__.py
parse_date_range.py
test.py
parse_date_range.py
defines a function called parse
.
What is the easiest and most pythonic way for me to set up the package for easy importing of the parse
function, and how can I do it?
At the moment I have to do from daterangeparser.parse_date_range import parse
which seems rather clunky. I'd rather do from daterangeparser import parse
, which seems simpler and more pythonic, but I can't seem to work out how to get this to work (do I need to put something else in __init__.py
? Or, is there a better way to do this?