heritage-cli 1.0.0__tar.gz → 1.0.2__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.
Files changed (26) hide show
  1. heritage_cli-1.0.2/PKG-INFO +20 -0
  2. heritage_cli-1.0.2/README.md +141 -0
  3. {heritage_cli-1.0.0 → heritage_cli-1.0.2}/pyproject.toml +21 -4
  4. {heritage_cli-1.0.0 → heritage_cli-1.0.2}/src/heritage_cli/__init__.py +7 -2
  5. heritage_cli-1.0.2/src/heritage_cli/commands/dibble.py +27 -0
  6. {heritage_cli-1.0.0 → heritage_cli-1.0.2}/src/heritage_cli/commands/hoard.py +2 -1
  7. heritage_cli-1.0.2/src/heritage_cli/commands/libby.py +27 -0
  8. heritage_cli-1.0.2/src/heritage_cli/commands/stratigraph.py +27 -0
  9. heritage_cli-1.0.2/src/heritage_cli/commands/trowel.py +27 -0
  10. {heritage_cli-1.0.0 → heritage_cli-1.0.2}/src/heritage_cli/main.py +193 -57
  11. {heritage_cli-1.0.0 → heritage_cli-1.0.2}/src/heritage_cli/orchestrator.py +142 -69
  12. heritage_cli-1.0.2/src/heritage_cli.egg-info/PKG-INFO +20 -0
  13. {heritage_cli-1.0.0 → heritage_cli-1.0.2}/src/heritage_cli.egg-info/SOURCES.txt +8 -1
  14. heritage_cli-1.0.2/src/heritage_cli.egg-info/requires.txt +18 -0
  15. heritage_cli-1.0.2/tests/test_integration.py +309 -0
  16. heritage_cli-1.0.2/tests/test_orchestrator.py +211 -0
  17. heritage_cli-1.0.2/tests/test_smoke.py +80 -0
  18. heritage_cli-1.0.0/PKG-INFO +0 -11
  19. heritage_cli-1.0.0/README.md +0 -82
  20. heritage_cli-1.0.0/src/heritage_cli.egg-info/PKG-INFO +0 -11
  21. heritage_cli-1.0.0/src/heritage_cli.egg-info/requires.txt +0 -6
  22. {heritage_cli-1.0.0 → heritage_cli-1.0.2}/setup.cfg +0 -0
  23. {heritage_cli-1.0.0 → heritage_cli-1.0.2}/src/heritage_cli/commands/__init__.py +0 -0
  24. {heritage_cli-1.0.0 → heritage_cli-1.0.2}/src/heritage_cli.egg-info/dependency_links.txt +0 -0
  25. {heritage_cli-1.0.0 → heritage_cli-1.0.2}/src/heritage_cli.egg-info/entry_points.txt +0 -0
  26. {heritage_cli-1.0.0 → heritage_cli-1.0.2}/src/heritage_cli.egg-info/top_level.txt +0 -0
