~/talk

Designing a plugin architecture in Python

Talkat PyCon Israel 2024 · on Monday, 2024-09-16· [python, software-architecture]
github:tsvi
slides:none on file

A Python codegen tool gains runtime extensions by two concrete patterns: load a plugin file with importlib.spec_from_file_location, execute it, use inspect.getmembers to pick out callables, and inject them into the Jinja/Ginger environment filters dict; or publish parsers via importlib.metadata.entry_points where package metadata maps file suffix → callable and the app resolves by suffix. The talk demonstrates both patterns with a camel-case filter implementation and YAML/JSON parser examples and explains lookup versus registration.

AI-written summary · about

  1. 0:00Introduction and speaker background
  2. 3:05Why use a plugin architecture
  3. 4:35Real-world plugin example at Intel
  4. 7:28Dynamic filter loading with importlib
  5. 12:13Entry points for data parsers
  6. 16:34Recap and benefits of plugins
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.