The language tags project maintains a comprehensive list of language tags in equivalences sets, where a list of language tags are considered equivalent semantically.
The content for each language tag set includes names and equivalent regions. Names are curated to ensure no pejorative names, as far as possible.
There is a python module available for accessing the langtags.json file and making the information available as well as keeping a locally cached version.
Key documents for further reading: