from Hacker News

Ask HN: How do you handle project level imports in Python?

by atticusberg on 6/11/18, 6:52 PM with 0 comments

I have python project called xyz. It has a directory structure like this:

  xyz/
    __init__.py
    a.py
    b.py
    c.py

At the top of a.py, I'd like to be able to say something like from c import some_func.

From what I can tell, there are many, many different ways to accomplish this.

I haven't been able to find anything though that is both a) automated and b) clean.

How do you handle this your python projects?