{"id":22385491,"url":"https://github.com/sersoft-gmbh/path-wrangler","last_synced_at":"2026-03-01T15:34:03.593Z","repository":{"id":37693236,"uuid":"238922120","full_name":"sersoft-gmbh/path-wrangler","owner":"sersoft-gmbh","description":"A path library written in Swift","archived":false,"fork":false,"pushed_at":"2026-02-09T14:31:26.000Z","size":1317,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-09T18:58:00.836Z","etag":null,"topics":["filepaths","swift"],"latest_commit_sha":null,"homepage":"https://sersoft-gmbh.github.io/path-wrangler/","language":"Swift","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/sersoft-gmbh.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-02-07T12:55:09.000Z","updated_at":"2026-02-09T14:28:49.000Z","dependencies_parsed_at":"2024-12-05T01:29:15.050Z","dependency_job_id":"fa7c984f-57ec-4f70-a14d-b6b592e3ac6a","html_url":"https://github.com/sersoft-gmbh/path-wrangler","commit_stats":{"total_commits":152,"total_committers":2,"mean_commits":76.0,"dds":0.4407894736842105,"last_synced_commit":"ee920d1b6ab29873446518b677d831ad5e3bd0e0"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/sersoft-gmbh/path-wrangler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sersoft-gmbh%2Fpath-wrangler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sersoft-gmbh%2Fpath-wrangler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sersoft-gmbh%2Fpath-wrangler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sersoft-gmbh%2Fpath-wrangler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sersoft-gmbh","download_url":"https://codeload.github.com/sersoft-gmbh/path-wrangler/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sersoft-gmbh%2Fpath-wrangler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29973320,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T15:29:09.406Z","status":"ssl_error","status_checked_at":"2026-03-01T15:28:28.558Z","response_time":124,"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":["filepaths","swift"],"created_at":"2024-12-05T01:25:53.343Z","updated_at":"2026-03-01T15:34:03.571Z","avatar_url":"https://github.com/sersoft-gmbh.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PathWrangler\n\n[![GitHub release](https://img.shields.io/github/release/sersoft-gmbh/path-wrangler.svg?style=flat)](https://github.com/sersoft-gmbh/path-wrangler/releases/latest)\n![Tests](https://github.com/sersoft-gmbh/path-wrangler/workflows/Tests/badge.svg)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/2c8e4e87ed7c4b9b9be446aa2e14b787)](https://www.codacy.com/gh/sersoft-gmbh/path-wrangler?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=sersoft-gmbh/path-wrangler\u0026amp;utm_campaign=Badge_Grade)\n[![codecov](https://codecov.io/gh/sersoft-gmbh/path-wrangler/branch/master/graph/badge.svg)](https://codecov.io/gh/sersoft-gmbh/path-wrangler)\n[![Docs](https://img.shields.io/badge/-documentation-informational)](https://sersoft-gmbh.github.io/path-wrangler)\n\nA simple path library written in Swift.\n\n## Installation\n\nAdd the following package dependency in your `Package.swift`:\n```swift\n.package(url: \"https://github.com/sersoft-gmbh/path-wrangler\", from: \"2.0.0\"),\n```\n\nOr add it via Xcode (as of Xcode 11).\n\n## Usage\n\nPathWrangler has two basic representations of a path: `AbsolutePath` and `RelativePath`. They have everything you need for simple yet great path computations.\nA relative path (as the name suggests) is not bound to any root. It's relative to whatever absolute path you need it to be.\nThus it can also be turned into an absolute path using `absolute(in:)`.\nAn absolute path on the other hand is a path that always starts at the root.\n\nBoth paths know how to \"resolve\" (or \"simplify\") themselves. By doing so, they try to resolve and thus remove references of the current folder (`.`) and parent folder (`..`).\nSince absolute paths know where to start, they are even able to resolve symlinks. To do so, however, the path must exist on disk.\nBoth path implementations also have a `current` accessor that returns the current path.\nFor `AbsolutePath` this is the `cwd`. For `RelativePath` this is always just the relative path to the current directory, thus `.`.\n\nPath components or a relative path can be appended to both paths. There is even a convenience API that allows path building that almost looks like the path representation:\n```swift\nlet someSubDir = AbsolutePath.root / \"folder1\" / \"folder2\" // -\u003e \"/folder1/folder2\"\n```\n\nA protocol named `PathComponentConvertible` is used to represent path components. A bunch of default conformances (like for `String`, `Int`, etc.) make working with it easy.\nBut adding more conformances is also easy. Just implement the only requirement `pathComponent` and return the path component of the conforming type.\nAs of then, the type can be used wherever path components are used in PathWrangler (like with the nice `/` API mentioned before).\n\nThe PathWrangler package contains two products:\n\n-   One is `CorePathWrangler` which contains all the underlying logic but has no dependency on Foundation whatsoever.\n     It uses a few system APIs (like `getcwd` for determining the current working directory), but is otherwise mainly implemented in pure Swift using only stdlib types.\n     It also depends on [Swift Algorithms](https://github.com/apple/swift-algorithms).\n-   The other one is `PathWrangler`  which adds a few neat APIs to `Foundation` types like `FileManager` or `URL`\n     that make interacting with `AbsolutePath` and `RelativePath` easier.\n\n## Documentation\n\nThe API is documented using header doc. If you prefer to view the documentation as a webpage, there is an online version available for you:\n\n-   [CorePathWrangler](https://sersoft-gmbh.github.io/path-wrangler/main/documentation/corepathwrangler)\n-   [PathWrangler](https://sersoft-gmbh.github.io/path-wrangler/main/documentation/pathwrangler)\n\n## Contributing\n\nIf you find a bug / like to see a new feature in PathWrangler there are a few ways of helping out:\n\n-   If you can fix the bug / implement the feature yourself please do and open a PR.\n-   If you know how to code (which you probably do), please add a (failing) test and open a PR. We'll try to get your test green ASAP.\n-   If you can do neither, then open an issue. While this might be the easiest way, it will likely take the longest for the bug to be fixed / feature to be implemented.\n\n## License\n\nSee [LICENSE](./LICENSE) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsersoft-gmbh%2Fpath-wrangler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsersoft-gmbh%2Fpath-wrangler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsersoft-gmbh%2Fpath-wrangler/lists"}