apsync.import_local(relative_path: str, reload: bool) object#

Utility that imports local python scripts and modules. Pass reload=True to invalidate the cache. This makes your script execute slower but greatly improves development because you don’t have to restart Anchorpoint after altering the imported scripts.

  • relative_path (str) – The relative folder path where the scripts are located

  • reload (bool) – Reloads the script and ignores caches.


Import a file my_callbacks.py located in the folder callbacks
>>> callbacks = apsync.import_local("callbacks/my_callbacks")
>>> callbacks.foo()
Import a local module utilities and use the script foo.py
>>> util = apsync.import_local("utilities")
>>> util.foo.bar()