@@ -0,0 +1,20 @@
1
+ Metadata-Version: 2.4
2
+ Name: heritage-cli
3
+ Version: 1.0.2
4
+ Summary: Unified CLI for the heritage science open-source ecosystem — orchestrates HOARD, StratiGraph, Trowel, Libby, Dibble, and other tools
5
+ Author: Mark Bouck
6
+ License: MIT
7
+ Requires-Python: >=3.11
8
+ Requires-Dist: typer>=0.12
9
+ Requires-Dist: rich>=13
10
+ Requires-Dist: pyyaml>=6
11
+ Provides-Extra: hoard
12
+ Requires-Dist: hoard; extra == "hoard"
13
+ Provides-Extra: libby
14
+ Requires-Dist: libby; extra == "libby"
15
+ Provides-Extra: dibble
16
+ Requires-Dist: dibble; extra == "dibble"
17
+ Provides-Extra: trowel
18
+ Requires-Dist: trowel; extra == "trowel"
19
+ Provides-Extra: stratigraph
20
+ Requires-Dist: stratigraph; extra == "stratigraph"
@@ -0,0 +1,141 @@
1
+ # heritage-cli
2
+
3
+ Unified command-line orchestrator for the heritage science open-source ecosystem. Runs multi-tool archaeological workflows as a single command.
4
+
5
+ ## What It Does
6
+
7
+ `heritage` is a thin orchestration layer. It reads a declarative `pipeline.yaml` file and invokes HOARD, StratiGraph, Libby, and other tools in the correct order, passing workspace paths between them and pausing at human review gates.
8
+
9
+ It does **not** do any data processing itself — that stays in the individual tools.
10
+
11
+ ## Installation
12
+
13
+ ```bash
14
+ pip install heritage-cli
15
+ ```
16
+
17
+ Requires the tools you intend to use to also be installed (`hoard`, `libby`, etc.).
18
+
19
+ Or install with specific tool dependencies:
20
+
21
+ ```bash
22
+ pip install heritage-cli[hoard,libby,stratigraph,dibble,trowel]
23
+ ```
24
+
25
+ Install all ecosystem tools at once:
26
+
27
+ ```bash
28
+ pip install heritage-cli[hoard,libby,stratigraph,dibble,trowel]
29
+ ```
30
+
31
+ ## Usage
32
+
33
+ ```bash
34
+ # Run a full pipeline from a definition file
35
+ heritage run --pipeline pipeline.yaml --project my_site_2026
36
+
37
+ # If interrupted, heritage automatically resumes from the last completed step
38
+
39
+ # List installed and discoverable heritage tools
40
+ heritage tools
41
+
42
+ # Run tools individually (requires the tool to be installed)
43
+ heritage calibrate --project my_site_2026
44
+ heritage lithics --project my_site_2026
45
+ heritage review --project my_site_2026
46
+ heritage matrix --project my_site_2026
47
+ heritage publish --project my_site_2026
48
+ ```
49
+
50
+ ## Pipeline Definition
51
+
52
+ See `pipeline.example.yaml` for a full example. The basic structure:
53
+
54
+ ```yaml
55
+ steps:
56
+ - id: digitise
57
+ project: hoard
58
+ phases: [0, 1]
59
+
60
+ - id: review_digitisation
61
+ gate: review
62
+ message: "Review digitised context sheets before proceeding"
63
+ action: "hoard review --project {project_id}"
64
+ depends_on: [digitise]
65
+
66
+ - id: spatial
67
+ project: hoard
68
+ phases: [2]
69
+ depends_on: [review_digitisation]
70
+
71
+ - id: calibrate
72
+ project: libby
73
+ action: calibrate
74
+ input: output/01_digitised/samples.json
75
+ depends_on: [review_digitisation]
76
+
77
+ - id: draft
78
+ project: hoard
79
+ phases: [3, 4]
80
+ depends_on: [spatial, calibrate]
81
+
82
+ - id: review_draft
83
+ gate: review
84
+ message: "Review the draft before final export"
85
+ depends_on: [draft]
86
+
87
+ - id: export
88
+ project: hoard
89
+ action: export
90
+ formats: [docx, pdf]
91
+ depends_on: [review_draft]
92
+ ```
93
+
94
+ ## Pipeline State
95
+
96
+ Progress is saved to `$XDG_DATA_HOME/heritage/workspaces/{project_id}/pipeline_state.json`. If a run is interrupted, the next `heritage run` invocation automatically resumes from the last completed step.
97
+
98
+ ## Ecosystem
99
+
100
+ `heritage-cli` is part of a wider open-source heritage science toolkit:
101
+
102
+ | Tool | Purpose |
103
+ |------|---------|
104
+ | [hoard](https://github.com/mabo-du/hoard) | AI-powered archaeological report generation |
105
+ | [stratigraph](https://github.com/mabo-du/stratigraph) | Harris Matrix visualisation |
106
+ | [libby](https://github.com/mabo-du/libby) | Radiocarbon calibration |
107
+ | [cache-and-carry](https://github.com/mabo-du/cache-and-carry) | Collections & vocabulary management |
108
+ | [heritage-types](https://github.com/mabo-du/heritage-types) | Shared data schemas |
109
+
110
+ ## Status
111
+
112
+ | Command | Status |
113
+ |---------|--------|
114
+ | `heritage run` | ✅ Implemented |
115
+ | `heritage calibrate` | ✅ Implemented |
116
+ | `heritage lithics` | ✅ Implemented |
117
+ | `heritage review` | ✅ Implemented |
118
+ | `heritage matrix` | ✅ Implemented |
119
+ | `heritage publish` | ✅ Implemented |
120
+ | `heritage tools` | ✅ Implemented |
121
+ | `heritage pipeline-status` | ✅ Implemented |
122
+
123
+ ## License
124
+
125
+ MIT
126
+
127
+ ## Development
128
+
129
+ ```bash
130
+ # Clone and install in dev mode
131
+ pip install -e ".[dev]"
132
+
133
+ # Run unit tests (no sibling packages required)
134
+ python -m pytest tests/ -v -m "not integration"
135
+
136
+ # Run all tests including integration (requires hoard installed)
137
+ python -m pytest tests/ -v
138
+
139
+ # Type check
140
+ mypy src/
141
+ ```
@@ -4,20 +4,26 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "heritage-cli"
7
- version = "1.0.0"
7
+ version = "1.0.2"
8
8
  description = "Unified CLI for the heritage science open-source ecosystem — orchestrates HOARD, StratiGraph, Trowel, Libby, Dibble, and other tools"
9
9
  requires-python = ">=3.11"
10
10
  license = { text = "MIT" }
11
11
  authors = [
12
- { name = "Marcus Quinn" },
12
+ { name = "Mark Bouck" },
13
13
  ]
14
14
  dependencies = [
15
15
  "typer>=0.12",
16
16
  "rich>=13",
17
- "platformdirs>=4",
18
- "tomli>=2; python_version < '3.11'",
17
+ "pyyaml>=6",
19
18
  ]
20
19
 
20
+ [project.optional-dependencies]
21
+ hoard = ["hoard"]
22
+ libby = ["libby"]
23
+ dibble = ["dibble"]
24
+ trowel = ["trowel"]
25
+ stratigraph = ["stratigraph"]
26
+
21
27
  [project.scripts]
22
28
  heritage = "heritage_cli.main:app"
23
29
 
@@ -30,3 +36,14 @@ dibble = "heritage_cli.commands.dibble"
30
36
 
31
37
  [tool.setuptools.packages.find]
32
38
  where = ["src"]
39
+
40
+ [tool.mypy]
41
+ python_version = "3.11"
42
+ warn_return_any = true
43
+ warn_unused_configs = true
44
+ ignore_missing_imports = true
45
+
46
+ [tool.pytest.ini_options]
47
+ markers = [
48
+ "integration: tests that require sibling ecosystem packages to be installed",
49
+ ]
@@ -13,9 +13,14 @@ Usage:
13
13
  heritage --help
14
14
  heritage run --project X --phase 0
15
15
  heritage calibrate --project X --input samples.json
16
- heritage tools list
16
+ heritage tools list installed ecosystem tools
17
17
 
18
18
  Configuration: ~/.config/heritage/config.toml
19
19
  """
20
20
 
21
- __version__ = "1.0.0"
21
+ from importlib.metadata import PackageNotFoundError, version
22
+
23
+ try:
24
+ __version__ = version("heritage-cli")
25
+ except PackageNotFoundError:
26
+ __version__ = "1.0.0"
@@ -0,0 +1,27 @@
1
+ """Dibble command dispatch — Lithic analysis.
2
+
3
+ Registered as heritage_cli.commands.dibble in entry_points.
4
+ """
5
+
6
+ tool_name = "dibble"
7
+ description = "Lithic analysis"
8
+
9
+
10
+ def dispatch(args: list[str] | None = None) -> int:
11
+ """Run dibble with the given CLI arguments.
12
+
13
+ Returns subprocess exit code.
14
+ """
15
+ import shutil
16
+ import subprocess
17
+ import sys
18
+
19
+ dibble_bin = shutil.which("dibble")
20
+ if not dibble_bin:
21
+ sys.stderr.write("Dibble is not installed.\n")
22
+ sys.stderr.write("Install with: pip install dibble\n")
23
+ return 1
24
+
25
+ cmd = [dibble_bin] + (args or sys.argv[2:])
26
+ result = subprocess.run(cmd, check=True)
27
+ return result.returncode
@@ -14,6 +14,7 @@ def dispatch(args: list[str] | None = None) -> int:
14
14
  """
15
15
  import subprocess
16
16
  import sys
17
+
17
18
  cmd = ["hoard"] + (args or sys.argv[2:])
18
- result = subprocess.run(cmd)
19
+ result = subprocess.run(cmd, check=True, timeout=3600)
19
20
  return result.returncode
@@ -0,0 +1,27 @@
1
+ """Libby command dispatch — Radiocarbon calibration.
2
+
3
+ Registered as heritage_cli.commands.libby in entry_points.
4
+ """
5
+
6
+ tool_name = "libby"
7
+ description = "Radiocarbon calibration"
8
+
9
+
10
+ def dispatch(args: list[str] | None = None) -> int:
11
+ """Run libby with the given CLI arguments.
12
+
13
+ Returns subprocess exit code.
14
+ """
15
+ import shutil
16
+ import subprocess
17
+ import sys
18
+
19
+ libby_bin = shutil.which("libby")
20
+ if not libby_bin:
21
+ sys.stderr.write("Libby is not installed.\n")
22
+ sys.stderr.write("Install with: pip install libby\n")
23
+ return 1
24
+
25
+ cmd = [libby_bin] + (args or sys.argv[2:])
26
+ result = subprocess.run(cmd, check=True)
27
+ return result.returncode
@@ -0,0 +1,27 @@
1
+ """StratiGraph command dispatch — Harris Matrix visualisation.
2
+
3
+ Registered as heritage_cli.commands.stratigraph in entry_points.
4
+ """
5
+
6
+ tool_name = "stratigraph"
7
+ description = "Harris Matrix visualisation and validation"
8
+
9
+
10
+ def dispatch(args: list[str] | None = None) -> int:
11
+ """Run stratigraph with the given CLI arguments.
12
+
13
+ Returns subprocess exit code.
14
+ """
15
+ import shutil
16
+ import subprocess
17
+ import sys
18
+
19
+ stratigraph_bin = shutil.which("stratigraph")
20
+ if not stratigraph_bin:
21
+ sys.stderr.write("StratiGraph is not installed.\n")
22
+ sys.stderr.write("Install from: https://github.com/mabo-du/stratigraph\n")
23
+ return 1
24
+
25
+ cmd = [stratigraph_bin] + (args or sys.argv[2:])
26
+ result = subprocess.run(cmd, check=True)
27
+ return result.returncode
@@ -0,0 +1,27 @@
1
+ """Trowel command dispatch — Desktop report review dashboard.
2
+
3
+ Registered as heritage_cli.commands.trowel in entry_points.
4
+ """
5
+
6
+ tool_name = "trowel"
7
+ description = "Desktop report review dashboard"
8
+
9
+
10
+ def dispatch(args: list[str] | None = None) -> int:
11
+ """Run trowel with the given CLI arguments.
12
+
13
+ Returns subprocess exit code.
14
+ """
15
+ import shutil
16
+ import subprocess
17
+ import sys
18
+
19
+ trowel_bin = shutil.which("trowel")
20
+ if not trowel_bin:
21
+ sys.stderr.write("Trowel is not installed.\n")
22
+ sys.stderr.write("Install from: https://github.com/mabo-du/trowel\n")
23
+ return 1
24
+
25
+ cmd = [trowel_bin] + (args or sys.argv[2:])
26
+ result = subprocess.run(cmd, check=True)
27
+ return result.returncode