--- id: safe-netrc version: "1.0.1" license: GPL-2.0-or-later license_treatment: copyleft maintenance: abandoned --- # safe-netrc — Safe netrc file parser License: copyleft · Maintenance: abandoned · Downloads: 93.2K/mo ## What it is and what it does Safe-netrc is a drop-in replacement for Python's standard library netrc parser that adds stricter security and flexibility. It extends the netrc.netrc class to enforce file permissions checks and allows the netrc file path to be specified via the NETRC environment variable instead of always defaulting to ~/.netrc. The package backports permission validation that was added to the standard library in Python 3.1, ensuring consistent security behavior across Python versions. The package is intended for applications that need to read authentication credentials from netrc files while maintaining strict security posture. It has no external runtime dependencies and installs as a pure Python wheel, making it lightweight and portable. However, the project is no longer actively maintained—the last release was in November 2022. Use it for: - Secure credential lookup in CLI tools or scripts that need to authenticate with remote services using netrc files. - Enforcing strict file permissions on credential files to prevent accidental exposure of passwords. - Allowing deployment scripts to override the default netrc location via NETRC environment variable for non-standard configurations. - Backporting secure netrc parsing to Python 3.7–3.9 environments where standard library behavior may differ. - Validating netrc file permissions in security-sensitive applications before attempting to read credentials. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides a safer subclass of Python's standard netrc parser that enforces strict file permissions and supports custom netrc file paths via environment variable. Yes, if you need secure netrc parsing with strict permissions checks and environment-variable path override in a Python 3.7+ application. The package is stable and has no known vulnerabilities, but be aware it is abandoned and will not receive updates. Use it only if the current behavior meets your needs and you do not expect future maintenance. ## Install pip install safe-netrc uv add safe-netrc poetry add safe-netrc ## Installing safe-netrc Before you install: Low friction: pure Python wheel with no runtime dependencies. However, the package is abandoned—last release was 2022-11-29, over 1354 days ago. No active maintenance or security updates. License in practice: GPL-2.0-or-later is a copyleft license requiring derivative works to be licensed under compatible terms. Any code that imports and modifies this package must be released under GPL-2.0-or-later or a compatible license. Quickstart: pip install safe-netrc from safe_netrc import netrc auth = netrc() login, _, password = auth.authenticators('example.com') Requires Python 3.7 or later. The netrc file must have restrictive permissions or the parser will reject it. Verify before relying: - Whether the abandoned status affects real-world use cases where netrc handling is stable and rarely needs updates. - Specific permission requirements the parser enforces on netrc files. - Whether permissions-check backport from Python 3.1 remains relevant given current Python version support (3.7+). ## Package facts - License: GPL-2.0-or-later (copyleft) - Python support: supports_current - Install friction: low - Maintenance: abandoned - Downloads: 93.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags netrc file parser, secure credential storage, netrc permissions check, environment variable netrc path, safe authentication file, netrc security, credential file validation, credentials, authentication, security-hardening [View on SkillFed](https://skillfed.io/packages/safe-netrc) · [View on PyPI](https://pypi.org/project/safe-netrc/)