A drop-in replacement for Python's netrc module that safely parses .netrc files without leaking credentials. Provides the same API but with better error handling and support for permission checks. Current version: 1.0.1, released 2023-08. Monthly releases.
pip install safe-netrcVerified import paths — ran on the pinned version, not inferred.
Parse .netrc file and authenticate to a host. The file must have permissions 600 or less (owner-only read/write).
Avoid isinstance checks; just use the object directly.
Run `chmod 600 ~/.netrc` to fix permissions. Or handle the error gracefully.
Always pass a string hostname: `netrc_obj.authenticators('example.com')`.Run `chmod 600 ~/.netrc` in the terminal to restrict permissions.
Use `from safe_netrc import netrc` or `import safe_netrc` and access via `safe_netrc.netrc`.
No dependency data recorded yet.