sorry that probably wasn't a great reference, but `distutils` works well for this. e.g. https://github.com/dimagi/bhoma/blob/08f9dfc1da126d0aec37553107f7c73f152429da/bhoma/apps/patient/management/commands/check_config.py#L23