Skip to content

canonical/craft-platforms

Repository files navigation

Craft Platforms

QA ReadTheDocs badge PyPI - Version Ruff Security scan

Craft Platforms is a library that handles platform information for Snapcraft, Charmcraft, Rockcraft, and other craft apps. A platform in this sense is the combination of an operating system version and its target architecture.

The library's primary function is to parse information in a craft project file, such as snapcraft.yaml, and creates a build plan from it. The plan is a manifest for environments, describing those where the artifact can build and run.

This library is most useful for developers who build apps with the Craft Application library.

Basic usage

Craft Platforms creates exhaustive build plans for any craft-like data structure, taking into account differences between applications.

>>> import craft_platforms
>>> craft_platforms.get_build_plan(
...     "mycraft",
...     project_data={"base": "debian@14", "platforms": {"riscv64": None}}
... )
[BuildInfo(platform='riscv64', build_on='riscv64', build_for='riscv64', build_base=DistroBase(distribution='debian', series='14'))]

Installation

Craft Platforms is a pure Python library that runs on Python 3.8 or later. It can be installed from PyPI

Documentation

The Craft Platforms documentation contains reference information for the library.

Community and support

You can report any issues or bugs on the project's GitHub repository.

Craft Platforms is covered by the Ubuntu Code of Conduct.

Contribute to Craft Platforms

Craft Platforms is open source and part of the Canonical family. We would love your help.

If you're interested, start with the contribution guide.

We welcome any suggestions and help with the docs. The Canonical Open Documentation Academy is the hub for doc development, including Craft Platforms docs. No prior coding experience is required.

License and copyright

Craft Platforms is released under the LGPL-3.0 license.

© 2023-2025 Canonical Ltd.

About

Manage platforms and architectures for craft applications.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 11