Search⌘ K
AI Features

Project Structure and Dependencies

Explore how to organize professional Python projects by setting up a clean workspace, using the standardized src directory layout, and managing dependencies with pyproject.toml. Understand how to install packages in editable mode and verify your setup to ensure consistent builds and runs across different environments.

So far, the examples in this course have used standalone scripts or small groups of modules. This approach works well for learning and experimentation, but does not scale well for professional software development. A loosely organized collection of scripts leaves important questions unresolved, such as which file serves as the entry point, how dependencies should be installed, and why imports behave differently across environments.

Python projects typically address these issues through a standardized structure and explicit configuration. A clear project layout defines where source code resides, where tests are located, and how the application is executed. Configuration files specify dependencies and build metadata, allowing tools to install, validate, and run the project consistently across environments.

By adopting a formal layout and packaging conventions, we convert a collection of personal scripts into a reproducible and distributable application that other developers can understand quickly and that automation tooling can build and execute reliably.

Step 1: Setting up the workspace

When starting a professional project, we never clutter the root directory. We need a clean workspace. We will use the mkdir command with the -p flag.

  • mkdir: ...