{
  "schema_version": "1.0",
  "codex": "thecodex.expert/coding",
  "type": "concept",
  "slug": "concepts/modules",
  "name": "Modules",
  "section": "CS Concepts",
  "canonical_definition": "A module is a self-contained unit of source code that defines a namespace \u2014 a collection of names (functions, classes, variables) that can be selectively imported by other parts of a program \u2014 enabling code organisation, reuse across files, and isolation of implementation details behind a defined public interface.",
  "confidence": "high",
  "last_verified": "2026-06-01",
  "source_count": 4,
  "url": "https://thecodex.expert/coding/concepts/modules/",
  "concept_relationship": {
    "requires_first": [
      "concepts/functions",
      "concepts/scope"
    ],
    "enables": [
      "concepts/encapsulation",
      "languages/python"
    ],
    "commonly_confused_with": [
      "module != package",
      "from x import * is not recommended",
      "importing does not re-execute a module"
    ]
  }
}