Generated Python clients and message types for the PassKit gRPC API. Use the SDK to build integrations for membership and loyalty cards, coupons, event tickets, boarding passes, and the other PassKit services.
- Python 3.9 or newer
- A PassKit account and API credentials for live API calls
python -m pip install passkit-python-grpc-sdkPin a specific release when reproducible installs are important:
python -m pip install passkit-python-grpc-sdk==1.1.162The package installs the compatible gRPC, Protocol Buffers, Google API annotations, and OpenAPI annotation runtimes automatically.
Import the generated messages and service stubs for the PassKit product you want to use:
import grpc
from passkit.io.common.common_objects_pb2 import Id
from passkit.io.member.a_rpc_pb2_grpc import MembersStub
with open("certs/ca-chain.pem", "rb") as file:
root_certificate = file.read()
with open("certs/key.pem", "rb") as file:
private_key = file.read()
with open("certs/certificate.pem", "rb") as file:
certificate_chain = file.read()
credentials = grpc.ssl_channel_credentials(
root_certificates=root_certificate,
private_key=private_key,
certificate_chain=certificate_chain,
)
channel = grpc.secure_channel(
"grpc.pub1.passkit.io:443",
credentials,
)
members = MembersStub(channel)
program = members.getProgram(Id(id="YOUR_PROGRAM_ID"))
print(program)For complete credential setup and runnable membership, coupon, event-ticket, and flight examples, see the PassKit Python quickstart.
passkit.io.memberpasskit.io.single_use_couponspasskit.io.event_ticketspasskit.io.flightspasskit.io.corepasskit.io.analyticspasskit.io.schedulerpasskit.io.raw
The generated method names intentionally match the PassKit API definitions.
python -m pip install -e ".[dev]"
python -m unittest discover -s tests -v
python -m build
python -m twine check dist/*Distributed under the MIT Licence.