AI-powered invoice template extraction library for Tako
Project description
Template Sense
AI-powered invoice template extraction library for structured metadata analysis.
Template Sense analyzes Excel-based invoice templates using heuristics and AI to extract structured metadata, supporting multi-language translation and fuzzy matching against canonical field dictionaries.
Installation
From PyPI (Recommended)
# Latest version
pip install template-sense
# Specific version
pip install template-sense==0.1.0
From GitHub
# Latest release
pip install git+https://github.com/Projects-with-Babajide/template-sense.git@main
# Specific release tag
pip install git+https://github.com/Projects-with-Babajide/template-sense.git@v0.1.0
For Development
git clone https://github.com/Projects-with-Babajide/template-sense.git
cd template-sense
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -e .[dev]
Quick Start
from template_sense.analyzer import extract_template_structure
# Define your canonical field dictionary
# This should match YOUR domain's field names
field_dictionary = {
"headers": {
"invoice_number": "Invoice number",
"shipper": "Shipper",
"consignee": "Consignee",
"invoice_date": "Invoice date",
"due_date": "Due date",
},
"columns": {
"product_name": "Product name",
"quantity": "Quantity",
"price": "Price",
"amount": "Amount",
}
}
# Extract template structure
result = extract_template_structure("path/to/template.xlsx", field_dictionary)
# Access extracted metadata
print(result["normalized_output"]["headers"]["matched"])
print(result["normalized_output"]["columns"]["matched"])
Note: The field_dictionary should contain YOUR canonical field names. Each key is the canonical identifier you want to use, and each value is the expected label in the template. The library will use AI to match similar fields and fuzzy matching to find the best matches.
Features
- Excel template parsing and analysis
- AI-based field and column classification (OpenAI & Anthropic)
- Multi-language translation support
- Fuzzy matching against canonical field dictionaries
- Structured JSON output
Documentation
- Release Process - How to create and publish releases
- Development Setup - Setting up your development environment
- Architecture - System design and module structure
Requirements
- Python 3.10+
- OpenAI API key (if using OpenAI provider)
- Anthropic API key (if using Anthropic provider)
License
MIT
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
Support
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 template_sense-0.1.0.tar.gz.
File metadata
- Download URL: template_sense-0.1.0.tar.gz
- Upload date:
- Size: 165.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2667f0666d1b331e8aca330ec7ba98095e32114e0fb2ee4256156b10dc388262
|
|
| MD5 |
f09f1040682e98eb2c8b204f713c5faf
|
|
| BLAKE2b-256 |
101580afc01d50c00460783aeaccc894e185cfb00e612ccba2cbba8a822d616d
|
Provenance
The following attestation bundles were made for template_sense-0.1.0.tar.gz:
Publisher:
release.yml on Projects-with-Babajide/template-sense
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
template_sense-0.1.0.tar.gz -
Subject digest:
2667f0666d1b331e8aca330ec7ba98095e32114e0fb2ee4256156b10dc388262 - Sigstore transparency entry: 742648883
- Sigstore integration time:
-
Permalink:
Projects-with-Babajide/template-sense@4ce53375de4c028300b379e5d790880334a797b1 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Projects-with-Babajide
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4ce53375de4c028300b379e5d790880334a797b1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file template_sense-0.1.0-py3-none-any.whl.
File metadata
- Download URL: template_sense-0.1.0-py3-none-any.whl
- Upload date:
- Size: 117.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
37d180ec6d1a412f13ea1cab49afde0583d5790730afe5b51b3baebce400e546
|
|
| MD5 |
2743b645fdd0d1aac77678875dcc7447
|
|
| BLAKE2b-256 |
7042898f8a755939d9931953525d4c91695c8c54bdee5a8932a19992a0e6a351
|
Provenance
The following attestation bundles were made for template_sense-0.1.0-py3-none-any.whl:
Publisher:
release.yml on Projects-with-Babajide/template-sense
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
template_sense-0.1.0-py3-none-any.whl -
Subject digest:
37d180ec6d1a412f13ea1cab49afde0583d5790730afe5b51b3baebce400e546 - Sigstore transparency entry: 742648890
- Sigstore integration time:
-
Permalink:
Projects-with-Babajide/template-sense@4ce53375de4c028300b379e5d790880334a797b1 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Projects-with-Babajide
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4ce53375de4c028300b379e5d790880334a797b1 -
Trigger Event:
push
-
Statement type: