Skip to main content

Rust library for generate Apple Wallet Passes for iOS, WatchOS, MacOS.

Project description

Passes

A Rust library for generating PassKit passes, featuring:

  • Read & parse .pkpass files
  • Build & make passes by using library API
  • Sign passes with certificate and compress to .pkpass
  • Change field values is pass by key name
  • Supported semantic tags for pass & fields
  • All features of Wallet Passes standard represented in library

Documentation:

Developer Setup

Quick Start (Recommended)

macOS/Linux:

chmod +x dev-setup.sh
./dev-setup.sh

Windows:

dev-setup.bat

This will:

  • Install Rust (if needed)
  • Install maturin (Python-Rust build tool)
  • Create a Python virtual environment
  • Build and install the package in development mode

Manual Setup

  1. Install Rust:

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    
  2. Install Python dependencies:

    pip install maturin
    
  3. Build for development:

    maturin develop
    
  4. Test the installation:

    import passes_rs_py
    

Development Commands

  • Build for development: maturin develop
  • Build release wheel: maturin build --release
  • Run Rust tests: cargo test
  • Format code: cargo fmt

Usage

Add this to your Cargo.toml:

[dependencies]
neopasses = "0.1.0"

Example

Rust API

For building simple pass:

// Creating pass
let pass = PassBuilder::new(PassConfig {
    organization_name: "Test organization".into(),
    description: "Super gentlememe pass".into(),
    pass_type_identifier: "com.example.pass".into(),
    team_identifier: "AA00AA0A0A".into(),
    serial_number: "ABCDEFG1234567890".into(),
})
.grouping_identifier(String::from("com.example.pass.app"))
.logo_text("Test pass".into())
.build();

Creating package and generate .pkpass file:

let mut package = Package::new(pass);

// Save package as .pkpass
let path = Path::new("test_pass.pkpass");
let file = match File::create(&path) {
    Err(why) => panic!("couldn't create {}: {}", path.display(), why),
    Ok(file) => file,
};
package.write(file).unwrap();

Python Bindings

The library also provides Python bindings with comprehensive asset support:

from passes_rs_py import generate_pass

# Generate pass with multiple asset types
generate_pass(
    config=pass_json_config,
    cert_path="path/to/cert.pem",
    key_path="path/to/key.key",
    output_path="output.pkpass",
    
    # All asset types supported
    icon_path="assets/icon.png",
    icon2x_path="assets/icon@2x.png",
    logo_path="assets/logo.png",
    logo2x_path="assets/logo@2x.png",
    thumbnail_path="assets/thumbnail.png",
    thumbnail2x_path="assets/thumbnail@2x.png",
    strip_path="assets/strip.png",
    strip2x_path="assets/strip@2x.png",
    background_path="assets/background.png",
    background2x_path="assets/background@2x.png",
    footer_path="assets/footer.png",
    footer2x_path="assets/footer@2x.png",
)

Supported Asset Types

  • Icons: icon_path, icon2x_path - Lock screen and app display
  • Logos: logo_path, logo2x_path - Top-left corner branding
  • Thumbnails: thumbnail_path, thumbnail2x_path - Field area images
  • Strip images: strip_path, strip2x_path - Behind primary fields
  • Backgrounds: background_path, background2x_path - Full pass background
  • Footers: footer_path, footer2x_path - Near barcode area

All asset parameters are optional. See ASSETS.md for detailed documentation.

For more examples, see examples directory.

License

Passes is distributed under the terms of the MIT license. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

passes_rs_py-3.0.0-cp312-cp312-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.12Windows x86-64

passes_rs_py-3.0.0-cp312-cp312-win32.whl (1.5 MB view details)

Uploaded CPython 3.12Windows x86

passes_rs_py-3.0.0-cp312-cp312-musllinux_1_2_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

