{"id":23473013,"url":"https://github.com/caltechlibrary/pairtree","last_synced_at":"2025-04-14T18:42:17.812Z","repository":{"id":57524254,"uuid":"138797485","full_name":"caltechlibrary/pairtree","owner":"caltechlibrary","description":"A simple encoder/decoder for converting object identifiers into a Pair Tree Path (path)","archived":false,"fork":false,"pushed_at":"2024-08-29T23:07:03.000Z","size":303,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-11T15:29:13.930Z","etag":null,"topics":["file-system-layout","library-science","pairtree"],"latest_commit_sha":null,"homepage":"https://caltechlibrary.github.io/pairtree","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/caltechlibrary.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":"codemeta.json","zenodo":null}},"created_at":"2018-06-26T21:50:55.000Z","updated_at":"2025-03-09T01:47:32.000Z","dependencies_parsed_at":"2024-06-21T16:33:43.533Z","dependency_job_id":"6bf19433-df7f-42b3-a2c8-a77a30a2b3f2","html_url":"https://github.com/caltechlibrary/pairtree","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caltechlibrary%2Fpairtree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caltechlibrary%2Fpairtree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caltechlibrary%2Fpairtree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caltechlibrary%2Fpairtree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/caltechlibrary","download_url":"https://codeload.github.com/caltechlibrary/pairtree/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248938348,"owners_count":21186390,"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":["file-system-layout","library-science","pairtree"],"created_at":"2024-12-24T17:14:43.490Z","updated_at":"2025-04-14T18:42:17.772Z","avatar_url":"https://github.com/caltechlibrary.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nPairtree\n========\n\nThis is a library for translate a UTF-8 string to/from a pairtree \nnotation. This is typically used in storing things on disc (e.g. repository filesystems). This code is based on the specification found at https://confluence.ucop.edu/download/attachments/14254128/PairtreeSpec.pdf?version=2\u0026modificationDate=1295552323000\u0026api=v2 which is cited on the [OCFL](https://github.com/OCFL/spec/wiki) wiki.\n\n\nFeatures\n--------\n\n- `Set()` will let you set the path separator\n    - `Separator` is a readonly value of the file separator used by `Encode()` and `Decode()`\n- `Encode()` will encode the provided string as a pairtree path\n- `Decode()` will decode a pairtree path returning the unencoded string\n\nExample\n-------\n\n```\n    import (\n        \"fmt\"\n        \"os\"\n\n        \"github.com/caltechlibrary/pairtree\"\n    )\n\n    func main() {\n        key := \"12mIEERD11\"\n        fmt.Printf(\"Key: %q\\n\", key)\n        pairPath := pairtree.Encode(key)\n        fmt.Printf(\"Endoded key %q -\u003e %q\\n\", key, pairPath)\n        key = Decode(pairPath)\n        fmt.Printf(\"Decoded path %q -\u003e %q\\n\", pairPath, key)\n    }\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaltechlibrary%2Fpairtree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcaltechlibrary%2Fpairtree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaltechlibrary%2Fpairtree/lists"}