distro
Distro - an OS platform information API
This package has a good security score with no known vulnerabilities.
Community Reviews
Reliable OS detection with minimal attack surface and zero dependencies
From a security perspective, this library excels at being boring in the best way. It reads from /etc/os-release and similar files with predictable behavior, doesn't make network calls, and has minimal code paths to audit. Error handling is sensible—returns empty strings rather than throwing exceptions when detection fails, which prevents information leakage in error messages. The parsing logic is conservative and doesn't execute arbitrary code.
The main limitation is that it's Linux-only, so you need fallback logic for cross-platform code. The library correctly returns empty values on non-Linux systems rather than failing catastrophically, which makes defensive coding straightforward.
Best for: Linux-specific applications needing reliable OS version detection with minimal security exposure and no dependency bloat.
Avoid if: You need cross-platform OS detection or require BSD/Unix distribution information.
Lightweight, reliable OS detection with zero runtime overhead
From an operations perspective, this is exactly what you want: no connection pools to manage, no retry logic needed, and negligible memory footprint. It reads distribution info once and caches it, so repeated calls are essentially free. The library handles missing or malformed distribution files gracefully, returning empty strings rather than throwing exceptions. I've deployed this across hundreds of containers and VMs without a single runtime issue.
The main limitation is it only works on Linux - you'll need platform.system() checks if supporting Windows/Mac. There's no structured logging or observability hooks, but frankly, for a library this simple, you don't need them. Performance is never a concern; this adds microseconds to startup at most.
Best for: Linux-based deployments where you need reliable OS identification for configuration management, feature flags, or conditional logic.
Avoid if: You need cross-platform OS detection across Windows, macOS, and Linux in a unified API.
Reliable OS detection with minimal attack surface and zero dependencies
In practice, it handles parsing edge cases well and fails gracefully on missing or malformed files. Error handling returns empty strings rather than throwing exceptions, which prevents information leakage but requires you to validate outputs. The API is read-only with no state mutation, eliminating entire classes of vulnerabilities. I've used it for platform-specific dependency installation and feature detection in CI/CD pipelines without issues.
The maintainer has been responsive to security concerns historically, and the Apache 2.0 license is enterprise-friendly. For OS detection needs, this is far safer than rolling your own solution or parsing platform.linux_distribution() output.
Best for: Linux platform detection in security-sensitive environments where supply chain risk and attack surface matter
Avoid if: You need cross-platform OS detection beyond Linux distributions (use platform module instead)
Sign in to write a review
Sign In