Skip to content

Instantly share code, notes, and snippets.

View MG-MW's full-sized avatar

Nils Müller-Wendt MG-MW

  • Mankiewicz Gebr. & Co.
  • Hamburg, Germany
  • 16:52 (UTC +02:00)
View GitHub Profile
from importlib.util import module_from_spec, spec_from_file_location
from pathlib import Path
from types import ModuleType
def load_module_from_path(path: Path | str, module_name: str) -> ModuleType:
"""See also
https://docs.python.org/3/library/importlib.html#importing-a-source-file-directly
"""
spec = spec_from_file_location(module_name, path)
@MG-MW
MG-MW / #Polars format string expression
Last active May 8, 2025 15:28
Implementation of a python like format string expression generator for polars
TITLE