zx2xberry
A Python package that enables users to control their XBerry Pi devices using a ZX Spectrum+ keyboard by translating keypresses into structured commands.
Features
- Translates ZX Spectrum+ keyboard keypresses into structured commands for XBerry Pi devices
- Uses LLM7 by default (via
langchain_llm7) - Supports custom LLM instances from LangChain
- Free tier of LLM7 has sufficient rate limits for most use cases
Installation
pip install zx2xberry
Usage
Basic Usage
from zx2xberry import zx2xberry
response = zx2xberry("user input describing keypresses")
Using a Custom LLM
You can use any LLM compatible with LangChain. Here are examples with different LLMs:
OpenAI
from langchain_openai import ChatOpenAI
from zx2xberry import zx2xberry
llm = ChatOpenAI()
response = zx2xberry("user input", llm=llm)
Anthropic
from langchain_anthropic import ChatAnthropic
from zx2xberry import zx2xberry
llm = ChatAnthropic()
response = zx2xberry("user input", llm=llm)
from langchain_google_genai import ChatGoogleGenerativeAI
from zx2xberry import zx2xberry
llm = ChatGoogleGenerativeAI()
response = zx2xberry("user input", llm=llm)
Using a Custom API Key
You can provide your own API key for LLM7 either via environment variable or directly:
from zx2xberry import zx2xberry
# Via environment variable
import os
os.environ["LLM7_API_KEY"] = "your_api_key"
response = zx2xberry("user input")
# Directly
response = zx2xberry("user input", api_key="your_api_key")
Parameters
user_input(str): The user input text to processllm(Optional[BaseChatModel]): The LangChain LLM instance to use. Defaults toChatLLM7.api_key(Optional[str]): The API key for LLM7. If not provided, it will use the environment variableLLM7_API_KEYor the default LLM7 key.
Returns
A list of structured commands that the XBerry Pi can interpret and execute.
Getting an LLM7 API Key
You can get a free API key by registering at LLM7.
Issues
If you encounter any issues, please report them on the GitHub issues page.
Author
Eugene Evstafev
- Email: hi@eugene.plus
- GitHub: chigwell
Metadata
Release files for zx2xberry 2025.12.21201323
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| zx2xberry-2025.12.21201323.tar.gz | 4.7 kB | Without provenance | Details for zx2xberry-2025.12.21201323.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| zx2xberry-2025.12.21201323-py3-none-any.whl | Python 3 | none | any | Details for zx2xberry-2025.12.21201323-py3-none-any.whl |
Total release size: 9.9 kB
Release files / zx2xberry-2025.12.21201323.tar.gz
| Download URL | zx2xberry-2025.12.21201323.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ffdf3e0808bf3e5fac569b54c3bc3ebbe9e5bc4572e04fa39bb59ad8a6d2c4ed
|
|
BLAKE2b-256 checksum How to use checksums |
f3611d87f6ad4994fca1ca0094aa98aa128026240e04c6c656da1d0f7266458f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.1
|
Release files / zx2xberry-2025.12.21201323-py3-none-any.whl
| Download URL | zx2xberry-2025.12.21201323-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b42496ca3d321173770e49af72b33eae214aa9038cab18026f278f5cb24d8794
|
|
BLAKE2b-256 checksum How to use checksums |
44b4e8f4b414b9eb36445450a1dc87060e01914a13e5930fd451ddeff97da50e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.1
|
Security for zx2xberry 2025.12.21201323
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.