{
  "id": "python-glob-table",
  "kind": "table",
  "slug": "python-glob",
  "iil_id": null,
  "note_url": "https://iinventedlight.com/library/notes/python-glob/",
  "title": "Python glob - match file paths with *, ? and recursive ** patterns",
  "columns": [
    "name",
    "source",
    "detail"
  ],
  "rows": [
    {
      "name": "*",
      "source": "Python docs",
      "detail": "? and character ranges in [] are matched; no tilde expansion is done. Use os.path.expanduser() and os.path.expandvars() for that."
    },
    {
      "name": "root_dir",
      "source": "Python docs",
      "detail": "has the same effect as changing the current directory before calling; relative patterns then return paths relative to root_dir."
    },
    {
      "name": "dir_fd",
      "source": "Python docs",
      "detail": "supports paths relative to directory descriptors."
    },
    {
      "name": "iglob()",
      "source": "Python docs",
      "detail": "yields the same values as glob() without actually storing them all simultaneously."
    },
    {
      "name": "glob.translate()",
      "source": "Python docs",
      "detail": "converts a path specification to a regular expression."
    },
    {
      "name": "OSError",
      "source": "Python docs",
      "detail": "exceptions from scanning, including PermissionError, are suppressed."
    }
  ],
  "related_slugs": [
    "python-pathlib",
    "python-argparse",
    "python-itertools"
  ],
  "license": "CC-BY-4.0",
  "source_license": "PSF-2.0 (Python docs); PSF-2.0 (python/cpython (GitHub)); prose restates cited source lines in own words",
  "as_of": "2026-11-18",
  "status": "fill-draft-20261118",
  "note": "Restated from the note's GREEN sources; check those sources before relying on a value."
}