template-analysis
Generate template and extract variables from texts. In other words, template-analysis makes reverse template (untemplate).
Usage
Currently, this supports analyzing one or more texts.
from template_analysis import analyze
result = analyze([
"A dog is a good pet",
"A cat is a good pet",
"A cat is a pretty pet",
"A bird is a great pet",
])
result.to_format_string() # => "A {0} is a {1} pet"
result.args[0] # => ["dog", "good"]
result.args[1] # => ["cat", "good"]
result.args[2] # => ["cat", "pretty"]
result.args[3] # => ["bird", "great"]
Concepts / Future plans
Development plans
- 1. Untemplate two texts.
- 2. Untemplate multiple / complex texts.
- 3. Untemplate nested / tree-structured texts.
- 4. Support several features for scraping.
- 5. Implement a more efficient algorithm.
Image boards
Development
This repository uses lefthook to run the same checks as CI locally, so problems surface before they reach CI.
# Install dependencies
uv sync
# Install the Git hooks (once; requires lefthook on your PATH)
lefthook install
Once installed, the hooks run automatically:
- pre-commit:
uv run poe check - pre-push:
uv run poe checkanduv run poe test
You can also run the checks manually:
uv run poe check
uv run poe test
CI still runs the full matrix (see .github/workflows/); the hooks only bring that
feedback earlier on your machine.
Release notes
See CHANGELOG.md for release history and upgrade notes.
License
The 3-Clause BSD License. See also LICENSE file.
Metadata
Release files for template-analysis 0.1.0
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 |
|---|---|---|---|---|
| template_analysis-0.1.0.tar.gz | 53.3 kB | With provenance | Details for template_analysis-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| template_analysis-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for template_analysis-0.1.0-py3-none-any.whl |
Total release size: 63.1 kB
Release files / template_analysis-0.1.0.tar.gz
| Download URL | template_analysis-0.1.0.tar.gz |
|---|---|
| Size | 53.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d355f1dfaa53904a3c876fecadee1e5aeb25652a04156de783c8b22f952b7c0a
|
|
BLAKE2b-256 checksum How to use checksums |
cf22fe15c3d8ef90d87d192aac41e4f7038a1e0f777674979f5a5e65033fe807
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.
Transparency logRelease files / template_analysis-0.1.0-py3-none-any.whl
| Download URL | template_analysis-0.1.0-py3-none-any.whl |
|---|---|
| Size | 9.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
87dfc2aa16f7153db471c572c570ebeb5bef4a6dda2e969c9e716d09e95beb89
|
|
BLAKE2b-256 checksum How to use checksums |
f5590e863e00f871b694fd12b622c0110c70d6afadf55e36a3fcbc3420a30541
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.
Transparency logSecurity for template-analysis 0.1.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for template_analysis-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.
Transparency logA 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.