# template-analysis
[](https://badge.fury.io/py/template-analysis)
[](https://pypi.python.org/pypi/template-analysis/)
[](https://codecov.io/gh/kitsuyui/python-template-analysis)
[](https://opensource.org/licenses/BSD-3-Clause)
Generate template and extract variables from texts.
In other words, template-analysis makes reverse template (untemplate).
## Usage
Currently, this supports to analyze only two texts.
```python
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 {} is a {} 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
- [x] 1. Untemplate two texts.
- [x] 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





## License
The 3-Clause BSD License. See also LICENSE file.
Raw data
{
"_id": null,
"home_page": "https://github.com/kitsuyui/python-template-analysis",
"name": "template-analysis",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": null,
"author": "Yui Kitsu",
"author_email": "kitsuyui+github@kitsuyui.com",
"download_url": "https://files.pythonhosted.org/packages/25/53/3cd35741eebe34b0b845c9b591608b0e1f889e6897f9345a41da4b7b641f/template_analysis-0.0.7.tar.gz",
"platform": null,
"description": "# template-analysis\n\n[](https://badge.fury.io/py/template-analysis)\n[](https://pypi.python.org/pypi/template-analysis/)\n[](https://codecov.io/gh/kitsuyui/python-template-analysis)\n[](https://opensource.org/licenses/BSD-3-Clause)\n\nGenerate template and extract variables from texts.\nIn other words, template-analysis makes reverse template (untemplate).\n\n## Usage\n\nCurrently, this supports to analyze only two texts.\n\n```python\nfrom template_analysis import analyze\nresult = analyze([\n \"A dog is a good pet\",\n \"A cat is a good pet\",\n \"A cat is a pretty pet\",\n \"A bird is a great pet\",\n])\nresult.to_format_string() # => \"A {} is a {} pet\"\nresult.args[0] # => [\"dog\", \"good\"]\nresult.args[1] # => [\"cat\", \"good\"]\nresult.args[2] # => [\"cat\", \"pretty\"]\nresult.args[3] # => [\"bird\", \"great\"]\n```\n\n## Concepts / Future plans\n\n### Development plans\n\n- [x] 1. Untemplate two texts.\n- [x] 2. Untemplate multiple / complex texts.\n- [ ] 3. Untemplate nested / tree-structured texts.\n- [ ] 4. Support several features for scraping.\n- [ ] 5. Implement a more efficient algorithm.\n\n### Image boards\n\n\n\n\n\n\n\n## License\n\nThe 3-Clause BSD License. See also LICENSE file.\n",
"bugtrack_url": null,
"license": "BSD-3-Clause",
"summary": "Create template from strings (reverse formatter)",
"version": "0.0.7",
"project_urls": {
"Homepage": "https://github.com/kitsuyui/python-template-analysis"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c136e914b73c18312e422a078fd640c1b54fd08751215a2c408c5cf188051fb5",
"md5": "0dc431e0913ecc76e8a4b13eba6574d3",
"sha256": "6fbe57c4858d050fe1cb8f79021768df8dc555e6f9f10f951415d64a1e3f80ec"
},
"downloads": -1,
"filename": "template_analysis-0.0.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0dc431e0913ecc76e8a4b13eba6574d3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 6646,
"upload_time": "2024-10-15T16:35:50",
"upload_time_iso_8601": "2024-10-15T16:35:50.456452Z",
"url": "https://files.pythonhosted.org/packages/c1/36/e914b73c18312e422a078fd640c1b54fd08751215a2c408c5cf188051fb5/template_analysis-0.0.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "25533cd35741eebe34b0b845c9b591608b0e1f889e6897f9345a41da4b7b641f",
"md5": "00b780d7f7b1482517e7f59dfa074ef2",
"sha256": "e61c5caf8887d632c8c71a401e66e58a2b673753ad82c748be082817f9f8d681"
},
"downloads": -1,
"filename": "template_analysis-0.0.7.tar.gz",
"has_sig": false,
"md5_digest": "00b780d7f7b1482517e7f59dfa074ef2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 24743,
"upload_time": "2024-10-15T16:35:52",
"upload_time_iso_8601": "2024-10-15T16:35:52.093268Z",
"url": "https://files.pythonhosted.org/packages/25/53/3cd35741eebe34b0b845c9b591608b0e1f889e6897f9345a41da4b7b641f/template_analysis-0.0.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-15 16:35:52",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "kitsuyui",
"github_project": "python-template-analysis",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"lcname": "template-analysis"
}