Index
axm_ingot
axm-ingot.
Canonical shared helpers factored out of duplicated AXM code.
Member
dataclass
A single uv-workspace member.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Basename of the member directory -- not the |
path |
Path
|
Absolute, resolved path to the member directory. |
Source code in packages/axm-ingot/src/axm_ingot/uv/models.py
ResolvedWorkspace
dataclass
A uv workspace with its resolved members.
Attributes:
| Name | Type | Description |
|---|---|---|
root |
Path
|
Absolute path to the workspace root (holding the root pyproject). |
members |
tuple[Member, ...]
|
Members sorted by name. |
Source code in packages/axm-ingot/src/axm_ingot/uv/models.py
compact_table(rows, headers=None)
Render rows as a column-aligned table, optionally with a headers row.
Tolerates ragged rows (short rows are padded) and arbitrarily wide cells.
None cells render as empty, never as the literal "None".
Source code in packages/axm-ingot/src/axm_ingot/render.py
find_project_root(start)
Walk parents from start to the first directory holding any pyproject.
Returns the directory of the first ancestor (start included) that
contains a pyproject.toml -- any project, not necessarily a uv
workspace. start is resolved first; a file start is anchored on its
parent directory. Unlike :func:find_workspace_root, this never returns
None: with no pyproject.toml in any ancestor it falls back to the
(resolved) starting directory.
Source code in packages/axm-ingot/src/axm_ingot/uv/resolve.py
find_workspace_root(path)
Walk parents from path to the first uv-workspace root.
Returns the directory of the first ancestor (path included) whose
pyproject.toml carries a [tool.uv.workspace] section, else None.
Source code in packages/axm-ingot/src/axm_ingot/uv/resolve.py
format_count(n)
Render an item count, abbreviating thousands (1500 → '1.5K').
Source code in packages/axm-ingot/src/axm_ingot/render.py
format_size(num_bytes)
Render a byte count in human units (2048 → '2.0 KB').
Source code in packages/axm-ingot/src/axm_ingot/render.py
header(tool, summary)
Render the compact header line {tool} | {summary}.
header("audit", "3 findings") 'audit | 3 findings'
labeled_block(label, lines)
Render label followed by lines, each indented two spaces.
An empty lines yields an empty string so no dangling label is emitted.
None entries render as blank lines rather than the literal "None".
Source code in packages/axm-ingot/src/axm_ingot/render.py
resolve_workspace(pyproject_dir)
Resolve the uv workspace rooted at pyproject_dir.
Parses [tool.uv.workspace].members, resolves the globs to directories,
subtracts the exclude globs, keeps only directories that contain a
pyproject.toml (require_pyproject), and returns the members sorted
by name. Returns None when pyproject_dir is not a uv workspace or
its pyproject is missing/malformed.
Source code in packages/axm-ingot/src/axm_ingot/uv/resolve.py
truncate(text, limit)
Bound text to limit chars, appending an ellipsis when it overflows.
Text at or under limit is returned unchanged. The overflow result has at
most limit + 1 characters and ends with the ellipsis marker.