{"id":15297492,"url":"https://github.com/sloria/tinynetrc","last_synced_at":"2025-10-08T18:26:02.571Z","repository":{"id":26610013,"uuid":"109338807","full_name":"sloria/tinynetrc","owner":"sloria","description":"Read and write .netrc files in Python","archived":false,"fork":false,"pushed_at":"2022-08-17T01:27:22.000Z","size":58,"stargazers_count":13,"open_issues_count":5,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-23T22:19:45.452Z","etag":null,"topics":["ftp","netrc","posix","python","python-2","python-3"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sloria.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-03T01:46:45.000Z","updated_at":"2024-01-04T15:44:23.000Z","dependencies_parsed_at":"2022-07-16T15:00:49.102Z","dependency_job_id":null,"html_url":"https://github.com/sloria/tinynetrc","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sloria%2Ftinynetrc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sloria%2Ftinynetrc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sloria%2Ftinynetrc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sloria%2Ftinynetrc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sloria","download_url":"https://codeload.github.com/sloria/tinynetrc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248792904,"owners_count":21162462,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ftp","netrc","posix","python","python-2","python-3"],"created_at":"2024-09-30T19:17:49.792Z","updated_at":"2025-10-08T18:25:57.520Z","avatar_url":"https://github.com/sloria.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"*********\ntinynetrc\n*********\n\n.. image:: https://badgen.net/pypi/v/tinynetrc\n  :alt: pypi badge\n  :target: https://pypi.org/project/tinynetrc/\n\n.. image:: https://badgen.net/travis/sloria/tinynetrc/master\n  :alt: travis-ci status\n  :target: https://travis-ci.org/sloria/tinynetrc\n\nRead and write .netrc files in Python.\n\n\n``tinynetrc`` uses the `netrc \u003chttps://docs.python.org/3/library/netrc.html\u003e`_\nmodule from the standard library under the hood and adds a few\nimprovements:\n\n* Adds write functionality.\n* Fixes a std lib `bug \u003chttps://bugs.python.org/issue30806\u003e`_ with\n  formatting a .netrc file.*\n* Parses .netrc into dictionary values rather than tuples.\n\n\\*This bug is fixed in newer versions of Python.\n\nGet it now\n==========\n::\n\n    pip install tinynetrc\n\n\n``tinynetrc`` supports Python \u003e= 2.7 or \u003e= 3.5.\n\nUsage\n=====\n\n.. code-block:: python\n\n    from tinynetrc import Netrc\n\n    netrc = Netrc()  # parse ~/.netrc\n    # Get credentials\n    netrc['api.heroku.com']['login']\n    netrc['api.heroku.com']['password']\n\n    # Modify an existing entry\n    netrc['api.heroku.com']['password'] = 'newpassword'\n    netrc.save()  # writes to ~/.netrc\n\n    # Add a new entry\n    netrc['surge.surge.sh'] = {\n        'login': 'sloria1@gmail.com',\n        'password': 'secret'\n    }\n    netrc.save()\n\n    # Removing an new entry\n    del netrc['surge.surge.sh']\n    netrc.save()\n\n\nYou can also use ``Netrc`` as a context manager, which will automatically save\n``~/.netrc``.\n\n.. code-block:: python\n\n    from tinynetrc import Netrc\n    with Netrc() as netrc:\n        netrc['api.heroku.com']['password'] = 'newpassword'\n        assert netrc.is_dirty is True\n    # saved!\n\nLicense\n=======\n\nMIT licensed. See the bundled `LICENSE \u003chttps://github.com/sloria/tinynetrc/blob/master/LICENSE\u003e`_ file for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsloria%2Ftinynetrc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsloria%2Ftinynetrc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsloria%2Ftinynetrc/lists"}