A new package that takes user-provided text input (such as event details, membership information, or coupon data) and uses an LLM to generate structured, formatted pass content for Apple Wallet. It en
Project description
passgen-llm
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 defaultChatLLM7will be used.api_key(Optional[str]): The API key for LLM7. If not provided, the environment variableLLM7_API_KEYwill 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
- Eugene Evstafev
- Email: hi@euegne.plus
- GitHub: chigwell
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file passgen_llm-2025.12.21181318.tar.gz.
File metadata
- Download URL: passgen_llm-2025.12.21181318.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b11034be5654b3519983f20d133604fc54b42a56e797178ff2b8231f3e45e683
|
|
| MD5 |
b127d8b2d0520bb5a33361386e56c71c
|
|
| BLAKE2b-256 |
b1faefe43aa2aefa3e88a95b2f8ea178674cd55f5a23dc7f41d73c88d9738bb9
|
File details
Details for the file passgen_llm-2025.12.21181318-py3-none-any.whl.
File metadata
- Download URL: passgen_llm-2025.12.21181318-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab147074857ff7462a86d36d882e28675eb0facc9c28ddb8a468502b89c9c9ab
|
|
| MD5 |
fca36b54a65e691084f940d3548240ef
|
|
| BLAKE2b-256 |
fd229870d4508b284f501dd40eb0d09797522b2254b074aaad490af8c25a80b5
|