Skip to main content

passgen-llm

PyPI version License: MIT Downloads LinkedIn

passgen_llm is a Python package that leverages a Language Model (LLM) to generate structured, formatted pass content for Apple Wallet. It takes user-provided text input, such as event details, membership information, or coupon data, and ensures the output adheres to Apple's pass requirements by validating the response with pattern matching. This makes it easy for users to create custom, scannable passes without manual formatting.

Features

  • Automated Pass Generation: Automatically generate Apple Wallet passes from user-provided text input.
  • Pattern Matching: Ensures the generated pass content adheres to Apple's pass requirements.
  • Flexible LLM Integration: Supports custom LLM instances, including OpenAI, Anthropic, and Google Generative AI.
  • Easy Installation: Simple installation process with pip.

Installation

You can install passgen_llm using pip:

pip install passgen_llm

Usage

Here's a basic example of how to use passgen-llm:

from passgen_llm import passgen_llm

user_input = "Event: Tech Conference, Date: 2023-10-15, Location: San Francisco"
response = passgen_llm(user_input)
print(response)

Input Parameters

  • user_input (str): The user input text to process.
  • llm (Optional[BaseChatModel]): The LangChain LLM instance to use. If not provided, the default ChatLLM7 will be used.
  • api_key (Optional[str]): The API key for LLM7. If not provided, the environment variable LLM7_API_KEY will be used.

Custom LLM Instances

You can use custom LLM instances by passing them to the passgen_llm function. Here are examples using different LLMs:

OpenAI

from langchain_openai import ChatOpenAI
from passgen_llm import passgen_llm

llm = ChatOpenAI()
response = passgen_llm(user_input, llm=llm)
print(response)

Anthropic

from langchain_anthropic import ChatAnthropic
from passgen_llm import passgen_llm

llm = ChatAnthropic()
response = passgen_llm(user_input, llm=llm)
print(response)

Google Generative AI

from langchain_google_genai import ChatGoogleGenerativeAI
from passgen_llm import passgen_llm

llm = ChatGoogleGenerativeAI()
response = passgen_llm(user_input, llm=llm)
print(response)

API Key

The default rate limits for LLM7 free tier are sufficient for most use cases of this package. If you need higher rate limits, you can pass your own API key via the environment variable LLM7_API_KEY or directly in the function call:

response = passgen_llm(user_input, api_key="your_api_key")

You can get a free API key by registering at LLM7.

Contributing

Contributions are welcome! Please open an issue or submit a pull request on GitHub.

License

This project is licensed under the MIT License.

Author

Metadata

Release files for passgen-llm 2025.12.21181318

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

Source distribution (sdist)

Source distribution for passgen-llm 2025.12.21181318
File Size Uploaded Provenance Actions
passgen_llm-2025.12.21181318.tar.gz 4.8 kB Without provenance Details for passgen_llm-2025.12.21181318.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for passgen-llm 2025.12.21181318
File Interpreter ABI Platform Actions
passgen_llm-2025.12.21181318-py3-none-any.whl Python 3 none any Details for passgen_llm-2025.12.21181318-py3-none-any.whl

Total release size: 10.3 kB

Release files / passgen_llm-2025.12.21181318.tar.gz

Download URL passgen_llm-2025.12.21181318.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b11034be5654b3519983f20d133604fc54b42a56e797178ff2b8231f3e45e683
BLAKE2b-256 checksum
How to use checksums
b1faefe43aa2aefa3e88a95b2f8ea178674cd55f5a23dc7f41d73c88d9738bb9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.1

Release files / passgen_llm-2025.12.21181318-py3-none-any.whl

Download URL passgen_llm-2025.12.21181318-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ab147074857ff7462a86d36d882e28675eb0facc9c28ddb8a468502b89c9c9ab
BLAKE2b-256 checksum
How to use checksums
fd229870d4508b284f501dd40eb0d09797522b2254b074aaad490af8c25a80b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.1

Security for passgen-llm 2025.12.21181318

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
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