Reset physics properties with python

Seems like it should be a simple problem but I can’t find any solutions right away for it. Is there any way to reset physics in game using python? Specifically I want to be able to enable or disable ghost for my object depending on my python logic.

add a invisible dynamic object, parent it to it ghost?

added= bge.logic.getCurrentScene().addObject(‘DynamicInvisableItemFromAnotherLayer’,own,0)
own.setParent(added,0,1)

and simply remove parent and end object to switch back?

You can’t change ghost in runtime, there is no attributes or functions to do it, what you can do as BluePrintRandom said, if you parent a object to another one, the ghost of the firts object will be enable (if you put true in the function).