3D alignment of coordinate systems in Python 2.X and 3.X

Job ID: 34931006

Budget: $30 – $250 NZD

I need a procedure that allows for the alignment of different coordinate systems using only python's standard library. I want code that runs on both 2.X and 3.X

Y up system.
Rotation order to be selectable by the user.
The returned correction will be for a point sitting at 0,0,0 with 0 rotation in the original space.
The inputs will be 2 arrays of 3D coordinates (XYZ).
The inputs are matching in order. i.e. aligned[3] == to be aligned[3]
The inputs match in length.
If 2 arrays with 2 points only are supplied I expect Translation on all axis, and rotation on Y only.
If 2 arrays with 2+ points are supplied I expect Translation of all axis and rotation on all axis.
There will be some differences between some of the measurements due to how they are obtained, so there must be some data checks with user-selectable thresholds for distance and angle deviation.
I do not want to skew or scale the data.
The returned values must be XYZ coordinates, and XYZ rotations in euler angles.

I expect all the code to be PEP 8 compliant.
Comments are a must.
I do not need OOP, functional programming is just fine.

You can use these values as an example:
aligned = [[-2.897516385578488, 3.7752695739927837, 0.06606420508388666], [1.4111313577631819, 5.844407705892939, -5.794437137182879], [7.674102301591336, 0.14520267592303426, -7.783004308533609], [5.2442268253300135, -5.771806367931028, -0.9153720493817303]]
toBeAligned = [[1.9424843171622475, -1.015605665622616, -8.078276102475284], [4.8116407115414095, -2.401020808996756, -14.93683429154825], [9.819492234489246, -9.502672986551367, -15.321674368705882], [8.658218548743246, -11.497081409485528, -6.224782472489151]]

I expect these results from this example [[Translation XYZ][Rotation XYZ]]:
[-6.469424905572563, 0.921450049971966, 7.077514028579781][25.046794789906226, -14.559318111705185, 5.476412387685914]
Related categories: Python Software Architecture Mathematics