dimanche 3 juillet 2016

Balancing dependence/independence of packages

How does one determine what classes and functions belong in the same package?

I have a large Python package that I sense should be split into multiple packages. For example, there is currently a subpackage for GIS processes, a subpackage for tabular processes, and a subpackage for processes/data specific to my current workplace. However, it contains a few "utilities" modules that are used by nearly every subpackage (and those subpackages have some interdependencies as well). Note that these are not for a particular application; instead, they are used for common functionality in scripts that I write as a data analyst. With a growing demand to make the functionality available to others, I'm trying to determine the best way to do that. Would it be Pythonic to:

1) keep it all together;

2) split into topical packages and place the utilities in their own package;

3) split into topical packages and just have some utilities repeated across those packages (I doubt it); or

4) some option that I haven't presented?

Aucun commentaire:

Enregistrer un commentaire