Block 151: Project Structure & Packaging
Organize your project as a professional Python package.
Concepts
- Recommended project layout: src/, tests/, data/, notebooks/, docs/
- requirements.txt and pip freeze
- setup.py / pyproject.toml basics
- __init__.py for package imports
Code Examples
See exercise below.
Exercise
Reorganize your project into the standard structure. Verify all imports still work. Generate requirements.txt and test that the project runs in a fresh virtual environment.
Homework
What is the difference between requirements.txt and Pipfile? When would you use each?