# apple/swift-protobuf

Plugin and runtime library for using protobuf with Swift

Repository: https://github.com/apple/swift-protobuf
Canonical: https://ross.abutalabs.com/products/swift-protobuf
Language: Swift
License: Apache-2.0
License Family: permissive
Last push: 2026-08-26T14:03:21+00:00

## Health v2 (maintenance only)
Score: 96/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 90, longevity 100
- inputs: {"age_days": 3653, "days_push": 7, "days_rel": 71, "gap_med": 15, "n_releases_24m": 22}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4960, forks 533 (observed 2026-08-28T04:09:03.878064+00:00)

## What it is
Apple's Swift Protobuf provides a protoc plugin for generating Swift code from .proto files plus the runtime library needed to use that generated code. It supports efficient binary and standards-compliant JSON serialization with idiomatic Swift value semantics.

## Use cases
- serialize Swift structs to protobuf binary format
- generate Swift code from .proto schema files
- exchange protobuf messages between Swift and other languages
- encode and decode protobuf messages as JSON
- define schema-driven communication protocols in Swift apps

## When to choose
- you need protobuf serialization in Swift or iOS projects
- you want cross-language message interchange via .proto schemas
- you need conformance-tested, performant binary and JSON encoding

## When to avoid
- your project does not use Swift
- you need a serialization format without schema code generation
- you only need simple JSON without protobuf semantics

## Facets
- artifact type: library
- maturity: stable
- function: serialization, cli
- domain: developer-tools, apis, cross-platform
- platform: cross-platform
- tags: protobuf, code-generation, swift, ios, macos, linux

## Member repositories
- apple/swift-protobuf (main) score 96

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:03.878064+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:17:48.147444+00:00, confidence not recorded.
  - readme: https://github.com/apple/swift-protobuf (fetched 2026-08-28T04:09:03.878064+00:00, sha 2ba737d12601)
- Data as of 2026-08-30T08:39:29.467469+00:00.
