How to create custom property for an object without UI I can create a custom property for my object by pressing "Add" on the "Custom Properties" tab. I would like to do this via script. I tried this way:

bpy.ops.wm.properties_add(data_path="object")
bpy.ops.wm.properties_edit(data_path="object", property="MyProperty", value="0", min=0, max=1, use_soft_limits=False, soft_min=0, soft_max=1, description="")


But I get a compiler error RuntimeError: Error: Direct execution not supported.

Is it possible to do this via script?

I'm using version 2.79. The purpose of the custom property is to use it to drive other properties.
You just do:

import bpy 

bpy.context.object.data["some_property"] = "Some value"