Search code examples
pythonmetadatadocstring

Where to add __author__ in Python Packages


I'm writing a simple Python package with (currently) only one module.

Where should I put the docstring and __author__ meta attributes? Do they go in the __init__.py or in each modules?

Is there a PEP pertaining to this? I was only able to find the generic docstring one, which doesn't answer this question.


Solution

  • Honestly I will put the author in the setup.py file if you have one. This way you didn't pollute all the files in the project with duplicated information.

    But if you want to do it you can follow this structure http://web.archive.org/web/20111010053227/http://jaynes.colorado.edu/PythonGuidelines.html#module_formatting