Frequently Asked Questions
- What is the Swift Package Index?
- What is the Swift Package Manager?
- Who built the Swift Package Index?
- Can I support the Swift Package Index?
- What happened to the SwiftPM Library?
- How does the Swift Package Index work?
- What about the GitHub Package Registry?
- How is the Swift language and platform support calculated?
- What do the license colours mean?
- Can I contribute to the Swift Package Index?
- Is there an API?
- Why are package versions missing?
- What is the SPI-Playgrounds app?
- How can I filter search results?
What is the Swift Package Index?
The Swift Package Index is a search engine for packages that support the Swift Package Manager.
But this site isn't simply a search tool. Choosing the right dependencies is about more than just finding code that does what you need. Are the libraries you're choosing well maintained? How long have they been in development? Are they well tested? Picking high-quality packages is hard, and the Swift Package Index helps you make better decisions about your dependencies.
What is the Swift Package Manager?
The Swift Package Manager is a tool built by Apple as part of the Swift project for integrating libraries and frameworks into your Swift apps. It launched in 2015 and gained integration with Xcode 11 in 2019.
To find out more about the Swift Package Manager, there's documentation on the Apple developer site.
Who built the Swift Package Index?
Can I support the Swift Package Index?
What happened to the SwiftPM Library?
This site is a spiritual successor and replacement for the SwiftPM Library. It has been re-implemented from scratch in Swift using Vapor and has had a name change at the same time. We learned many valuable lessons from the original implementation, and the Swift Package Index is the future of Swift package search.
How does the Swift Package Index work?
The data in this index originates from this list of repositories. When someone adds a repository to the package list, this site immediately makes a full clone of the package source. Metadata is extracted from the source code and local git history, as well as from the hosted repository on GitHub.
Packages are also polled for changes every few hours, so the information you see in the index always reflects the latest package releases, without any action required from the package author.
What about the GitHub Package Registry?
We’re excited to see the GitHub Package Registry gain support for the Swift packages. There’s a proposal under discussion for the Swift Package Manager support to support package registries formally, but a package registry is not a package search engine like this site is. If the Swift project accepts the proposal, this site will support and index the GitHub Package Registry, and any other significant implementation of a package registry as they become available.
How is the Swift language and platform support calculated?
The Swift Package Index includes build information which is not able to be derived from the package manifest. Including full coverage of both Swift version compatibility, and platform compatibility, including Linux!
To determine what versions of Swift a package supports, and what platforms it is compatible with, the Swift Package Index runs real-world builds using several Swift compilers targeting several different platforms. You can learn more about how we do this in the Swift Package Index Build System FAQ.
What do the license colours mean?
If a package's license shows with a background that is orange or red, it is for one of three reasons:
- The package does not have a license.
- We're unable to detect the software license that the package uses.
- The license chosen by the package authors is incompatible with the terms and conditions of the App Store.
If the package license is showing as "No License", it means we could not find any license information in the package repository.
If you are considering using a package that does not have a license, you should be aware that it presents a significant legal risk. Code without a license is not open-source, and the original author reserves all rights by default. For more information, read this great blog post on the significant risks of using unlicensed code.
If you are the package author, you can fix this by adding a
LICENSE file with an open-source license that is compatible with the terms and conditions of the App Store. The Swift Package Index will update license metadata a few hours after you push a license to the repository.
If the package license is showing as "Unknown License", it means we have been unable to detect the license. It may be an open-source license where GitHub's license detection algorithm has failed, or it could be a completely different type of license, such as a commercial license. If you are considering using a package with an unidentified license, you should check the package's repository for the license details.
If you are the package author of a package showing an unknown license, and you believe it should show a valid open-source license, please see GitHub's documentation. The Swift Package Index will update licenses a few hours after GitHub recognises a valid license.
If the package license shows with an orange background but does not say "No License" or "Unknown License", then the package is using a license which is incompatible with the terms and conditions of the App Store, such as any GPL style license. If you are considering shipping your app to the App Store, you should be aware that using code licensed under one of these licences presents a legal risk.
Can I contribute to the Swift Package Index?
All participation in this project, whether contributing code, communicating in discussions or issues, or pull requests, is subject to our code of conduct. Please read the Code of Conduct before contributing.
Is there an API?
Not right now. The Swift Package Index is in a period of rapid development right now, and we'd like the flexibility to change things around at this stage in the project's life. It's on the list for the future though!
Why are package versions missing?
Package releases must use git tags that are fully qualified semantic versions. For example,
2.6.0 is a valid semantic version number, and
2.6 is not.
A good way to check what the latest semantic version release of a package is is to add it to a project in Xcode. By default, Xcode will show the latest semantic version when adding the package to a project. The number you see on this site should match the version Xcode shows when adding the package. If you see something different, please raise an issue!
What is the SPI-Playgrounds app?
Have you ever wanted to try out a package in a Swift playground before you decide to use it? Click “Try in a Playground” from any package page and have the Swift Package Index Playgrounds app create a playground with the package automatically imported, ready for testing and experimentation.
If you don't have the SPI-Playgrounds app installed, you can download it for macOS here.
How can I filter search results?
You can narrow package search results with a search syntax that filters based on package metadata. For example, you could search for packages that match "networking" and have more than 500 stars.
The following package metadata fields are supported:
author(Author): The owner of the package's repository.
last_activity(Date): The most recent maintenance activity on the package repository. Any commit to the default branch or merging/closing an issue or pull request counts as a maintenance activity.
last_commit(Date): The date of the last commit to the package repository.
license(License): The package's license.
keyword(Keyword): Filter on matching package keywords.
platform(Platform(s)): Filter on one or more compatible platforms (iOS, macOS, Linux, tvOS, or watchOS).
stars(Number): The number of stars the package has.
<= to filter for values greater than, greater than or equal to, less than, and less than or equal to another value. All filters are combined with an AND operator.
For example, a query of
http stars:>500 platform:ios,linux shows packages matching the word "http" that have more than 500 stars and are compatible with both iOS and Linux platforms.
Querying Number values
You can filter on numeric values with any integer and the standard
Querying Date values
Specify all dates using ISO8601 format, which is
YYYY-MM-DD (year-month-day). You can filter on dates with the standard
For example, a query of
charts last_activity:>=2021-02-01 shows packages matching the word "charts" that have also received some maintenance activity since the start of February 2021.
Querying License values
Querying Author or Keyword values
You can search for packages created by a specific user or organisation by filtering on
author. For example, a query of
fluent author:vapor matches any package containing the word "fluent" owned by the vapor organisation.
Similarly, you can search for packages that contain keywords with a
keyword filter. For example,
keyword:accessibility matches any package having the "accessibility" keyword.
Querying Platform values
You can search for packages that are compatible with a platform using a
platform filter. Specify multiple platforms together with commas. For example,
testing platform:ios,linux shows packages matching the word "layout" that are compatible with both iOS and Linux.
Note: Platform compatibility data comes from the build system and is sourced from real-world build results.
Excluding results using filters
You can also exclude packages that match a filter by prefixing the filter value with an
! character. For example, searching for
license:!mit matches packages that are not licensed under the MIT license.