tabellio 0.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tabellio-0.1.1/.github/workflows/ci.yml +38 -0
- tabellio-0.1.1/.github/workflows/release.yml +62 -0
- tabellio-0.1.1/.gitignore +35 -0
- tabellio-0.1.1/CHANGELOG.md +49 -0
- tabellio-0.1.1/CLAUDE.md +150 -0
- tabellio-0.1.1/LICENSE +202 -0
- tabellio-0.1.1/Makefile +15 -0
- tabellio-0.1.1/NOTICE +16 -0
- tabellio-0.1.1/PKG-INFO +293 -0
- tabellio-0.1.1/README.md +246 -0
- tabellio-0.1.1/SECURITY.md +20 -0
- tabellio-0.1.1/examples/README.md +27 -0
- tabellio-0.1.1/examples/sample_act.full.json +117 -0
- tabellio-0.1.1/examples/sample_act.jpg +0 -0
- tabellio-0.1.1/examples/sample_act.simple.json +26 -0
- tabellio-0.1.1/examples/sample_act.transcription.json +4 -0
- tabellio-0.1.1/pyproject.toml +71 -0
- tabellio-0.1.1/src/tabellio/__init__.py +60 -0
- tabellio-0.1.1/src/tabellio/__main__.py +102 -0
- tabellio-0.1.1/src/tabellio/core.py +149 -0
- tabellio-0.1.1/src/tabellio/errors.py +27 -0
- tabellio-0.1.1/src/tabellio/gedcom.py +358 -0
- tabellio-0.1.1/src/tabellio/image.py +116 -0
- tabellio-0.1.1/src/tabellio/prompt.py +227 -0
- tabellio-0.1.1/src/tabellio/providers/__init__.py +12 -0
- tabellio-0.1.1/src/tabellio/providers/anthropic.py +66 -0
- tabellio-0.1.1/src/tabellio/providers/gemini.py +58 -0
- tabellio-0.1.1/src/tabellio/providers/nim.py +63 -0
- tabellio-0.1.1/src/tabellio/providers/ollama.py +51 -0
- tabellio-0.1.1/src/tabellio/providers/openai.py +63 -0
- tabellio-0.1.1/src/tabellio/providers/registry.py +65 -0
- tabellio-0.1.1/src/tabellio/py.typed +0 -0
- tabellio-0.1.1/src/tabellio/schema.py +217 -0
- tabellio-0.1.1/src/tabellio/validate.py +106 -0
- tabellio-0.1.1/tests/conftest.py +95 -0
- tabellio-0.1.1/tests/test_gedcom.py +213 -0
- tabellio-0.1.1/tests/test_image.py +90 -0
- tabellio-0.1.1/tests/test_parse.py +201 -0
- tabellio-0.1.1/tests/test_providers.py +89 -0
- tabellio-0.1.1/tests/test_schema.py +74 -0
- tabellio-0.1.1/tests/test_validate.py +140 -0
- tabellio-0.1.1/uv.lock +1396 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
concurrency:
|
|
9
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
10
|
+
cancel-in-progress: true
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
lint:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
- uses: astral-sh/setup-uv@v6
|
|
18
|
+
with:
|
|
19
|
+
python-version: "3.13"
|
|
20
|
+
enable-cache: true
|
|
21
|
+
- run: uv sync --all-extras
|
|
22
|
+
- run: uv run ruff check .
|
|
23
|
+
- run: uv run ruff format --check .
|
|
24
|
+
|
|
25
|
+
test:
|
|
26
|
+
runs-on: ubuntu-latest
|
|
27
|
+
strategy:
|
|
28
|
+
fail-fast: false
|
|
29
|
+
matrix:
|
|
30
|
+
python-version: ["3.11", "3.12", "3.13", "3.14"]
|
|
31
|
+
steps:
|
|
32
|
+
- uses: actions/checkout@v4
|
|
33
|
+
- uses: astral-sh/setup-uv@v6
|
|
34
|
+
with:
|
|
35
|
+
python-version: ${{ matrix.python-version }}
|
|
36
|
+
enable-cache: true
|
|
37
|
+
- run: uv sync --all-extras
|
|
38
|
+
- run: uv run pytest
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
name: release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags: ["v*"]
|
|
6
|
+
release:
|
|
7
|
+
types: [published]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
build:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
- uses: astral-sh/setup-uv@v6
|
|
15
|
+
with:
|
|
16
|
+
python-version: "3.13"
|
|
17
|
+
- name: Tag matches project version
|
|
18
|
+
if: startsWith(github.ref, 'refs/tags/')
|
|
19
|
+
run: |
|
|
20
|
+
tag="${GITHUB_REF_NAME#v}"
|
|
21
|
+
ver="$(uv run --no-project python -c 'import tomllib,pathlib; print(tomllib.loads(pathlib.Path("pyproject.toml").read_text())["project"]["version"])')"
|
|
22
|
+
echo "tag=$tag project=$ver"
|
|
23
|
+
test "$tag" = "$ver"
|
|
24
|
+
- run: uv build
|
|
25
|
+
- run: uv run --no-project --with twine twine check dist/*
|
|
26
|
+
- uses: actions/upload-artifact@v4
|
|
27
|
+
with:
|
|
28
|
+
name: dist
|
|
29
|
+
path: dist/
|
|
30
|
+
|
|
31
|
+
testpypi:
|
|
32
|
+
# tag push -> rehearsal on TestPyPI
|
|
33
|
+
needs: build
|
|
34
|
+
if: github.event_name == 'push'
|
|
35
|
+
runs-on: ubuntu-latest
|
|
36
|
+
environment: testpypi
|
|
37
|
+
permissions:
|
|
38
|
+
id-token: write
|
|
39
|
+
steps:
|
|
40
|
+
- uses: actions/download-artifact@v4
|
|
41
|
+
with:
|
|
42
|
+
name: dist
|
|
43
|
+
path: dist/
|
|
44
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
45
|
+
with:
|
|
46
|
+
repository-url: https://test.pypi.org/legacy/
|
|
47
|
+
skip-existing: true
|
|
48
|
+
|
|
49
|
+
pypi:
|
|
50
|
+
# GitHub release published -> real PyPI
|
|
51
|
+
needs: build
|
|
52
|
+
if: github.event_name == 'release'
|
|
53
|
+
runs-on: ubuntu-latest
|
|
54
|
+
environment: pypi
|
|
55
|
+
permissions:
|
|
56
|
+
id-token: write
|
|
57
|
+
steps:
|
|
58
|
+
- uses: actions/download-artifact@v4
|
|
59
|
+
with:
|
|
60
|
+
name: dist
|
|
61
|
+
path: dist/
|
|
62
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.egg-info/
|
|
5
|
+
.eggs/
|
|
6
|
+
build/
|
|
7
|
+
dist/
|
|
8
|
+
|
|
9
|
+
# venv / tooling
|
|
10
|
+
.venv/
|
|
11
|
+
.python-version
|
|
12
|
+
.ruff_cache/
|
|
13
|
+
.pytest_cache/
|
|
14
|
+
.coverage
|
|
15
|
+
htmlcov/
|
|
16
|
+
coverage.xml
|
|
17
|
+
|
|
18
|
+
# env
|
|
19
|
+
.env
|
|
20
|
+
|
|
21
|
+
# local manual-test scripts and their output (may contain keys / real data)
|
|
22
|
+
/test_*.sh
|
|
23
|
+
/test_*.out
|
|
24
|
+
/scratch/
|
|
25
|
+
|
|
26
|
+
# editors / OS
|
|
27
|
+
.DS_Store
|
|
28
|
+
.idea/
|
|
29
|
+
.vscode/
|
|
30
|
+
|
|
31
|
+
# code-review graph (local only)
|
|
32
|
+
.code-review-graph/
|
|
33
|
+
|
|
34
|
+
# claude code local overrides
|
|
35
|
+
.claude/settings.local.json
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented here. The format follows
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/); this project adheres to
|
|
5
|
+
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
## [0.1.1] - 2026-08-30
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- `tabellio.__version__` now derives from the installed package metadata
|
|
14
|
+
instead of a hard-coded string, so it can no longer drift from
|
|
15
|
+
`pyproject.toml`. (0.1.0 was pushed to TestPyPI only, never to PyPI.)
|
|
16
|
+
|
|
17
|
+
## [0.1.0] - 2026-08-30
|
|
18
|
+
|
|
19
|
+
First public release (TestPyPI rehearsal only).
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
|
|
23
|
+
- `tabellio.parse(image, *, provider, api_key, model, act_type_hint,
|
|
24
|
+
act_language_hint, context, output_mode, validate, **provider_options)` —
|
|
25
|
+
one call, one network request.
|
|
26
|
+
- Providers: `gemini`, `openai`, `nim`, `anthropic`, `ollama` — thin adapters,
|
|
27
|
+
lazy SDK imports, none required at install. Per-provider `timeout=`,
|
|
28
|
+
`max_retries=0`.
|
|
29
|
+
- Three output modes: `full` (`Act`), `simple` (`ActSummary`), `transcription`
|
|
30
|
+
(`Transcription`). Each has its own prompt and Pydantic target.
|
|
31
|
+
- BYOK end to end: `api_key` is a call parameter, resolved from `$TABELLIO_KEY`
|
|
32
|
+
when omitted; never stored, never logged.
|
|
33
|
+
- `Act` schema: per-field `confidence`, `raw` spelling, date `qualifier`
|
|
34
|
+
(`exact`/`about`/`before`/`after`/`between`/`calculated`) and `calendar`
|
|
35
|
+
(`gregorian`/`julian`/`french_republican`), `name_particle` / `name_suffix`,
|
|
36
|
+
life-event dates on persons, verbatim `transcription`, model-detected
|
|
37
|
+
`language`.
|
|
38
|
+
- `tabellio.validate` — post-extraction consistency checks surfaced as
|
|
39
|
+
`act.warnings` (never rewrites model output).
|
|
40
|
+
- `tabellio.to_gedcom(act)` — a complete, conformance-checked GEDCOM 7.0
|
|
41
|
+
document (`SOUR` + `INDI` + `FAM`), transcription in `SOUR.TEXT`.
|
|
42
|
+
- `NIMProvider` re-encodes oversized images in memory (`image.fit_within`) to
|
|
43
|
+
satisfy the ~180 KB inline limit; `shrink=False` to opt out.
|
|
44
|
+
- `python -m tabellio <image>` CLI with `--provider` / `--model` / `--hint` /
|
|
45
|
+
`--lang` / `--context` / `--output` / `--format` / `--no-validate` / `-v`.
|
|
46
|
+
|
|
47
|
+
[Unreleased]: https://github.com/rsaikali/tabellio/compare/v0.1.1...HEAD
|
|
48
|
+
[0.1.1]: https://github.com/rsaikali/tabellio/compare/v0.1.0...v0.1.1
|
|
49
|
+
[0.1.0]: https://github.com/rsaikali/tabellio/releases/tag/v0.1.0
|
tabellio-0.1.1/CLAUDE.md
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# tabellio
|
|
2
|
+
|
|
3
|
+
Python library: image of a civil-registry / parish record → validated
|
|
4
|
+
structured JSON.
|
|
5
|
+
|
|
6
|
+
> *tabellio*: the Roman / medieval scribe who officially drafted legal acts.
|
|
7
|
+
|
|
8
|
+
## Language: English only
|
|
9
|
+
|
|
10
|
+
**This entire project is English — no French anywhere.** Code, comments,
|
|
11
|
+
docstrings, logs, tests, README, docs, commit messages, and **this
|
|
12
|
+
`CLAUDE.md`**. It is a public library. Talk to the user in its preferred language, write
|
|
13
|
+
every persisted artifact in English.
|
|
14
|
+
|
|
15
|
+
## Public repo — no real data
|
|
16
|
+
|
|
17
|
+
This repo is public and stays public. Therefore: **no real personal data** in
|
|
18
|
+
the repo, ever. Examples, fixtures and tests use fictional acts or public-domain
|
|
19
|
+
historical records (registers > 120 years old, no identifiable living person).
|
|
20
|
+
Never a user-supplied scan, never a family act. (Re-added after an edit dropped
|
|
21
|
+
it — it matters here because the sibling project it came from exists precisely
|
|
22
|
+
to keep that kind of data private.)
|
|
23
|
+
|
|
24
|
+
## Rationale — why this shape
|
|
25
|
+
|
|
26
|
+
Decision chain, in the order it was settled:
|
|
27
|
+
|
|
28
|
+
1. **No local vision model.** On old cursive, local and
|
|
29
|
+
general-purpose VLMs hallucinate plausible names/dates — poison for
|
|
30
|
+
genealogy. Reliability comes from validation and schema, not the model.
|
|
31
|
+
2. **No home-grown trained HTR.** Transkribus / kraken have mature models a solo
|
|
32
|
+
dev won't beat. The differentiator is elsewhere: clean act schema, ambiguity
|
|
33
|
+
rules, confidence surfacing, exports.
|
|
34
|
+
3. **Not a SaaS.** Billing, quotas, support, model hosting, and above all
|
|
35
|
+
**GDPR**: hosting third-party uploads of recent people's acts means becoming
|
|
36
|
+
a data processor. That is a company, not a portfolio project.
|
|
37
|
+
4. **BYOK (bring your own key).** The caller supplies their own API key as a
|
|
38
|
+
call parameter. Ideally key + image go straight from the client to the
|
|
39
|
+
provider, so this library's code sees neither — no processing liability.
|
|
40
|
+
5. **So: a library**, plus (later) a static BYOK demo page as a showcase
|
|
41
|
+
artifact.
|
|
42
|
+
6. **Provider-agnostic.** NIM is one provider among several.
|
|
43
|
+
Gemini Flash reads acts better in practice; many people already have
|
|
44
|
+
a Gemini/OpenAI/Anthropic key and no NIM key.
|
|
45
|
+
|
|
46
|
+
## Decisions
|
|
47
|
+
|
|
48
|
+
| Topic | Decision |
|
|
49
|
+
|---|---|
|
|
50
|
+
| Form | Published Python library (PyPI: `tabellio`) |
|
|
51
|
+
| License | Permissive open source (MIT or Apache-2.0) |
|
|
52
|
+
| Language | **English everywhere** (see top). User-facing conversation stays in his preferred language. |
|
|
53
|
+
| Model | No embedded / trained model. Calls a third-party VLM via a provider adapter. |
|
|
54
|
+
| API key | **BYOK** — supplied by the caller, never stored, never logged. |
|
|
55
|
+
| Config | Three env vars, each a fallback for a `parse()` arg (explicit arg wins): `TABELLIO_PROVIDER`, `TABELLIO_KEY`, `TABELLIO_MODEL`. Nothing else read from the environment. |
|
|
56
|
+
| Providers | Thin multi-provider adapter: NIM, Gemini, OpenAI, Anthropic, Ollama (optional local). None required at install. All take `timeout=` (default 120s), `max_retries=0`. **NIM hosted endpoint rejects inline images >180 KB** (NVCF asset upload not implemented) → `NIMProvider` re-encodes in memory via `image.fit_within` (JPEG quality down, then downscale, long edge ≥ 1200 px; source untouched; loguru warning), or raises with `shrink=False`. Needs Pillow (`tabellio[nim]` / `tabellio[resize]`). Default model `meta/llama-3.2-11b-vision-instruct` (the 90B times out on the free tier) — small, hallucinates on cursive, use `output_mode="simple"`. **Gemini is the real path; NIM is runnable, not good.** |
|
|
57
|
+
| Output | JSON validated by a **Pydantic** schema. Three `output_mode`s, each its own prompt + target model: `"full"` (default) -> `Act`; `"simple"` -> `ActSummary` (type/date/location/persons, nothing else); `"transcription"` -> `Transcription` (verbatim `text` + `language`). |
|
|
58
|
+
| Transcription | Complete verbatim diplomatic transcription, source language + line breaks kept, `[?]` = one illegible word, `[illegible]` = a longer passage. As `Act.transcription` in full mode (`validate` warns if missing; GEDCOM `SOUR.TEXT`) or as the whole result in `"transcription"` mode. **Not** in `simple`. |
|
|
59
|
+
| Serialisers | One `parse()` (the only network call). `act.model_dump_json()` = JSON. `tabellio.to_gedcom(act)` = a complete **GEDCOM 7.0** document (`gedcom.py`; conformance-checked in tests against the `gedcom7` lib). No YAML helper (one-liner + a dep). Schema is GEDCOM-mappable by design: `GenDate.qualifier`/`calendar`, `Person.name_particle`/`name_suffix`, `Role` → `ASSO.ROLE`. |
|
|
60
|
+
| Ambiguity | No silent resolution: keep the original spelling, `qualifier` on every date, per-field `confidence`. |
|
|
61
|
+
| Hints | `act_type_hint` (`--hint`, enum) and `act_language_hint` (`--lang`, ISO code) — guesses verified against the image. `context` (`--context`, free text: names / date / place the caller already knows) — used **only** to disambiguate hard-to-read passages, never to override a clear reading; `raw` stays faithful; full mode adds a `note` where image beats context. |
|
|
62
|
+
| Act language | **International.** Any language or script (French, Latin, German, Dutch, Spanish, …). **Transcribe, never translate**: `raw`/`value` free text stays in the source language, Latinised names stay Latinised. Only `type` and `role` are a fixed English vocabulary. `Act.language` = model-detected ISO 639-1 code (full mode only). Optional `act_language_hint=` / `--lang`, verified against the image like `act_type_hint`. |
|
|
63
|
+
| Storage | **None.** No database, no disk cache of user content. |
|
|
64
|
+
| Accounts / billing | **None.** Permanently out of scope for the library. |
|
|
65
|
+
|
|
66
|
+
## Output schema (target)
|
|
67
|
+
|
|
68
|
+
An extracted act yields at least:
|
|
69
|
+
|
|
70
|
+
- `type`: `birth` | `baptism` | `marriage` | `death` | `burial`
|
|
71
|
+
- `date`: date **of the act** (the ceremony / registration) + raw spelling (`raw`), `confidence`
|
|
72
|
+
- `place`: town / parish
|
|
73
|
+
- `transcription`: complete verbatim text of the act, `[?]` / `[illegible]` for gaps
|
|
74
|
+
- `persons[]`: role (subject, father, mother, groom, bride, witness, godparent…),
|
|
75
|
+
`given` / `surname` / `name_particle` (SPFX) / `name_suffix` (NSFX), per-field
|
|
76
|
+
`confidence`, plus the **life-event** dates and places on the person:
|
|
77
|
+
`birth_date` / `birth_place`, `death_date` / `death_place`. For a baptism the
|
|
78
|
+
subject's real birth (often "né la veille" etc.) goes in `birth_date`; for a
|
|
79
|
+
burial the death goes in `death_date`. `validate` flags a baptism/burial whose
|
|
80
|
+
subject has no such date.
|
|
81
|
+
- `GenDate`: `raw`, `iso` (always proleptic-Gregorian), `qualifier`
|
|
82
|
+
(`exact|about|before|after|between|calculated` → GEDCOM `ABT`/`BEF`/`AFT`/`CAL`),
|
|
83
|
+
`calendar` (`gregorian|julian|french_republican`), `confidence`, `note`.
|
|
84
|
+
- `other[]`: occupations (`occupation`), marginal notes, reading notes
|
|
85
|
+
- `source_hint`: guessed register type (parish vs civil registry) from the form of the act
|
|
86
|
+
- `language`: model-detected ISO 639-1 code (full mode only)
|
|
87
|
+
- unread fields → absent or `null` + note, **never guessed**
|
|
88
|
+
|
|
89
|
+
`output_mode="simple"` yields only `type`, `date` (ISO string or `null`),
|
|
90
|
+
`location`, `persons[{role, given, surname}]` — no raw, confidence, qualifiers,
|
|
91
|
+
transcription, warnings. `output_mode="transcription"` yields only
|
|
92
|
+
`{text, language}`. Each mode has its own `_*_SYSTEM` prompt + target model, not
|
|
93
|
+
a projection of `Act`.
|
|
94
|
+
|
|
95
|
+
The exact schema lives in code (`tabellio/schema.py` or similar), not here —
|
|
96
|
+
this table is intent only.
|
|
97
|
+
|
|
98
|
+
## Target architecture
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
tabellio.parse(image, provider="gemini"|"nim"|"openai"|"anthropic"|"ollama",
|
|
102
|
+
api_key=..., model=None, act_type_hint=None, act_language_hint=None,
|
|
103
|
+
context=None, output_mode="full"|"simple"|"transcription")
|
|
104
|
+
-> Act | ActSummary | Transcription # Pydantic
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
`provider` / `api_key` / `model` fall back to `TABELLIO_PROVIDER` /
|
|
108
|
+
`TABELLIO_KEY` / `TABELLIO_MODEL` when not passed.
|
|
109
|
+
|
|
110
|
+
- `src/tabellio/providers/`: one module per provider, `registry.py` holds the
|
|
111
|
+
`Provider` protocol + lazy-import registry. Common interface
|
|
112
|
+
`(image, prompt, ...) -> raw_json`. Lazy import of optional SDKs.
|
|
113
|
+
- `src/tabellio/schema.py`: Pydantic models (`Act`, `Person`, `GenDate`…).
|
|
114
|
+
- `src/tabellio/validate.py`: post-extraction rules (date/role consistency, 2-digit years,
|
|
115
|
+
`confidence`).
|
|
116
|
+
- `src/tabellio/prompt.py`: the extraction prompts + few-shot. `system_prompt`
|
|
117
|
+
/ `few_shot` / `user_prompt` take `output_mode`. Not separately versioned —
|
|
118
|
+
the package version + git is the record until users actually need more.
|
|
119
|
+
- `python -m tabellio <image>` exists (`__main__.py`): thin CLI, config from
|
|
120
|
+
the env vars, `--provider` / `--model` / `--hint` / `--lang` / `--context` / `--output` /
|
|
121
|
+
`-v`.
|
|
122
|
+
|
|
123
|
+
## Out of scope — refuse
|
|
124
|
+
|
|
125
|
+
- Embedded local model, fine-tuning, home-grown HTR.
|
|
126
|
+
- Storage, accounts, billing, dashboard, job queue.
|
|
127
|
+
- Building or **merging a family tree**. `to_gedcom` emits one act's people +
|
|
128
|
+
events + the couple/parent links the act *states* — deduplication and tree
|
|
129
|
+
merging happen in the genealogist's software on import. No GEDCOM re-import.
|
|
130
|
+
- Image segmentation / heavy pre-processing (deskew, binarization) in v1.
|
|
131
|
+
(Exception: `image.fit_within` re-encodes in memory *only* to satisfy NIM's
|
|
132
|
+
180 KB transport limit — not an enhancement step, never touches the source.)
|
|
133
|
+
- **Translation** of transcribed text. Names, places, terms and notes are kept
|
|
134
|
+
verbatim in the act's language (see the "Act language" decision). A caller
|
|
135
|
+
wanting a vernacular form does that downstream.
|
|
136
|
+
|
|
137
|
+
## Stack
|
|
138
|
+
|
|
139
|
+
Python 3.14, `uv` (deps/venv), `ruff` (lint + format), `pytest`. `loguru` for
|
|
140
|
+
logs. Pydantic v2. Provider SDKs as optional dependencies
|
|
141
|
+
(`pip install tabellio[gemini]` etc.).
|
|
142
|
+
|
|
143
|
+
CI (`.github/workflows/ci.yml`): `lint` job (ruff check + format --check on
|
|
144
|
+
3.13) and a `test` matrix on Python 3.11–3.14, all via `uv sync --all-extras` +
|
|
145
|
+
`uv run`. Public repo: `github.com/rsaikali/tabellio`.
|
|
146
|
+
|
|
147
|
+
Release (`.github/workflows/release.yml`, PyPI **Trusted Publishing** / OIDC, no
|
|
148
|
+
token): push tag `vX.Y.Z` (must equal `[project].version`) → rehearsal on
|
|
149
|
+
TestPyPI; publish a GitHub release → real PyPI. GH environments `testpypi` /
|
|
150
|
+
`pypi`. Ships `py.typed`. `CHANGELOG.md` (Keep a Changelog), `SECURITY.md`.
|
tabellio-0.1.1/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
tabellio-0.1.1/Makefile
ADDED
tabellio-0.1.1/NOTICE
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
tabellio
|
|
2
|
+
Copyright 2026 Roland Saikali
|
|
3
|
+
|
|
4
|
+
This product includes software developed by Roland Saikali.
|
|
5
|
+
|
|
6
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
you may not use this file except in compliance with the License.
|
|
8
|
+
You may obtain a copy of the License at
|
|
9
|
+
|
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
|
|
12
|
+
Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
See the License for the specific language governing permissions and
|
|
16
|
+
limitations under the License.
|