{"id":15338896,"url":"https://github.com/maxgekk/libnetrc","last_synced_at":"2026-01-19T13:32:37.540Z","repository":{"id":146047772,"uuid":"118521569","full_name":"MaxGekk/libnetrc","owner":"MaxGekk","description":"Scala library for .netrc files","archived":false,"fork":false,"pushed_at":"2018-02-01T13:38:58.000Z","size":42,"stargazers_count":2,"open_issues_count":5,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-06T13:32:56.781Z","etag":null,"topics":["netrc","scala"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MaxGekk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-22T22:04:55.000Z","updated_at":"2018-06-29T20:35:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"ba66eaa5-7c55-40f0-b728-c0d3d357b4ff","html_url":"https://github.com/MaxGekk/libnetrc","commit_stats":{"total_commits":27,"total_committers":2,"mean_commits":13.5,"dds":0.4814814814814815,"last_synced_commit":"5ddcbe9253719de6ef69fab76f38501efc222ad6"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MaxGekk/libnetrc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxGekk%2Flibnetrc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxGekk%2Flibnetrc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxGekk%2Flibnetrc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxGekk%2Flibnetrc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MaxGekk","download_url":"https://codeload.github.com/MaxGekk/libnetrc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxGekk%2Flibnetrc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28569217,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T12:50:50.164Z","status":"ssl_error","status_checked_at":"2026-01-19T12:50:42.704Z","response_time":67,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["netrc","scala"],"created_at":"2024-10-01T10:27:31.584Z","updated_at":"2026-01-19T13:32:37.524Z","avatar_url":"https://github.com/MaxGekk.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# libnetrc\nThe library for reading and writing of .netrc files. It exposes API for parsing of .netrc like:\n\n```\nmachine shard1.cloud.databricks.com\nlogin user.name@gmail.com\npassword 12345678\n\nmachine collab.cloud.com login anonymous password helloworld\n\ndefault login anonymous password 123 account 456\n```\n\nand returns a collection of Scala classes that reflect the file structure:\n\n```\nNetRc(Seq(\n    Machine(name = \"shard1.cloud.databricks.com\", login = \"user.name@gmail.com\", password = \"12345678\"),\n    Machine(name = \"collab.cloud.com\", login = \"anonymous\", password = \"helloworld\"),\n    Default(login = \"anonymous\", password = \"123\", account = Some(\"456\"))\n))\n```\n\nBy default, the representation can be get from default .netrc in the home directory:\n\n```\nval netrc = NetRcFile.read \n```\n\nIn Linux, the file is /home/username/.netrc, on Mac OS it is /Users/username/.netrc and on Windows the name of the file is _netrc in the home dir.\n\nOnce the file is read and parsed, it could be updated by new items:\n\n```\nval netNetRc = netrc.upsert(\n    Machine(\"shard1.cloud.databricks.com\", \"user@outlook.com\", \"qwerty\")\n)\n```\n\nThe upsert method looks for an item with the same name and update it if it exists otherwise it adds new one. New machine items is added before any default items. New default item updates the old one if it is presented in the structure or replaces all existed default items. In any case, only one default item presents after the update.\n\nThe delete method finds all machine items with the matched names and deletes thems:\n\n```\nnetrc.delete(\"\"\".*\\.cloud.com\"\"\".r)\n```\n\nTo delete all default items:\n\n```\nnetrc.deleteDefault()\n```\n\nThe find method scans all items and checks either item's name, login, password or account is matched to user's needs:\n\n```\nval items: Iterable[Items] = netrc.find(\"\"\"^cloud.*\\.com\"\"\".r)\n```\n\nThe updated instance of NetRc could be saved back to the .netrc file:\n\n```\nnewNetRc.save(\"/home/username/copy_of_netrc\")\n```\n\nbesides of that it could be appended to an existing file:\n\n```\nNetRc(Seq(\n    Machine(\"host1\", \"user1\", \"password1\")\n)).save(append = true)\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxgekk%2Flibnetrc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxgekk%2Flibnetrc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxgekk%2Flibnetrc/lists"}