salesforce-org-sandbox-detection-via-org-configs
Sandbox status for any org alias is available via api_client.org_configs[org_alias][‘type’] which returns ‘production’ or ‘sandbox’. The is_sandbox boolean used by mdapi.deploy() must be derived here. Note: org_configs only stores the original registered aliases — check the full alias map if sandbox aliases exist.