3

I've searched around for an answer specific to my use case, but can't find one, so apologies if this specific case has been answered before.

I run a number of isolated scripts which perform different functions, like assessing specific data from APIs and sending email alerts. Whilst the scripts themselves use appropriately named modules for shared functionality - e.g. sending emails - they don't themselves have functionality which will need to be shared.

As a result I have a directory/script structure that feels too generic:

{script1 purpose}
    - go.py
{script2 purpose}
    - go.py
{script3 purpose}
    - go.py

e.g.

Spend Monitor
  - go.py

Where `Spend Monitor' is a relevant directory name, with the script starting the execution called go.py in each directory.

This has not caused any problems so far, but it feels like bad practice. However, I can't find reference to this specific case - should the go.py files be renamed? To what?

1 Answers1

2

This is the only reference I know about module names (scripts are themselves modules so it applies to them too):

Modules should have short, all-lowercase names. Underscores can be used in the module name if it improves readability.

https://www.python.org/dev/peps/pep-0008/#package-and-module-names

Now if the way you are naming things feels to you like bad practice and you can think of some other way that feels like less bad practice, it is probably worth the change.

Stop harming Monica
  • 12,141
  • 1
  • 36
  • 56