You can parent an object to a specific bone using a 'Child Of' constraint:

Here, the object I want to parent to an individual bone has a 'Child Of' constraint added, with the armature and bone I want it to follow selected from the 'Target' and 'Bone' search boxes.
Pressing the 'Set Inverse' button may be required to return the object to it's original position as after choosing the target object it may jump to that bone's position.
If you want a bone to have a parent bone you have to do the parenting while in 'Edit Mode'. At the minute you are in 'Object Mode'. From the header of the 3D view, with the armature selected, choose 'Edit Mode':
(The bone you want to be the parent will also have to be in the same armature for it to be available as the parent).
I have been having a similar problem and using only works if the head of the bone is on the origin.bone.length
A more general solution is to find the vector from the tail back to the head and add that to the .parent_matrix_inverted
This function appears to work for bones regardless of their orientation. Note the rig must be in pose mode for this work otherwise will be empty.rig.pose.bones
def parentBone(rig, boneName, geo):
bpy.context.evaluated_depsgraph_get().update()
bone = rig.pose.bones[boneName]
geo.parent=rig
geo.parent_type = "BONE"
geo.parent_bone = boneName
vec = bone.head - bone.tail
trans = mathutils.Matrix.Translation(vec)
geo.matrix_parent_inverse = bone.matrix.inverted() @ trans
Let the bone position it, then tweak.
In as much as you can position then parent, I am suggesting the opposite. The nature of parenting is to let the child inherit the transform of the parent.
If the object has no translation or rotation it will be at the location and rotation of its parent.
The head to tail axis of a bone is, +Y along the bones length. Align our child object to reflect this.
The "up" axis of our default cone is +Z, we want to make it point to "+Y".
The default cone, rotated and translated such that its origin (local (0, 0, 0)) is at the tip of cone, and it points in a +Y direction. The cone is at global location (0, 0, 0)
If non-zero rotation apply the rotation.
Now we can parent to a bone and the cone will be tip to tail of bone.
cone parented to head bone of rigify bird metarig, adjusting the cones y location will slide it up and down the bone
An object can only have one parent. In the example you give, you want one wheel bone to control the wheel. This bone would be animated to rotate on its Y-axis, this bone is then parented to a steering bone that will "turn" the wheel bone, but does not directly move the wheel mesh.


If you have assigned your bones correctly on your character, you should be able to add additional game objects into the joints of the character, ie. Swords, shields and other cool things.
Then you can use this code to quickly fetch specific defined bones:
_playerAnimator.GetBoneTransform(HumanBodyBones.LeftHand);
Which gets the bone transform.
Here is a quick snippet of the assigned bones using a PlayerAvatar on character.

You can do this using and using the bpy.ops.object.parent_set() parameter. I also allowed to choose which bone of your armature you want it to be the parent by setting keep_transformas shown below:parent_bone = 'BoneNameYouWantToBeParent'
import bpy
ob= bpy.data.objects['Cube']
arma = bpy.data.objects['Armature']
bpy.ops.object.select_all(action='DESELECT')
arma.select = True
bpy.context.scene.objects.active = arma
bpy.ops.object.mode_set(mode='EDIT')
parent_bone = 'Bone' # choose the bone name which you want to be the parent
arma.data.edit_bones.active = arma.data.edit_bones[parent_bone]
bpy.ops.object.mode_set(mode='OBJECT')
bpy.ops.object.select_all(action='DESELECT') #deselect all objects
ob.select = True
arma.select = True
bpy.context.scene.objects.active = arma #the active object will be the parent of all selected object
bpy.ops.object.parent_set(type='BONE', keep_transform=True)
As shown below I modified your armature to have multiple bones so you can select which bone you want it to be the parent to your Cube. In the below screenshot I used to be the parent:Bone

In the screenshot below I chose to be the parent:Bone.001

Updated .blend file can be found here: 