Python scripts for Agisoft Metashape Professional 1.5+ (and PhotoScan Professional 1.3, 1.4) are available in GitHub repository:
Python scripts for Metashape Pro - https://github.com/agisoft-llc/metashape-scripts
You can find information about how to download a script from Agisoft GitHub page in our article: How to download script from GitHub?