The Python “distro” package is used by many toolsets, notably including the spack scientific software build and packaging tool, to detect the operating system being used. It currently detects RHEL and CentOS only. (In general, I think it could be reworked to detect workalike distributions equivalent to the one they are based on, such as the relationship between CentOS, Rocky, Alma, and RH Enterprise Linux, but that’s another problem; for now we just need to think about how to include Rocky.)
Source is at https://github.com/python-distro/distro. Thoughts welcome, or better yet, pull requests at the source.