Skip to main content

# Craft Platforms

[![QA](https://github.com/canonical/craft-platforms/actions/workflows/qa.yaml/badge.svg)](https://github.com/canonical/craft-platforms/actions/workflows/qa.yaml) [![ReadTheDocs badge](https://readthedocs.com/projects/canonical-craft-platforms/badge/?version=latest)](https://canonical-craft-platforms.readthedocs-hosted.com) [![PyPI - Version](https://img.shields.io/pypi/v/craft-platforms)](https://pypi.org/project/craft-platforms) [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) [![Security scan](https://github.com/canonical/craft-platforms/actions/workflows/security-scan.yaml/badge.svg)](https://github.com/canonical/craft-platforms/actions/workflows/security-scan.yaml)

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](https://canonical-craft-application.readthedocs-hosted.com) library.

## Basic usage

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

`terminal >>> 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](https://pypi.org/project/craft-platforms)

## Documentation

The [Craft Platforms documentation](https://canonical-craft-platforms.readthedocs-hosted.com) contains reference information for the library.

## Community and support

You can report any issues or bugs on the project’s [GitHub repository](https://github.com/canonical/craft-platforms/issues).

Craft Platforms is covered by the [Ubuntu Code of Conduct](https://ubuntu.com/community/ethos/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](HACKING.rst).

We welcome any suggestions and help with the docs. The [Canonical Open Documentation Academy](https://github.com/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](LICENSE).

© 2023-2025 Canonical Ltd.

Metadata

Release files for craft-platforms 0.12.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for craft-platforms 0.12.0
File Size Uploaded
craft_platforms-0.12.0.tar.gz 349.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for craft-platforms 0.12.0
File Interpreter ABI Platform
craft_platforms-0.12.0-py3-none-any.whl Python 3 none any Details

Total release size: 389.3 kB

Release files / craft_platforms-0.12.0.tar.gz

Download URL craft_platforms-0.12.0.tar.gz
Size 349.9 kB
Tags Source
SHA-256 checksum
How to use checksums
497b6421fc5f464ee1f31da60ae1211bd3101722770afae72e0b330e54883e9d
BLAKE2b-256 checksum
How to use checksums
a0f2507e3b1bd017f51bea6c70205744239b62eac20c552fa0ee1f1c30019752
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 10, 2026.

Transparency log

Release files / craft_platforms-0.12.0-py3-none-any.whl

Download URL craft_platforms-0.12.0-py3-none-any.whl
Size 39.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
71fff4a3aeb075df878cada38bb89b0d36c9efb5423973db7625da983b8ee6f6
BLAKE2b-256 checksum
How to use checksums
94d5d7eb7180085f70756372acfc27e782affe21fda791d801cff6fc10bb047a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 10, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.12.0 This release

2 release files

0.10.0

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page