You can simply change the orientation of the bones:
Here we have two armatures. The top armature corresponds to your pic. The bottom armature is exactly the same, except the bones' +Y axes point in the direction of the original +X axes, and the bones' +X axes point in the direction of the original +Y axes.
I made the second armature from a copy of the first, just by rotating the bones in "normal" orientation. Exchanging +X and +Y exactly requires an additional offset of 180 degrees to the roll.
However, you cannot change the coordinate system handedness: the direction of the +Z fully depends on the directions of the +X and the +Y. Coordinate handedness typically varies with application; different coordinate handedness is frequently found when translating between stuff designed with OpenGL (like Blender) and stuff designed with Direct3D (like most video games.)
If you don't like the way that these bones look, or the way they interact with, say, automatic weights, you can parent deforming bones in pretty axes, to non-deforming bones in ugly axes:
But here, since you're scripting anyways, I would recommend changing the animations in your script, rather than making armatures to completely match the animation data that you have. If you want X translation to be applied to a bone's Y axis, why not exchange X and Y translation in the script?