>make changes in two places to keep both versions in sync.
That's not how Python imports work. You can import in the notebook just like any other Python script.