To be written***
Standard file structure for python packages as follows:
<main folder name>
docs/
- LICENSE.txt
- README.md <-
.rst
file type preferred in python, but.md
is more common overall
src/
<- dedicated src is not always done but recommended for compatibility<module_name>
<- often the same name as the main folder, but should be a subfolder__init__.py
<- an empty file can be all that's needed at times. However, importing items here can be useful as they will be accessible to any file that is importing the overall module_version.py
<- autogenerated by versioneer using info fromsetup.cfg
1main.py
<- entry point file to be runutils.py
<any other python files>
- versioneer.py <- must be here in the top level folder 1
- setup.py <- must be here in the top level folder 2
- setup.cfg <- must be here in the top level folder 2
- requirements.txt <- must be here in the top level folder 3
- MANIFEST.in <- not strictly required
build/
<- optionaldata/
<- optional, can include .csv, .jpg, etc files for the code to accessdist/
<- optional, would usually contain .egg, .whl, .tar.gz, etc filesexamples/
<- optionallib/
<- optionalscripts/
<- optional, would contain.sh
files in linux/mactests/
<- optional, would contain python flies
- https://github.com/yngvem/python-project-structure
- https://github.com/johnthagen/python-blueprint#project-structure
Run src/<module_name>/main.py
with python
- Tested primarily on/with
- Mac OS X - 10.14 Mojave (on a 2018 Macbook pro with 16GB of Ram)
- Windows 11 (on a Microsoft Surface Laptop 2 with 8GB of Ram)
- python 3.6-3.9 derived from anaconda
- PyCharm
See LICENSE.txt
Rahul S. Yerrabelli
Service | URL |
---|---|
GitHub | https://github.com/ryerrabelli/ |
ORCID | https://orcid.org/0000-0002-7670-9601 |
Google Scholar | https://scholar.google.com/citations?user=pEvGRdkAAAAJ |
https://www.linkedin.com/in/ryerrabelli | |
Table generated using https://www.tablesgenerator.com/markdown_tables
Footnotes
-
Unlike
versioneer.py
, the file_version.py
does not have to be inside the top level folder. I prefer putting it withinsrc/<module>/
so that it does not clutter the top level directory and so that is more easily accessible within the project. For this to work,setup.cfg
should be updated so that the versioneer arguments are set to the file pathsrc/<module>/
, which is where I recommend putting_version.py
. ↩ ↩2 -
Some applications use only one- a
setup.py
orsetup.cfg
, but versioneer prefers both. ↩ ↩2 -
Can be autogenerated by PyCharm. Will not be blank as must have versioneer at least. ↩