gramps-web-toolkit 0.2.3__tar.gz → 0.2.4__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.
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/CHANGELOG.md +12 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/PKG-INFO +1 -1
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/apply/gwt_apply/ops.py +31 -3
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/apply/mutants.txt +3 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/apply/tests/test_apply.py +70 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/check/gwt_check/checks.py +10 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/check/gwt_check/cli.py +13 -1
- gramps_web_toolkit-0.2.4/check/gwt_check/repos.py +197 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/check/gwt_check/selftest.py +12 -2
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/check/mutants.txt +2 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/check/tests/test_check.py +149 -1
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/core/test_gwt_core.py +4 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/docs/apply.md +1 -1
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/docs/check.md +4 -1
- gramps_web_toolkit-0.2.3/check/gwt_check/repos.py +0 -56
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/.agents/skills/beads/SKILL.md +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/.agents/skills/beads/agents/openai.yaml +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/.beads/.gitignore +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/.beads/README.md +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/.beads/config.yaml +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/.beads/hooks/commit-msg +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/.beads/hooks/post-checkout +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/.beads/hooks/post-merge +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/.beads/hooks/pre-commit +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/.beads/hooks/pre-push +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/.beads/hooks/prepare-commit-msg +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/.beads/metadata.json +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/.claude/settings.json +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/.coderabbit.yaml +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/.codex/config.toml +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/.codex/hooks.json +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/.github/FUNDING.yml +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/.github/ISSUE_TEMPLATE/bug.yml +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/.github/ISSUE_TEMPLATE/capability.yml +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/.github/dependabot.yml +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/.github/pull_request_template.md +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/.github/scripts/check_wheel.sh +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/.github/scripts/run_tests.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/.github/workflows/ci.yml +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/.github/workflows/docs.yml +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/.github/workflows/release.yml +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/.github/workflows/stale.yml +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/.gitignore +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/AGENTS.md +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/CLAUDE.md +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/CONTRIBUTING.md +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/LICENSE +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/README.md +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/SECURITY.md +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/apply/.gitignore +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/apply/bench/run.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/apply/bench/synth.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/apply/conftest.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/apply/gwt_apply/__init__.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/apply/gwt_apply/__main__.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/apply/gwt_apply/cli.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/apply/gwt_apply/client.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/apply/gwt_apply/dates.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/apply/gwt_apply/dupes.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/apply/gwt_apply/lock.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/apply/gwt_apply/revert.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/apply/gwt_apply/snapshot.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/apply/tests/fake_api.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/check/ci-extra.sh +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/check/conftest.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/check/gwt-check +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/check/gwt_check/__init__.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/check/gwt_check/__main__.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/check/gwt_check/act.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/check/gwt_check/cites.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/check/gwt_check/client.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/check/gwt_check/compare.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/check/gwt_check/dates.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/check/gwt_check/fill.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/check/gwt_check/links.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/check/gwt_check/tree.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/check/tests/test_act.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/check/tests/test_cites.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/check/tests/test_dates.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/check/tests/test_fill.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/check/tests/test_links.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/core/gwt_core/__init__.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/core/gwt_core/cli.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/core/gwt_core/version.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/docs/agent-loop.md +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/docs/development.md +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/docs/fetch.md +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/docs/fscache.md +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/docs/gate.md +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/docs/getting-started.md +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/docs/hard-won.md +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/docs/images/banner.svg +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/docs/images/icon.svg +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/docs/images/logo.svg +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/docs/images/social-preview.png +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/docs/import-excel.md +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/docs/index.md +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/docs/leads.md +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/docs/ledger.md +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/docs/myheritage.md +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/docs/ocr-bench.md +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/docs/pipeline.md +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/docs/queue.md +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/docs/rank.md +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/docs/rawstore.md +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/docs/read.md +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/docs/requirements-docs.txt +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/docs/spanish-poller.md +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/docs/stylesheets/theme.css +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/examples/README.md +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/examples/changes-fixed.jsonl +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/examples/changes.jsonl +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/examples/demo.sh +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/examples/make_example.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/examples/tree.json.gz +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/fetch/conftest.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/fetch/gwt-fetch +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/fetch/gwt_fetch/__init__.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/fetch/gwt_fetch/__main__.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/fetch/gwt_fetch/cli.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/fetch/gwt_fetch/digibib.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/fetch/gwt_fetch/europeana.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/fetch/gwt_fetch/gazeta.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/fetch/gwt_fetch/geo.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/fetch/gwt_fetch/iiif.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/fetch/gwt_fetch/net.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/fetch/gwt_fetch/store.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/fetch/tests/test_fetch.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/fscache/gwt-fscache +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/fscache/gwt_fscache.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/fscache/test_gwt_fscache.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/gate/gwt-gate +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/gate/gwt_gate.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/gate/test_gwt_gate.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/importxl/gwt-import-excel +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/importxl/gwt_import_excel.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/importxl/test_end_to_end.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/importxl/test_gwt_import_excel.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/leads/gwt-leads +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/leads/gwt_leads.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/leads/mutants.txt +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/leads/test_gwt_leads.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/ledger/gwt-ledger +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/ledger/gwt_ledger.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/ledger/test_gwt_ledger.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/mkdocs.yml +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/myheritage/fixtures/catalog.html +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/myheritage/fixtures/graphql_basic.json +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/myheritage/fixtures/graphql_oldnews.json +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/myheritage/fixtures/graphql_paid.json +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/myheritage/fixtures/imperva.html +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/myheritage/fixtures/imperva_es.html +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/myheritage/fixtures/lockout_es.html +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/myheritage/fixtures/login_wall.html +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/myheritage/fixtures/matches_es.txt +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/myheritage/fixtures/paywall_final_url.txt +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/myheritage/fixtures/record_en.html +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/myheritage/fixtures/record_es.html +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/myheritage/fixtures/record_es.txt +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/myheritage/fixtures/tiny.jpg +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/myheritage/fixtures/tiny.png +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/myheritage/gwt-mh +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/myheritage/gwt_mh.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/myheritage/gwt_mh_browser.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/myheritage/test_gwt_mh.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/ocr-bench/engines/_common.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/ocr-bench/engines/doctr_ocr.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/ocr-bench/engines/kraken_htr.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/ocr-bench/engines/llm_cli.sh +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/ocr-bench/engines/paddle_ocr.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/ocr-bench/engines/surya_ocr.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/ocr-bench/engines/tesseract.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/ocr-bench/engines/trocr.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/ocr-bench/run.sh +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/ocr-bench/samples/.gitignore +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/ocr-bench/samples/fetch.sh +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/ocr-bench/samples/ref/gaceta-1885-01-01-p3.txt +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/ocr-bench/samples/ref/murillo-1618-bautismo.txt +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/ocr-bench/score.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/ocr-bench/setup.sh +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/ocr-bench/stage.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/pyproject.toml +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/queue/gwt-queue +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/queue/gwt_queue.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/queue/test_gwt_queue.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/rank/gwt-rank +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/rank/gwt_rank.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/rank/test_gwt_rank.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/rawstore/gwt-rawstore +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/rawstore/gwt_rawstore.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/rawstore/pre-commit +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/rawstore/test_gwt_rawstore.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/read/fixtures/pares-record.html +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/read/fixtures/pares-search.html +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/read/gwt-read +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/read/gwt_pares.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/read/gwt_read.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/read/gwt_reader.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/read/test_gwt_pares.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/read/test_gwt_read.py +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/spanish-poller/gwt-spanish-poller +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/spanish-poller/gwt_spanish_poller.js +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/spanish-poller/package.json +0 -0
- {gramps_web_toolkit-0.2.3 → gramps_web_toolkit-0.2.4}/spanish-poller/test/spanish-poller.test.js +0 -0
|
@@ -6,6 +6,18 @@ Every release has a **Change lists** heading. It names each change that makes a
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.2.4] - 2026-10-28
|
|
10
|
+
|
|
11
|
+
### Change lists
|
|
12
|
+
|
|
13
|
+
None.
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- `gwt-apply` `update_place` takes `enclosed_by` in `set`: it moves a place under another parent, refusing a parent that does not exist or one inside the place. A rerun is a skip, and `--verify` reports a place moved back as differing.
|
|
18
|
+
- `gwt-check repos --classify` sorts the sources with no repository by what they name (a repository the tree has, another institution, nothing), with the institutions grouped so one new repository can serve many sources. It only reports.
|
|
19
|
+
- `gwt-check check` reports `dup-media`: two media objects with the same checksum, the same file entered twice.
|
|
20
|
+
|
|
9
21
|
## [0.2.3] - 2026-10-26
|
|
10
22
|
|
|
11
23
|
### Change lists
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: gramps-web-toolkit
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.4
|
|
4
4
|
Summary: Command-line tools for running AI research agents against a Gramps Web family tree without letting them write guesses into it
|
|
5
5
|
Project-URL: Homepage, https://github.com/GeiserX/gramps-web-toolkit
|
|
6
6
|
Project-URL: Documentation, https://geiserx.github.io/gramps-web-toolkit/
|
|
@@ -87,7 +87,7 @@ PERSON_FIELDS = {"first_name", "surname", "gender"}
|
|
|
87
87
|
ADDRESS_KEYS = {"street", "locality", "city", "county", "state", "country", "postal", "phone"}
|
|
88
88
|
REPOSITORY_FIELDS = {"name", "type", "url", "address"}
|
|
89
89
|
EVENT_FIELDS = {"type", "date", "place", "description"}
|
|
90
|
-
PLACE_FIELDS = {"lat", "long"}
|
|
90
|
+
PLACE_FIELDS = {"lat", "long", "enclosed_by"}
|
|
91
91
|
NOTE_FIELDS = {"text", "type"}
|
|
92
92
|
CITATION_FIELDS = {"page", "confidence", "date"}
|
|
93
93
|
FAMILY_FIELDS = {"type"}
|
|
@@ -378,6 +378,11 @@ def validate(ops: list[dict]) -> list[str]:
|
|
|
378
378
|
if not isinstance(s, dict) or not s or set(s) - PLACE_FIELDS:
|
|
379
379
|
raise ValueError(f"set takes only {sorted(PLACE_FIELDS)}")
|
|
380
380
|
_check_coords(s)
|
|
381
|
+
if "enclosed_by" in s and not (isinstance(s["enclosed_by"], str) and (
|
|
382
|
+
s["enclosed_by"].startswith("key:") or _GRAMPS_ID.match(s["enclosed_by"]))):
|
|
383
|
+
raise ValueError(f"{s['enclosed_by']!r} is neither key:<key> nor a Gramps ID (never a handle)")
|
|
384
|
+
if s.get("enclosed_by") == op.get("place"):
|
|
385
|
+
raise ValueError("a place cannot enclose itself")
|
|
381
386
|
if name == "update_note":
|
|
382
387
|
f = op.get("set")
|
|
383
388
|
if not isinstance(f, dict) or not f or set(f) - NOTE_FIELDS:
|
|
@@ -924,12 +929,35 @@ class Applier:
|
|
|
924
929
|
place.setdefault("_class", "Place")
|
|
925
930
|
before = copy.deepcopy(place)
|
|
926
931
|
s = op["set"]
|
|
927
|
-
|
|
932
|
+
if "lat" in s:
|
|
933
|
+
place["lat"], place["long"] = str(s["lat"]), str(s["long"])
|
|
934
|
+
if "enclosed_by" in s:
|
|
935
|
+
parent = self.resolve("Place", s["enclosed_by"])
|
|
936
|
+
# compared with the parent the place has now, by handle: a place already under that one parent and no
|
|
937
|
+
# other is left as it is, with whatever its PlaceRef carries, so a rerun is a skip
|
|
938
|
+
if [r.get("ref") for r in place.get("placeref_list") or []] != [parent]:
|
|
939
|
+
self._refuse_place_loop(place, parent)
|
|
940
|
+
place["placeref_list"] = [{"_class": "PlaceRef", "ref": parent}]
|
|
928
941
|
if place == before:
|
|
929
|
-
self.actions.append(f"skip: Place {self.label(place)} already has those
|
|
942
|
+
self.actions.append(f"skip: Place {self.label(place)} already has those values")
|
|
930
943
|
return
|
|
931
944
|
self.save(before, place)
|
|
932
945
|
|
|
946
|
+
def _refuse_place_loop(self, place: dict, parent: str) -> None:
|
|
947
|
+
"""A conflict when `parent` is the place itself or lies inside it, at any depth: the place would enclose
|
|
948
|
+
itself. Walks every PlaceRef up from the new parent."""
|
|
949
|
+
seen, todo = set(), [parent]
|
|
950
|
+
while todo:
|
|
951
|
+
h = todo.pop()
|
|
952
|
+
if h == place["handle"]:
|
|
953
|
+
p = self.c.get("Place", parent) or {}
|
|
954
|
+
raise Conflict(f"Place {p.get('gramps_id') or parent} lies inside Place {self.label(place)}: "
|
|
955
|
+
"enclosing it there would make a loop")
|
|
956
|
+
if h in seen:
|
|
957
|
+
continue
|
|
958
|
+
seen.add(h)
|
|
959
|
+
todo += [r["ref"] for r in (self.c.get("Place", h) or {}).get("placeref_list") or [] if r.get("ref")]
|
|
960
|
+
|
|
933
961
|
def add_event(self, op):
|
|
934
962
|
target_cls = "Person" if op.get("person") else "Family"
|
|
935
963
|
target = self.obj(target_cls, op.get("person") or op.get("family"))
|
|
@@ -74,3 +74,6 @@ gwt_apply/snapshot.py | if not dump.get("tree"): | if False: | a gwt-check dump
|
|
|
74
74
|
gwt_apply/snapshot.py | if isinstance(started, (int, float)) and not isinstance(started, bool): | if False: | a gwt-check dump is dated by read_started, as gwt-check dates it
|
|
75
75
|
gwt_apply/snapshot.py | return isinstance(rows, list) and all(isinstance(o, dict) and isinstance(o.get("handle"), str) for o in rows) | return True | a gwt-check dump with rows that are not objects with handles is refused, not a traceback
|
|
76
76
|
gwt_apply/snapshot.py | except (OverflowError, OSError, ValueError): # out of range or NaN | except ValueError: # out of range or NaN | a gwt-check dump with a read_started out of range is dated by dumped_at, not a traceback
|
|
77
|
+
gwt_apply/ops.py | if h == place["handle"]: | if False: | update_place refuses a parent inside the place, a loop
|
|
78
|
+
gwt_apply/ops.py | if [r.get("ref") for r in place.get("placeref_list") or []] != [parent]: | if True: | a rerun of an update_place move leaves a dated PlaceRef to the same parent as it is
|
|
79
|
+
gwt_apply/ops.py | if s.get("enclosed_by") == op.get("place"): | if False: | validate refuses a place that encloses itself
|
|
@@ -514,6 +514,76 @@ def test_update_place_sets_coordinates_on_an_existing_place(fake):
|
|
|
514
514
|
assert validate([dict(ops[0], key="bad", set=bad)]), bad
|
|
515
515
|
|
|
516
516
|
|
|
517
|
+
def _places_under(fake):
|
|
518
|
+
"""plc1 (P0001) > town (P0002) > parish (P0003), and a second town, other (P0004), under plc1."""
|
|
519
|
+
fake.add("places", {"handle": "town", "name": {"value": "Oakford"}, "place_type": "Town", "placeref_list": [{"ref": "plc1"}]})
|
|
520
|
+
fake.add("places", {"handle": "parish", "name": {"value": "St Mary"}, "place_type": "Parish",
|
|
521
|
+
"placeref_list": [{"ref": "town", "date": {"dateval": [0, 0, 1850, False]}}], "lat": "1.5", "long": "2.5"})
|
|
522
|
+
fake.add("places", {"handle": "other", "name": {"value": "Elmbridge"}, "place_type": "Town", "placeref_list": [{"ref": "plc1"}]})
|
|
523
|
+
|
|
524
|
+
|
|
525
|
+
def test_update_place_moves_a_place_under_another_parent(fake):
|
|
526
|
+
_places_under(fake)
|
|
527
|
+
ops = [{"op": "update_place", "key": "mv", "ruling": R, "place": "P0003", "set": {"enclosed_by": "P0004"}}]
|
|
528
|
+
plan = run(fake, ops, dry_run=True)[0]
|
|
529
|
+
assert plan.status == "done" and fake.writes() == []
|
|
530
|
+
res = run(fake, ops)[0]
|
|
531
|
+
assert res.status == "done", res.actions
|
|
532
|
+
parish = fake.store["places"]["parish"]
|
|
533
|
+
assert [r["ref"] for r in parish["placeref_list"]] == ["other"] # one parent, the old one gone
|
|
534
|
+
assert "date" not in parish["placeref_list"][0]
|
|
535
|
+
assert (parish["name"], parish["lat"], parish["long"]) == ({"value": "St Mary"}, "1.5", "2.5") # the rest kept
|
|
536
|
+
assert fake.store["places"]["town"]["placeref_list"] == [{"ref": "plc1"}]
|
|
537
|
+
|
|
538
|
+
|
|
539
|
+
def test_update_place_rerun_of_a_move_is_a_skip(fake):
|
|
540
|
+
_places_under(fake)
|
|
541
|
+
ops = [{"op": "update_place", "key": "mv", "ruling": R, "place": "P0003", "set": {"enclosed_by": "P0004"}}]
|
|
542
|
+
assert run(fake, ops)[0].status == "done"
|
|
543
|
+
before = len(fake.writes())
|
|
544
|
+
res = run(fake, ops)[0]
|
|
545
|
+
assert res.status == "skip" and "already has those values" in res.actions[-1]
|
|
546
|
+
assert fake.writes()[before:] == []
|
|
547
|
+
# already under that parent from the start, with a dated PlaceRef: a skip that leaves the PlaceRef as it is
|
|
548
|
+
same = [dict(ops[0], key="same", set={"enclosed_by": "P0002"}, place="P0003")]
|
|
549
|
+
fake.store["places"]["parish"]["placeref_list"] = [{"ref": "town", "date": {"dateval": [0, 0, 1850, False]}}]
|
|
550
|
+
assert run(fake, same)[0].status == "skip"
|
|
551
|
+
assert fake.store["places"]["parish"]["placeref_list"][0]["date"] == {"dateval": [0, 0, 1850, False]}
|
|
552
|
+
|
|
553
|
+
|
|
554
|
+
def test_update_place_refuses_a_parent_that_does_not_exist(fake):
|
|
555
|
+
_places_under(fake)
|
|
556
|
+
ops = [{"op": "update_place", "key": "mv", "ruling": R, "place": "P0003", "set": {"enclosed_by": "P0999"}}]
|
|
557
|
+
res = run(fake, ops)[0]
|
|
558
|
+
assert res.status == "conflict" and "no Place with Gramps ID P0999" in res.actions[-1]
|
|
559
|
+
assert fake.store["places"]["parish"]["placeref_list"][0]["ref"] == "town"
|
|
560
|
+
for bad in ({"enclosed_by": "town"}, {"enclosed_by": None}, {"enclosed_by": "P0003"}):
|
|
561
|
+
assert validate([dict(ops[0], key="bad", set=bad)]), bad
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
def test_update_place_refuses_a_move_that_makes_a_loop(fake):
|
|
565
|
+
_places_under(fake)
|
|
566
|
+
for parent in ("P0003", "P0002"): # the top place under its grandchild, then under its child
|
|
567
|
+
ops = [{"op": "update_place", "key": "loop", "ruling": R, "place": "P0001", "set": {"enclosed_by": parent}}]
|
|
568
|
+
res = run(fake, ops)[0]
|
|
569
|
+
assert res.status == "conflict" and "would make a loop" in res.actions[-1], res.actions
|
|
570
|
+
assert fake.store["places"]["plc1"].get("placeref_list") in (None, []) # nothing written
|
|
571
|
+
|
|
572
|
+
|
|
573
|
+
def test_verify_sees_a_move_undone_after_the_apply(fake, tmp_path, env, capsys):
|
|
574
|
+
_places_under(fake)
|
|
575
|
+
p = tmp_path / "move.jsonl"
|
|
576
|
+
p.write_text(json.dumps({"op": "update_place", "key": "mv", "ruling": R, "place": "P0003",
|
|
577
|
+
"set": {"enclosed_by": "P0004"}}) + "\n")
|
|
578
|
+
assert main([str(p), "--verify"]) == 1
|
|
579
|
+
assert "differs: Place P0003 placeref_list" in capsys.readouterr().out
|
|
580
|
+
assert main([str(p), "--apply"]) == 0
|
|
581
|
+
capsys.readouterr()
|
|
582
|
+
assert main([str(p), "--verify"]) == 0
|
|
583
|
+
fake.store["places"]["parish"]["placeref_list"] = [{"ref": "town"}] # moved back by hand
|
|
584
|
+
assert main([str(p), "--verify"]) == 1
|
|
585
|
+
|
|
586
|
+
|
|
517
587
|
def test_coordinates_that_are_not_numbers_are_a_validation_error():
|
|
518
588
|
# float(None) is a TypeError: it must come out as a line in the error list, not a crash
|
|
519
589
|
for bad in (None, "north", [1]):
|
|
@@ -69,6 +69,7 @@ CHECKS = {
|
|
|
69
69
|
"living-media-sensitive": "media of a possibly living person, not marked private, whose path, description or "
|
|
70
70
|
"attributes look like an ID document, passport or home address",
|
|
71
71
|
"dup-repository": "two repositories with the same name, compared like people's names",
|
|
72
|
+
"dup-media": "two media objects with the same file: the same checksum",
|
|
72
73
|
"dup-citation": "two citations of one source with the same page text, ignoring case and spacing",
|
|
73
74
|
"private": "object or sub-reference marked private",
|
|
74
75
|
"place-no-coords": "place used by an event without coordinates",
|
|
@@ -260,6 +261,15 @@ def run_checks(tree: Tree, scope: set[tuple[str, str]] | None = None,
|
|
|
260
261
|
R = T["repositories"]
|
|
261
262
|
if R:
|
|
262
263
|
info["sources without repository"] = sum(1 for o in T["sources"].values() if not o.get("reporef_list"))
|
|
264
|
+
# the same file entered twice: Gramps keeps an md5 checksum per media object, the same identity gwt-apply's
|
|
265
|
+
# add_media uses to skip a file already in the tree. Empty means the file was never read: nothing to compare
|
|
266
|
+
by_checksum: dict[str, list[tuple[str, str]]] = defaultdict(list)
|
|
267
|
+
for h, o in T["media"].items():
|
|
268
|
+
if o.get("checksum"):
|
|
269
|
+
by_checksum[o["checksum"]].append((h, o.get("gramps_id") or h))
|
|
270
|
+
for group in by_checksum.values():
|
|
271
|
+
if len(group) > 1 and any(in_scope("media", h) for h, _ in group):
|
|
272
|
+
out.add("dup-media", ",".join(sorted((i for _, i in group), key=id_order)), "same checksum")
|
|
263
273
|
by_name: dict[str, list[str]] = defaultdict(list)
|
|
264
274
|
for h, o in R.items():
|
|
265
275
|
if norm(o.get("name") or ""):
|
|
@@ -316,7 +316,8 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
316
316
|
p.add_argument("--type", dest="rtype", help="repository type, e.g. Archive")
|
|
317
317
|
p.add_argument("--unlinked", action="store_true", help="also list sources with no repository and repositories no source lists")
|
|
318
318
|
p.add_argument("--json", action="store_true", help="print the result as JSON")
|
|
319
|
-
p.add_argument("--limit", type=int, default=30, help="sources listed with --unlinked (default 30)")
|
|
319
|
+
p.add_argument("--limit", type=int, default=30, help="sources listed with --unlinked or --classify (default 30)")
|
|
320
|
+
p.add_argument("--classify", action="store_true", help="instead of the list: sort the sources with no repository by what their own text names (a repository the tree has, another institution, nothing)")
|
|
320
321
|
live_opts(p)
|
|
321
322
|
|
|
322
323
|
p = sub.add_parser("fill-places", help="for each event with no place, the place its own citations name, with the quote; proposals only")
|
|
@@ -411,9 +412,20 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
411
412
|
return 0
|
|
412
413
|
if args.cmd == "repos":
|
|
413
414
|
from .repos import print_repository_report, repository_report
|
|
415
|
+
if args.classify and (args.name or args.rtype or args.unlinked):
|
|
416
|
+
raise BadInput("--classify stands alone; it takes no --name, --type or --unlinked")
|
|
414
417
|
tree = load(args.tree) if args.tree else Tree(live_dump(args)["objects"], source="live tree")
|
|
415
418
|
if tree.partial:
|
|
416
419
|
raise BadInput(f"{tree.source}: a .gramps backup has no repository details; use a dump")
|
|
420
|
+
if args.classify:
|
|
421
|
+
from .repos import classify_repositories, print_classification
|
|
422
|
+
rep = classify_repositories(tree)
|
|
423
|
+
if args.json:
|
|
424
|
+
json.dump(rep, sys.stdout, ensure_ascii=False, indent=1)
|
|
425
|
+
print()
|
|
426
|
+
else:
|
|
427
|
+
print_classification(rep, args.limit)
|
|
428
|
+
return 0
|
|
417
429
|
rep = repository_report(tree, name=args.name, rtype=args.rtype)
|
|
418
430
|
if args.json:
|
|
419
431
|
json.dump(rep, sys.stdout, ensure_ascii=False, indent=1)
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
"""`gwt-check repos`: find repositories by name or type, and list what is not linked. Read-only."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import re
|
|
6
|
+
import unicodedata
|
|
7
|
+
from urllib.parse import urlsplit
|
|
8
|
+
|
|
9
|
+
from .checks import norm
|
|
10
|
+
from .tree import Tree
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def repository_report(tree: Tree, *, name: str | None = None, rtype: str | None = None) -> dict:
|
|
14
|
+
"""Repositories matching `name` (a part of the name, compared like people's names) and `rtype`, each with the
|
|
15
|
+
sources that list it; plus the sources that list no repository and the repositories no source lists."""
|
|
16
|
+
repos, sources = tree.objs["repositories"], tree.objs["sources"]
|
|
17
|
+
used: dict[str, list[dict]] = {h: [] for h in repos}
|
|
18
|
+
bare = []
|
|
19
|
+
for s in sources.values():
|
|
20
|
+
refs = s.get("reporef_list") or []
|
|
21
|
+
if not refs:
|
|
22
|
+
bare.append({"id": s.get("gramps_id"), "title": s.get("title", "")})
|
|
23
|
+
for r in refs:
|
|
24
|
+
if r.get("ref") in used:
|
|
25
|
+
used[r["ref"]].append({"id": s.get("gramps_id"), "title": s.get("title", ""),
|
|
26
|
+
"call_number": r.get("call_number", ""), "media_type": r.get("media_type", "")})
|
|
27
|
+
found = []
|
|
28
|
+
for h, o in repos.items():
|
|
29
|
+
kind = o.get("type") if isinstance(o.get("type"), str) else (o.get("type") or {}).get("string", "")
|
|
30
|
+
if name and norm(name) not in norm(o.get("name") or ""):
|
|
31
|
+
continue
|
|
32
|
+
if rtype and norm(rtype) != norm(kind):
|
|
33
|
+
continue
|
|
34
|
+
found.append({"id": o.get("gramps_id"), "name": o.get("name") or "", "type": kind,
|
|
35
|
+
"urls": [u.get("path") for u in o.get("urls") or []], "sources": used[h]})
|
|
36
|
+
found.sort(key=lambda r: r["id"] or "")
|
|
37
|
+
return {
|
|
38
|
+
"repositories": found,
|
|
39
|
+
"sources_without_repository": sorted(bare, key=lambda r: r["id"] or ""),
|
|
40
|
+
"repositories_without_sources": [{"id": o.get("gramps_id"), "name": o.get("name", "")}
|
|
41
|
+
for h, o in sorted(repos.items(), key=lambda x: x[1].get("gramps_id") or "")
|
|
42
|
+
if not used[h]],
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def print_repository_report(rep: dict, *, unlinked: bool, limit: int) -> None:
|
|
47
|
+
for r in rep["repositories"]:
|
|
48
|
+
print(f"{r['id']} {r['name']} [{r['type']}] {len(r['sources'])} sources")
|
|
49
|
+
if not rep["repositories"]:
|
|
50
|
+
print("no repository matches")
|
|
51
|
+
if unlinked:
|
|
52
|
+
print(f"\nrepositories no source lists: {len(rep['repositories_without_sources'])}")
|
|
53
|
+
for r in rep["repositories_without_sources"][:limit]:
|
|
54
|
+
print(f" {r['id']} {r['name']}")
|
|
55
|
+
bare = rep["sources_without_repository"]
|
|
56
|
+
print(f"sources that list no repository: {len(bare)}")
|
|
57
|
+
for s in bare[:limit]:
|
|
58
|
+
print(f" {s['id']} {s['title']}")
|
|
59
|
+
if len(bare) > limit:
|
|
60
|
+
print(f" ... {len(bare) - limit} more (--limit, or --json)")
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
# Words that open the name of an institution that keeps records, lowercase and without accents. One table, so a
|
|
64
|
+
# language is added here and nowhere else.
|
|
65
|
+
INSTITUTION_WORDS = ("archives", "archive", "archivo", "archiv", "boletin oficial", "registro civil", "registre",
|
|
66
|
+
"mairie", "ayuntamiento", "musee", "museo", "biblioteca", "bibliotheque", "parroquia", "paroisse",
|
|
67
|
+
"hemeroteca", "arxiu", "archivio")
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def _host(url: str) -> str:
|
|
71
|
+
"""The host of a URL or bare address: no scheme, credentials, port, path or `www.`; lowercase."""
|
|
72
|
+
url = (url or "").strip().lower()
|
|
73
|
+
if "://" not in url:
|
|
74
|
+
url = "//" + url
|
|
75
|
+
try:
|
|
76
|
+
host = urlsplit(url).hostname or ""
|
|
77
|
+
except ValueError:
|
|
78
|
+
return ""
|
|
79
|
+
return host.strip(".").removeprefix("www.")
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
_ADDRESS = re.compile(r"(?:[a-z][a-z0-9+.-]*://)?[^\s|<>\"'()\[\]{},;]+")
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def _hosts_in(text: str) -> set[str]:
|
|
86
|
+
"""Hosts a free text mentions: each address-looking token (a scheme, or a dot between name parts) is parsed on
|
|
87
|
+
its own, so `host.evil.invalid`, `host@evil.invalid` and `evil.invalid/host` are never the host."""
|
|
88
|
+
out = set()
|
|
89
|
+
for tok in _ADDRESS.findall((text or "").lower()):
|
|
90
|
+
tok = tok.rstrip(".:!?")
|
|
91
|
+
if "://" in tok or re.search(r"[a-z0-9]\.[a-z]{2,}", tok):
|
|
92
|
+
h = _host(tok)
|
|
93
|
+
if "." in h:
|
|
94
|
+
out.add(h)
|
|
95
|
+
return out
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
def _fold(s: str) -> str:
|
|
99
|
+
return norm((s or "").replace("\u2019", "'").replace("\u2018", "'"))
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
def _first_whole(text: str, phrase: str) -> int:
|
|
103
|
+
"""Where `phrase` first occurs in `text` as whole words, or -1."""
|
|
104
|
+
i = text.find(phrase)
|
|
105
|
+
while i >= 0:
|
|
106
|
+
before = text[i - 1] if i else " "
|
|
107
|
+
after = text[i + len(phrase)] if i + len(phrase) < len(text) else " "
|
|
108
|
+
if not before.isalnum() and not after.isalnum():
|
|
109
|
+
return i
|
|
110
|
+
i = text.find(phrase, i + 1)
|
|
111
|
+
return -1
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
def _plain(s: str) -> str:
|
|
115
|
+
"""Lowercase, no accents, the same length as `s`, so an index into it is an index into `s`. Web addresses are
|
|
116
|
+
blanked with NUL: `web.archive.org` is not an archive named in the text."""
|
|
117
|
+
out = []
|
|
118
|
+
for c in s:
|
|
119
|
+
base = unicodedata.normalize("NFD", c)[0]
|
|
120
|
+
low = base.lower()
|
|
121
|
+
out.append(low if len(low) == 1 else base)
|
|
122
|
+
text = "".join(out)
|
|
123
|
+
for m in _ADDRESS.finditer(text):
|
|
124
|
+
tok = m.group().rstrip(".:!?")
|
|
125
|
+
if "://" in tok or re.search(r"[a-z0-9]\.[a-z]{2,}", tok):
|
|
126
|
+
text = text[:m.start()] + "\0" * len(tok) + text[m.start() + len(tok):]
|
|
127
|
+
return text
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
_LABEL_END = re.compile(r"[,;:()\0]| [|/\-\u2014\u2013] ")
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
def _institution(raw: str) -> str:
|
|
134
|
+
"""The institution `raw` names, in its own spelling: from the first institution word to the first comma, colon,
|
|
135
|
+
semicolon, bracket, web address or dash; "" when it names none."""
|
|
136
|
+
text = _plain(raw)
|
|
137
|
+
starts = [i for i in (_first_whole(text, w) for w in INSTITUTION_WORDS) if i >= 0]
|
|
138
|
+
if not starts:
|
|
139
|
+
return ""
|
|
140
|
+
i = min(starts)
|
|
141
|
+
m = _LABEL_END.search(text, i)
|
|
142
|
+
return " ".join(raw[i:m.start() if m else len(raw)][:60].split()).strip(" ,;.-")
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
def classify_repositories(tree: Tree) -> dict:
|
|
146
|
+
"""Read-only. Sources with no repository, sorted by what their own text says:
|
|
147
|
+
`names_existing`: title, author or publication info names a repository the tree has (by its name as whole words,
|
|
148
|
+
or by its web host); `names_other`: it opens with an institution word but that institution is not a repository
|
|
149
|
+
of the tree (grouped, so one new repository can serve many sources); `names_nothing`: no institution at all."""
|
|
150
|
+
repos, sources = tree.objs["repositories"], tree.objs["sources"]
|
|
151
|
+
known = []
|
|
152
|
+
for h, o in repos.items():
|
|
153
|
+
name = _fold(o.get("name"))
|
|
154
|
+
hosts = {_host(u.get("path") or "") for u in o.get("urls") or []} - {""}
|
|
155
|
+
if name:
|
|
156
|
+
known.append((o.get("gramps_id"), name, hosts))
|
|
157
|
+
existing, other, nothing = [], {}, []
|
|
158
|
+
for s in sources.values():
|
|
159
|
+
if s.get("reporef_list"):
|
|
160
|
+
continue
|
|
161
|
+
fields = {k: _fold(s.get(k)) for k in ("title", "author", "pubinfo")}
|
|
162
|
+
named_hosts = {k: _hosts_in(s.get(k)) for k in fields}
|
|
163
|
+
hit = [(rid, f) for rid, name, hosts in known
|
|
164
|
+
for f in fields if _first_whole(fields[f], name) >= 0 or (hosts & named_hosts[f])]
|
|
165
|
+
if hit:
|
|
166
|
+
ids = sorted({r for r, _ in hit})
|
|
167
|
+
existing.append({"source": s.get("gramps_id"), "title": s.get("title", ""), "repositories": ids,
|
|
168
|
+
"fields": sorted({f for _, f in hit}), "certain": len(ids) == 1})
|
|
169
|
+
continue
|
|
170
|
+
label = next((x for x in (_institution(s.get(k) or "") for k in ("title", "author", "pubinfo")) if x), "")
|
|
171
|
+
if label:
|
|
172
|
+
other.setdefault(_fold(label), (label, []))[1].append(s.get("gramps_id"))
|
|
173
|
+
else:
|
|
174
|
+
nothing.append(s.get("gramps_id"))
|
|
175
|
+
return {
|
|
176
|
+
"names_existing": sorted(existing, key=lambda x: x["source"] or ""),
|
|
177
|
+
"names_other": [{"institution": label, "sources": sorted(ids, key=lambda x: x or "")}
|
|
178
|
+
for _, (label, ids) in sorted(other.items(), key=lambda kv: (-len(kv[1][1]), kv[0]))],
|
|
179
|
+
"names_nothing": sorted(nothing, key=lambda x: x or ""),
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
def print_classification(rep: dict, limit: int) -> None:
|
|
184
|
+
ex = rep["names_existing"]
|
|
185
|
+
print(f"sources with no repository that name one the tree has: {len(ex)} "
|
|
186
|
+
f"({sum(1 for x in ex if x['certain'])} name exactly one)")
|
|
187
|
+
for x in ex[:limit]:
|
|
188
|
+
print(f" {x['source']} -> {','.join(x['repositories'])} (in {', '.join(x['fields'])}) {x['title'][:60]}")
|
|
189
|
+
if len(ex) > limit:
|
|
190
|
+
print(f" ... {len(ex) - limit} more (--limit, or --json)")
|
|
191
|
+
print(f"institutions named but not a repository of the tree: {len(rep['names_other'])}")
|
|
192
|
+
for x in rep["names_other"][:limit]:
|
|
193
|
+
print(f" {len(x['sources']):3d} sources {x['institution']}")
|
|
194
|
+
if len(rep["names_other"]) > limit:
|
|
195
|
+
print(f" ... {len(rep['names_other']) - limit} more (--limit, or --json)")
|
|
196
|
+
print(f"sources that name no institution (a family photo, an e-mail, a website): {len(rep['names_nothing'])}")
|
|
197
|
+
print("report only: nothing is changed; link with gwt-apply link_repository after reading each source")
|
|
@@ -160,7 +160,8 @@ def p_orphan_note(d):
|
|
|
160
160
|
|
|
161
161
|
|
|
162
162
|
def p_orphan_media(d):
|
|
163
|
-
d["media"].append({**copy.deepcopy(d["media"][0]), "handle": "hO0099", "gramps_id": "O0099"
|
|
163
|
+
d["media"].append({**copy.deepcopy(d["media"][0]), "handle": "hO0099", "gramps_id": "O0099",
|
|
164
|
+
"path": "ejemplo/acta-0099.jpg", "checksum": "9" * 32})
|
|
164
165
|
|
|
165
166
|
|
|
166
167
|
def p_orphan_repository(d):
|
|
@@ -173,6 +174,12 @@ def p_source_no_repository(d):
|
|
|
173
174
|
attribute_list=[], media_list=[], note_list=[], reporef_list=[]))
|
|
174
175
|
|
|
175
176
|
|
|
177
|
+
def p_dup_media(d):
|
|
178
|
+
for n, path in ((97, "ejemplo/acta-0097.jpg"), (98, "ejemplo/acta-0098-copia.jpg")):
|
|
179
|
+
d["media"].append({**copy.deepcopy(d["media"][0]), "handle": f"hO00{n}", "gramps_id": f"O00{n}",
|
|
180
|
+
"path": path, "checksum": "a" * 32})
|
|
181
|
+
|
|
182
|
+
|
|
176
183
|
def p_dup_repository(d):
|
|
177
184
|
d["repositories"].append({**copy.deepcopy(d["repositories"][0]), "handle": "hR0098", "gramps_id": "R0098",
|
|
178
185
|
"name": "ARCHIVO DIOCESANO DE EJEMPLO"})
|
|
@@ -219,7 +226,9 @@ def p_private(d):
|
|
|
219
226
|
|
|
220
227
|
|
|
221
228
|
def _sensitive_media(d, gid, person_gid, birth, desc):
|
|
222
|
-
|
|
229
|
+
# its own file, so the copy of O0001 is not also a dup-media
|
|
230
|
+
m = {**copy.deepcopy(d["media"][0]), "handle": "h" + gid, "gramps_id": gid, "desc": desc,
|
|
231
|
+
"checksum": f"{int(gid[1:]):032x}"}
|
|
223
232
|
d["media"].append(m)
|
|
224
233
|
p = _new_person(d, person_gid, "Nuria", "Prado Lago", birth=birth)
|
|
225
234
|
p["media_list"] = [_ref(m["handle"], rect=[])]
|
|
@@ -482,6 +491,7 @@ PLANTS = [
|
|
|
482
491
|
(p_orphan_repository, "orphan-repository", "R0099", False),
|
|
483
492
|
(p_source_no_repository, "info:sources without repository", "S0099", False),
|
|
484
493
|
(p_dup_repository, "dup-repository", "R0001,R0098", False),
|
|
494
|
+
(p_dup_media, "dup-media", "O0097,O0098", False),
|
|
485
495
|
(p_dup_citation, "dup-citation", "C0001,C0098", False),
|
|
486
496
|
(p_dangling_child, "dangling-ref", "F0002 child_ref_list -> people ghost-person", False),
|
|
487
497
|
(p_dangling_subref, "dangling-ref", "F0003 child_ref_list[I0003].note_list -> notes ghost-note", False),
|
|
@@ -38,3 +38,5 @@ gwt_check/cites.py | prob = citation_problem(e, c) if c else None | prob = citat
|
|
|
38
38
|
gwt_check/cli.py | raise BadInput(f"{tree.source}: a .gramps backup has no citation pages; use a dump") | pass | cites refuses a .gramps backup
|
|
39
39
|
gwt_check/fill.py | if rep.get("held_back"): | if False: | the text output counts the held-back events
|
|
40
40
|
gwt_check/client.py | got += pool.map(first_page, TYPES[1:]) | got += [first_page(t) for t in TYPES[1:]] | the first pages of the types are read together, not one type after another
|
|
41
|
+
gwt_check/checks.py | if len(group) > 1 and any(in_scope("media", h) for h, _ in group): | if len(group) > 1: | dup-media reports a group only when one member is in scope
|
|
42
|
+
gwt_check/checks.py | if o.get("checksum"): | if True: | a media object with no checksum is never a duplicate
|