Structuring Your Project
By “structure” we mean the decisions you make concerninghow your project best meets its objective. We need to consider how tobest leverage Python’s features to create clean, effective code.In practical terms, “structure” means making clean code whose logic anddependencies are clear as well as how the files and folders are organizedin the filesystem.
Which functions should go into which modules? How does data flow throughthe project? What features and functions can be grouped together andisolated? By answering questions like these you can begin to plan, ina broad sense, what your finished product will look like.
In this section we take a closer look at Python’s module and importsystems as they are the central elements to enforcing structure in yourproject. We then discuss various perspectives on how to build code whichcan be extended and tested reliably.
- Structure of the Repository
- Structure of Code is Key
- Modules
- Packages
- Object-oriented programming
- Decorators
- Context Managers
- Dynamic typing
- Mutable and immutable types
- Further Reading