Keyframe Bar Chart Animation Efficiently Primary



I would like to read in numeric data for multiple objects and create a presentation in Blender similar to a Bar Chart. I am requesting partial assistance, or more, in Python Scripts to automate this startling and critical task.  The X scale of a bar should represent the data just as in any bar chart.  A sample of the work is included above.  I would like an efficient, simple and secure way to achieve my goal.

There are 30 objects each requiring 40 keyframes.

The animated objects move only in one axis (X) so X Scale can be keyframed.

every 20 frames (incrementing by 20, so 0,20,40,60,80 etc), 

GIF of my first work https://i.imgur.com/koKg23t.gifv

Thanks in Advance.



Secondary

Manually the work is:


Repeat for 30 Objects.


Select object A
Repeat for 40 frame locations


Scale and Insert Keyframe




(around 40 times for 30 objects), and the risk of making errors is enormous.
Here's how I would write this script for a single object. You could use a "for loop" to iterate through all of your objects.

import bpy

scene = bpy.context.scene
obj = scene.objects['Cube']

y_locations = [
    10,
    13,
    22,
]

current_frame = 0
for y_location in y_locations:
    obj.location[1] = y_location
    obj.keyframe_insert(
        data_path="location", frame=current_frame)

    current_frame += 20