Import and apply animation from text file

I’m doing a little research project in mocap. Basically the output file I’m getting is a textfile containing coordinates of several points, over and over for each frame.
Coordinates are in absolute X, Y, Z of the point’s position.

Now the next step would be to use Python in Blender to open the file, and somehow apply those coordinates to an armature.

I guess I can figure out later how to compute two coordinates in space into a rotation? but the part I’m struggling now is to apply armature bones into a specific direction from raw numbers in the first place. I’ve tried several snippets of code I found, but most are a decade old and no longer work. Is there any simple example out there on how I can select a specifc bone, and turn it to a given direction in Blender 2.9 ?

If you’re bad at math you should give up already lol.
But if you’re really willing to learn you can look into quaternions, they are vital for rotations.