passes_rs_py-3.0.0-cp312-cp312-musllinux_1_2_i686.whl (2.2 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ i686

passes_rs_py-3.0.0-cp312-cp312-musllinux_1_2_armv7l.whl (2.2 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ ARMv7l

passes_rs_py-3.0.0-cp312-cp312-musllinux_1_2_aarch64.whl (2.2 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ ARM64

passes_rs_py-3.0.0-cp312-cp312-manylinux_2_28_aarch64.whl (2.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

passes_rs_py-3.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

passes_rs_py-3.0.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl (2.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ s390x

passes_rs_py-3.0.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (2.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ppc64le

passes_rs_py-3.0.0-cp312-cp312-manylinux_2_17_ppc64.manylinux2014_ppc64.whl (2.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ppc64

passes_rs_py-3.0.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl (2.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.5+ i686

passes_rs_py-3.0.0-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (3.6 MB view details)

Uploaded CPython 3.12macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

File details

Details for the file passes_rs_py-3.0.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for passes_rs_py-3.0.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c304e93df23ce6288a00578e4ab7386be7c7dd9faf9113214b174111864125c5
MD5 748c326475720df442728bda16c164b9
BLAKE2b-256 98c985b5bce5b731db4e7267767dcc7c0f052893ec78aaac86f6d52e23da177b

See more details on using hashes here.

Provenance

The following attestation bundles were made for passes_rs_py-3.0.0-cp312-cp312-win_amd64.whl:

Publisher: py-release.yml on jontyms/neo-passes-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file passes_rs_py-3.0.0-cp312-cp312-win32.whl.

File metadata

  • Download URL: passes_rs_py-3.0.0-cp312-cp312-win32.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.12, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for passes_rs_py-3.0.0-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 132058b03509d4a48880546af8f947d7484b1d27ff6b6cb957f2b53c5c6a6b71
MD5 943aa8196d32288d42824eb1d4e2deb6
BLAKE2b-256 253aee530ceb67c6ff2169b3c26c2c57fd76ca0b5463068ec82380a1bbb1b3d5

See more details on using hashes here.

Provenance

The following attestation bundles were made for passes_rs_py-3.0.0-cp312-cp312-win32.whl:

Publisher: py-release.yml on jontyms/neo-passes-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file passes_rs_py-3.0.0-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for passes_rs_py-3.0.0-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 a4ffe13f388ca0ca5ed02c9c2688b66a9d9ad285623d3491d92374901be4c83b
MD5 3ae71a3960d6fb784b78a26d9f18412c
BLAKE2b-256 a2259103f8e24b25750afca77a95a76f00cb14fff7b249ea4989120217698ebf

See more details on using hashes here.

Provenance

The following attestation bundles were made for passes_rs_py-3.0.0-cp312-cp312-musllinux_1_2_x86_64.whl:

Publisher: py-release.yml on jontyms/neo-passes-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file passes_rs_py-3.0.0-cp312-cp312-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for passes_rs_py-3.0.0-cp312-cp312-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 fd045993d686624cd2043d5ec01f54790b9262fc058cbfb597fb15d53d45c488
MD5 976f0b267579a5136193ad3829208063
BLAKE2b-256 ec01019ef80635411bce79982f87d8c79238ec754b48c6afdbca6b0770094d7b

See more details on using hashes here.

Provenance

The following attestation bundles were made for passes_rs_py-3.0.0-cp312-cp312-musllinux_1_2_i686.whl:

Publisher: py-release.yml on jontyms/neo-passes-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file passes_rs_py-3.0.0-cp312-cp312-musllinux_1_2_armv7l.whl.

File metadata

File hashes

Hashes for passes_rs_py-3.0.0-cp312-cp312-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 173d379cc30d0ed15709c64c357ec4ce9729c3229bd45038aeb2571d6dd38e1c
MD5 6d71c961830dff5b637bd408b5c55bd5
BLAKE2b-256 0e9d3fe7eae14f6eecc67f7cc84fe0c98d19ae723098cb9c115bd1db953481b2

See more details on using hashes here.

Provenance

The following attestation bundles were made for passes_rs_py-3.0.0-cp312-cp312-musllinux_1_2_armv7l.whl:

Publisher: py-release.yml on jontyms/neo-passes-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file passes_rs_py-3.0.0-cp312-cp312-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for passes_rs_py-3.0.0-cp312-cp312-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 c6be54e3378ab8c0745018ae074c883192e6005149c37727cbb0aefc15e53ad3
MD5 83a627a4f70dbf1242fd1e7415bbd42d
BLAKE2b-256 a6e917db18a79fc84a3eb5ef7d3aff2afdd27d14270d564f829fad6cbc9dfc7b

See more details on using hashes here.

Provenance

The following attestation bundles were made for passes_rs_py-3.0.0-cp312-cp312-musllinux_1_2_aarch64.whl:

Publisher: py-release.yml on jontyms/neo-passes-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file passes_rs_py-3.0.0-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for passes_rs_py-3.0.0-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 c6ef560aca777af46de18863756ffc1e6e65460ecfaf527713f28b78cbb7160d
MD5 01e798c9dfa78b23c4d2cd77f9cd5e71
BLAKE2b-256 086d4fefe15de507a3b5bd15051f1cc4fe258dfcbfe0ae036f7e4e044d181f8d

See more details on using hashes here.

Provenance

The following attestation bundles were made for passes_rs_py-3.0.0-cp312-cp312-manylinux_2_28_aarch64.whl:

Publisher: py-release.yml on jontyms/neo-passes-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file passes_rs_py-3.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for passes_rs_py-3.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d0febd594d2d6483507903aba2ef0f45a6a3b695d12d1c5f52ddf58b2745f6de
MD5 c9f5fee3d52d4c9ec4ffe9f1b79b15dd
BLAKE2b-256 b1f516ad36b051e3945347c20a7fb62d3944c1c41c50c91ca9983266874f6a11

See more details on using hashes here.

Provenance

The following attestation bundles were made for passes_rs_py-3.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: py-release.yml on jontyms/neo-passes-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file passes_rs_py-3.0.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl.

File metadata

File hashes

Hashes for passes_rs_py-3.0.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 1ccd4e2eb2aabeddacfc8d2cb705d09ca89a677fbe132117db058722e7314395
MD5 7a92cdd997fb275d9f174035dc8a7f90
BLAKE2b-256 f7f49ade80f424d1e14a7513901960f531275418c1802466d5137d63d3997a3a

See more details on using hashes here.

Provenance

The following attestation bundles were made for passes_rs_py-3.0.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl:

Publisher: py-release.yml on jontyms/neo-passes-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file passes_rs_py-3.0.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.

File metadata

File hashes

Hashes for passes_rs_py-3.0.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 f4bc4ea473ee12c5e1d26780ab21273c414e06fec997ee574254d762988a7d97
MD5 7f2d4c6db4fa64caa54e758c5a3becff
BLAKE2b-256 3669148271ca468db0019b92d966862cd110a0afd51ee9bca6c96d48a2c50166

See more details on using hashes here.

Provenance

The following attestation bundles were made for passes_rs_py-3.0.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl:

Publisher: py-release.yml on jontyms/neo-passes-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file passes_rs_py-3.0.0-cp312-cp312-manylinux_2_17_ppc64.manylinux2014_ppc64.whl.

File metadata

File hashes

Hashes for passes_rs_py-3.0.0-cp312-cp312-manylinux_2_17_ppc64.manylinux2014_ppc64.whl
Algorithm Hash digest
SHA256 6d254db376cf4226a86497f3a708fed262cc57405cd278ca550f2dc9ba60129b
MD5 1ddbe4497d5bfd3e38d4907da601ed8d
BLAKE2b-256 f3c599292aa563abb30454a4454eb7a3263f18a739777880273ed932fa77e80c

See more details on using hashes here.

Provenance

The following attestation bundles were made for passes_rs_py-3.0.0-cp312-cp312-manylinux_2_17_ppc64.manylinux2014_ppc64.whl:

Publisher: py-release.yml on jontyms/neo-passes-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file passes_rs_py-3.0.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl.

File metadata

File hashes

Hashes for passes_rs_py-3.0.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 4dfcca91f0d311a42693b19f6bbaf3ea5205f020aeda0c11576e668fc0510a39
MD5 5692ca5af65a7cfc55cbaf3555088a78
BLAKE2b-256 67c88337b5876fea363da21fa2ae44b61ad5cbe38bc423ac928742072e6ba797

See more details on using hashes here.

Provenance

The following attestation bundles were made for passes_rs_py-3.0.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl:

Publisher: py-release.yml on jontyms/neo-passes-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file passes_rs_py-3.0.0-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for passes_rs_py-3.0.0-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 148dcb68149aa624d0d2e1e8b1743a132225605d27f89de552ca7d5af3f4e1e4
MD5 0898d864868eeddeed78ffb97c5c4a43
BLAKE2b-256 9660e35a6da4cdc0001eee9e48443b8e3c022e02bc4ac54423b0694116329d11

See more details on using hashes here.

Provenance

The following attestation bundles were made for passes_rs_py-3.0.0-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:

Publisher: py-release.yml on jontyms/neo-passes-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page