Keyboard Support

Contact and Search Homepage

Header bottom

Other versions
Version 16.0 (current version)Version 15.0Version 14.0

On this page

KeymanPackage class


The KeymanPackage class and its subclasses represent Keyman package files and their contents.




The KeymanPackage is the base class used to represent various types of Keyman packages within the Keyman Engine and their contents. As an abstract class, it serves as a "type erasure" for its subclasses KeyboardKeymanPackage and LexicalModelKeymanPackage, both of which offer richer typing for certain fields and methods.


key: KeymanPackage.Key
Returns a unique identifier for the package, usable in package-search operations.
languages: [Language]
An array of languages supported by the keyboards or lexical models contained by the package.

The most relevant fields for Language type are the name: String and id: String fields. (The other fields are mostly 'legacy'.)
name: String
The user-friendly name of the package.
resourceType: LanguageResourceType
An enum representing the type of LanguageResource contained within the package.

May be either .keyboard (for a KeyboardKeymanPackage) or .lexicalModel (for a LexicalModelKeymanPackage).
sourceFolder: URL
The base folder for the package's extracted contents.

Note: for packages opened with ResourceFileManager.shared.prepareKMPInstall, this may be a temporary location!

Stability is not guaranteed if you write to any contents of the folder or its subfolders, but read operations are permitted.
version: Version
The package's version.


installableResourceSets -> [[AnyLanguageResource]]
Returns a list of all resources & language pairings supported by this package.
installableResources(forLanguage: String) -> [AnyLanguageResource]
A language-filtered version of the method above.
pageURL(for: KeymanPackagePage) -> URL?
Provides a link to known .html files contained by the package.

Supported pages: .readme, .welcome, .custom(bundledPath: String), the latter of which may target arbitrary locations within the package.


Added in Keyman Engine for iPhone and iPad 14.0.

See Also

Used to display web pages contained within a package.
Represents packages containing keyboards.
Represents packages containing lexical models.