text-structura
A Python package that takes user-provided text input and returns structured, validated output using pattern matching to ensure consistent formatting.
Features
- Processes text from various sources like documents or audio transcripts
- Applies a system prompt to guide the LLM and a human message to frame the query
- Uses regex patterns to extract key information reliably
- Ideal for tasks like summarizing content, categorizing feedback, or generating standardized reports
- Does not rely on markdown or HTML formatting
Installation
pip install text_structura
Usage
from text_structura import text_structura
response = text_structura("Your text input here")
Using a Custom LLM
You can use your own LLM instance by passing it to the function:
from langchain_openai import ChatOpenAI
from text_structura import text_structura
llm = ChatOpenAI()
response = text_structura("Your text input here", llm=llm)
Using LLM7 with API Key
You can pass your LLM7 API key directly:
from text_structura import text_structura
response = text_structura("Your text input here", api_key="your_api_key")
Or by setting the LLM7_API_KEY environment variable. You can obtain a free API key by registering at https://token.llm7.io/.
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, the defaultChatLLM7will be used.
Default LLM
The package uses ChatLLM7 from langchain_llm7 by default. You can find more information about ChatLLM7 here.
Rate Limits
The default rate limits for LLM7 free tier are sufficient for most use cases of this package. If you want higher rate limits, you can pass your own API key via the api_key parameter or by setting the LLM7_API_KEY environment variable.
Contributing
Contributions are welcome! Please refer to the issue tracker for potential areas of improvement.
Author
- Eugene Evstafev - hi@euegne.plus
GitHub
- Project Repository: https://github.com/chigwell/text-structura
- Submit Issues: https://github.com/chigwell/text-structura/issues
- GitHub Nickname: chigwell
Metadata
Release files for text-structura 2025.12.21090343
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 |
|---|---|---|---|---|
| text_structura-2025.12.21090343.tar.gz | 4.4 kB | Without provenance | Details for text_structura-2025.12.21090343.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| text_structura-2025.12.21090343-py3-none-any.whl | Python 3 | none | any | Details for text_structura-2025.12.21090343-py3-none-any.whl |
Total release size: 9.6 kB
Release files / text_structura-2025.12.21090343.tar.gz
| Download URL | text_structura-2025.12.21090343.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cc76c80d7087c40c340c2912032cccb3f5ffde5b8f9d1424dbf560e521a770a4
|
|
BLAKE2b-256 checksum How to use checksums |
f3736a8694059fc2ea639fd199b38e41c14b69df8b3400228785430f873e8098
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.11
|
Release files / text_structura-2025.12.21090343-py3-none-any.whl
| Download URL | text_structura-2025.12.21090343-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
01cd1a1e410fce99c9d97cd8a03523d6d869b6d6eefb68a905ff1a054b0304a0
|
|
BLAKE2b-256 checksum How to use checksums |
2127a68016bd7345ed812430df3df9972945a7dd8e3a14415138e90d9c721009
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.11
|
Security for text-structura 2025.12.21090343
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.