The developer must create a script / macros to create more than 4000 WordPress pages

I have a list of over 4000 cities for which I need to create a landing page in WordPress.

I use WordPress and WooCommerce. Therefore, I need a script code or macros to automatically create pages with all the attributes and categories of WooCommerce products that apply to the landing pages of those cities.

I have a template for the content that I have in mind:

Title: {City Name} Landing Page | name of the site
Content: {City Name} description of the page.
WooCommerce Attributes: {City Name}
SEMrush