This is particularly help when migrating from SAP's data stack (BW, Datasphere, etc. which have prepacked hierarchy models and ETL) to something like Snowflake, where all ETL and data models have to be built from scratch.
GitHub (MIT-licensed): https://github.com/jchesch/sap-hierarchy-flattener