Load camera track from an external file (by Python script) what I need is to import a camera track from an external file and to do this in a Python script.
The external track is a sequence of camera poses (location + rotation) in world coordinates.
How to do this in Blender Python? Since the Camera Solver uses a constraint to do this, I was wondering if I have to use something similar, but I am not sure (and if not, why the camera solver uses a constraint?).

I know I can add to the camera a (location + rotation) keyframe for each frame, that is what I already did, but I am wondering why the camera solver does not do this and why and, as a consequence, if there is some reason I am not considering that makes the use of a constraint a better solution to keyframes. Blender devs added a specific constraint type for this, there must be a reason.
Something similar to this works for me, didn't test if this code runs without errors, but it may help you

import bpy
import numpy as np
dirPath = "C:/Users/examplepath/examplepath/examplepath/camera.blend/Object/"
nameList = ['Camera0','Camera1','Camera2','Camera3']

# [euler0, euler1, euler2, x, y, z]
cam0 = [77.487, -0.000244, 91.4015, 13.6156, 0.094522, 2.19869]
cam1 = [70.2677, -0.000819, 173.623, 1.1328, 11.1731, 3.33687]
cam2 = [85.5084, 0.000169, -90.6852, -12.8706, 0.355527, 1.29131]
cam3 = [74.6794, -0.002039, 11.1926, 3.2923, -15.5643, 4.444]

camList = [cam0, cam1, cam2, cam3]

def setupCamera(scene, c):
    pi = np.pi

    scene.camera.rotation_euler[0] = c[0] * (pi / 180.0)
    scene.camera.rotation_euler[1] = c[1] * (pi / 180.0)
    scene.camera.rotation_euler[2] = c[2] * (pi / 180.0)

    scene.camera.location.x = c[3]
    scene.camera.location.y = c[4]
    scene.camera.location.z = c[5]

    return

# Append cameras to the scene
for i in range(nameList.__len__()):
    bpy.ops.wm.append(filename=nameList[i], directory=dirPath)

scene = bpy.data.scenes["Scene"]

for i in range(camList.__len__()):
    bpy.ops.object.camera_add()
    newCamera = bpy.data.objects['Camera']
    newCamera.name = 'c' + str(i)

    newCamera.rotation_mode = 'XYZ'
    scene.camera = newCamera

    config = camList[i]
    setupCamera(scene=scene, c=config)