{"id":28296744,"url":"https://github.com/atprotokit/atsyntaxtools","last_synced_at":"2025-06-14T11:30:30.585Z","repository":{"id":292631706,"uuid":"980483895","full_name":"ATProtoKit/ATSyntaxTools","owner":"ATProtoKit","description":"A Swift implementation of validation helpers for identifier strings.","archived":false,"fork":false,"pushed_at":"2025-05-18T22:14:51.000Z","size":368,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-29T21:12:12.541Z","etag":null,"topics":["api","atproto","atprotocol","bluesky","decentralized","social-media","swift","swift-package-manager","syntax"],"latest_commit_sha":null,"homepage":"https://swiftpackageindex.com/ATProtoKit/ATSyntaxTools/documentation/atsyntaxtools","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/ATProtoKit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["MasterJ93"]}},"created_at":"2025-05-09T07:51:58.000Z","updated_at":"2025-05-18T22:18:32.000Z","dependencies_parsed_at":"2025-05-11T08:38:02.556Z","dependency_job_id":null,"html_url":"https://github.com/ATProtoKit/ATSyntaxTools","commit_stats":null,"previous_names":["atprotokit/atsyntaxtools"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ATProtoKit/ATSyntaxTools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ATProtoKit%2FATSyntaxTools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ATProtoKit%2FATSyntaxTools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ATProtoKit%2FATSyntaxTools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ATProtoKit%2FATSyntaxTools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ATProtoKit","download_url":"https://codeload.github.com/ATProtoKit/ATSyntaxTools/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ATProtoKit%2FATSyntaxTools/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259808101,"owners_count":22914570,"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":["api","atproto","atprotocol","bluesky","decentralized","social-media","swift","swift-package-manager","syntax"],"created_at":"2025-05-22T21:19:56.171Z","updated_at":"2025-06-14T11:30:30.575Z","avatar_url":"https://github.com/ATProtoKit.png","language":"Swift","funding_links":["https://github.com/sponsors/MasterJ93"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/ATProtoKit/ATSyntaxTools/blob/main/Sources/ATSyntaxTools/Documentation.docc/Resources/atsyntaxtools_icon.png\" height=\"128\" alt=\"An icon for ATSyntaxTools, which contains three stacks of rounded rectangles in an isometric top view. At the top stack, there's an at symbol in a thick weight, with a pointed arrow at the tip. On the left and right side, there are left and right curly braces in a thick weight. Behind the at symbol is a faded slash. The three stacks are, from top to bottom, green, teal, and blue.\"\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eATSyntaxTools\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003eSyntax validators for the AT Protocol, written in Swift.\u003c/p\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FATProtoKit%2FATSyntaxTools%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/ATProtoKit/ATSyntaxTools)\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FATProtoKit%2FATSyntaxTools%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/ATProtoKit/ATSyntaxTools)\n[![GitHub Repo stars](https://img.shields.io/github/stars/ATProtoKit/ATSyntaxTools?style=flat\u0026logo=github)](https://github.com/ATProtoKit/ATSyntaxTools)\n\n\u003c/div\u003e\n\u003cdiv align=\"center\"\u003e\n\n[![Static Badge](https://img.shields.io/badge/Follow-%40cjrriley.com-0073fa?style=flat\u0026logo=bluesky\u0026labelColor=%23151e27\u0026link=https%3A%2F%2Fbsky.app%2Fprofile%2Fcjrriley.com)](https://bsky.app/profile/cjrriley.com)\n[![GitHub Sponsors](https://img.shields.io/github/sponsors/masterj93?color=%23cb5f96\u0026link=https%3A%2F%2Fgithub.com%2Fsponsors%2FMasterJ93)](https://github.com/sponsors/MasterJ93)\n\n\u003c/div\u003e\n\nATSyntaxTools is a lightweight Swift library for handling validations for various identifiers within the AT Protocol. It's fast, simple, and leaves an extremely small footprint in your project. This package is designed to ensure that you're not passing the wrong infroamtion that could cause your project to crash.\n\nThis Swift package mainly focuses on the syntax validation side of the AT Protocol. This is based on the [`syntax`](https://github.com/bluesky-social/atproto/tree/main/packages/syntax) package from the official [`atproto`](https://github.com/bluesky-social/atproto) TypeScript repository.\n\n## Quick Examples\n\nHere are the following identifiers for you to use in this package.\n\n### Handles\n\n```swift\nimport ATSyntaxTools\n\ndo {\n    let isHandleValid = HandleValidator.isHandleValid(\"alice.test\")\n    print(isHandleValid) // returns `true`.\n\n    try HandleValidator.validate(\"alice.test\") // Doesn't throw; handle is valid.\n\n    let isHandleValid2 = HandleValidator.isHandleValid(\"al!ce.test\")\n    print(isHandleValid2) // returns `false`.\n\n    try HandleValidator.validate(\"al!ce.test\") // Throws InvalidHandleError.\n} catch {\n    print(error)\n}\n```\n\n### Decentralized Identifier (DID)\n\n```swift\nimport ATSyntaxTools\n\ndo {\n    try DIDValidator.validate(\"did:method:val\") // Doesn't throw; DID is valid.\n    try DIDValidator.validate(\":did:method:val\") // Throws InvalidDIDError.\n} catch {\n    print(error)\n}\n```\n\n### Namespaced Identifier (NSID)\n\n```swift\nimport ATSyntaxTools\n\ndo {\n    try NSIDValidator.validate(\"com.example.foo\") // Doesn't throw; NSID is valid.\n    try NSIDValidator.validate(\"com.example.someRecord\") // Doesn't throw; NSID is valid.\n    try NSIDValidator.validate(\"example.com/foo\") // Throws InvalidNSIDError.\n    try NSIDValidator.validate(\"foo\") // Throws InvalidNSIDError.\n} catch {\n    print(error)\n}\n```\n\n### AT URIs\n\n```swift\nimport ATSyntaxTools\n\ndo {\n    try ATURIValidator.validate(\"at://bob.com/com.example.post/1234\") // Doesn't throw; AT URI is valid.\n    try ATURIValidator.validate(\"at:://bob.com/com.examp!e.2/1234\") // Throws InvalidATURIError\n} catch {\n    print(error)\n}\n```\n\n## Installation\nYou can use the Swift Package Manager to download and import the library into your project:\n```swift\ndependencies: [\n    .package(url: \"https://github.com/ATProtoKit/ATSyntaxTools.git\", from: \"0.1.0\")\n]\n```\n\nThen under `targets`:\n```swift\ntargets: [\n    .target(\n        // name: \"[name of target]\",\n        dependencies: [\n            .product(name: \"ATSyntaxTools\", package: \"atsyntaxtools\")\n        ]\n    )\n]\n```\n\n## Requirements\nTo use ATSyntaxTools in your apps, your app should target the specific version numbers:\n- **iOS** and **iPadOS** 14 or later.\n- **macOS** 13 or later.\n- **tvOS** 14 or later.\n- **visionOS** 1 or later.\n- **watchOS** 9 or later.\n\nFor Linux, you need to use Swift 6.0 or later. On Linux, the minimum requirements include:\n- **Amazon Linux** 2\n- **Debian** 12\n- **Fedora** 39\n- **Red Hat UBI** 9\n- **Ubuntu** 20.04\n\nYou can also use this project for any programs you make using Swift and running on **Docker**.\n\n\u003e [!WARNING]\n\u003e As of right now, Windows support is theoretically possible, but not has not been tested to work. Contributions and feedback on making it fully compatible for Windows and Windows Server are welcomed.\n\n## Submitting Contributions and Feedback\nWhile this project will change significantly, feedback, issues, and contributions are highly welcomed and encouraged. If you'd like to contribute to this project, please be sure to read both the [API Guidelines](https://github.com/ATProtoKit/ATSyntaxTools/blob/main/API_GUIDELINES.md) as well as the [Contributor Guidelines](https://github.com/MasterJ93/ATProtoKit/blob/main/CONTRIBUTING.md) before submitting a pull request. Any issues (such as bug reports or feedback) can be submitted in the [Issues](https://github.com/ATProtoKit/ATSyntaxTools/issues) tab. Finally, if there are any security vulnerabilities, please read [SECURITY.md](https://github.com/ATProtoKit/ATSyntaxTools/blob/main/SECURITY.md) for how to report it.\n\nIf you have any questions, you can ask me on Bluesky ([@cjrriley.com](https://bsky.app/profile/cjrriley.com)). And while you're at it, give me a follow! I'm also active on the [Bluesky API Touchers](https://discord.gg/3srmDsHSZJ) Discord server.\n\n## License\nThis Swift package is using the Apache 2.0 License. Please view [LICENSE.md](https://github.com/ATProtoKit/ATSyntaxTools/blob/main/LICENSE.md) for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatprotokit%2Fatsyntaxtools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatprotokit%2Fatsyntaxtools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatprotokit%2Fatsyntaxtools/lists"}