Metadata-Version: 2.4
Name: index.toml
Version: 0.3.5
Summary: Python API and CLI for ecosystem-neutral package indexes
Keywords: monorepo,package inventory,dependency policy,workspace reconciliation,toml,uv,cargo,pnpm
Author: Jacob Stewart
License-Expression: Apache-2.0
License-File: LICENSE
License-File: NOTICE
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: index-toml-cli>=0.3.5,<0.4
Requires-Dist: index-toml-core>=0.3.5,<0.4
Requires-Python: >=3.10, <3.16
Project-URL: Repository, https://github.com/groupsum/index.toml
Project-URL: Documentation, https://github.com/groupsum/index.toml/blob/master/docs/usage.md
Project-URL: Issues, https://github.com/groupsum/index.toml/issues
Description-Content-Type: text/markdown

# index.toml

<!-- readme-standards:begin branding -->
<p align="center"><a href="https://github.com/groupsum/index.toml"><img src="https://raw.githubusercontent.com/groupsum/index.toml/master/docs/assets/index-toml.png" alt="index.toml logo showing a validated package index over stacked layers" width="300"></a></p>
<p align="center"><strong>index.toml</strong></p>
<p align="center">Python API and CLI for ecosystem-neutral package indexes</p>
<p align="center">
<a href="https://pypi.org/project/index.toml/"><img alt="pypi: index.toml" src="https://img.shields.io/pypi/v/index.toml?labelColor=292421&amp;color=994525"></a>
<a href="https://github.com/groupsum/index.toml/blob/master/pkgs/070-facade/index.toml/pyproject.toml"><img alt="Source version: 0.3.5" src="https://img.shields.io/static/v1?label=Source%20version&amp;message=0.3.5&amp;labelColor=292421&amp;color=994525"></a>
<a href="https://github.com/groupsum/index.toml/blob/master/pkgs/070-facade/index.toml/pyproject.toml"><img alt="Python: &gt;=3.10,&lt;3.16" src="https://img.shields.io/static/v1?label=Python&amp;message=%3E%3D3.10%2C%3C3.16&amp;labelColor=292421&amp;color=994525"></a>
<a href="https://github.com/groupsum/index.toml/blob/master/pkgs/070-facade/index.toml/pyproject.toml"><img alt="Layer: facade" src="https://img.shields.io/static/v1?label=Layer&amp;message=facade&amp;labelColor=292421&amp;color=994525"></a>
<a href="https://github.com/groupsum/index.toml/blob/master/pkgs/070-facade/index.toml/README.md#lifecycle-and-migration"><img alt="Lifecycle: experimental" src="https://img.shields.io/static/v1?label=Lifecycle&amp;message=experimental&amp;labelColor=292421&amp;color=67437E"></a>
<a href="https://github.com/groupsum/index.toml/blob/master/pkgs/070-facade/index.toml/LICENSE"><img alt="License: Apache-2.0" src="https://img.shields.io/static/v1?label=License&amp;message=Apache-2.0&amp;labelColor=292421&amp;color=994525"></a>
<a href="https://github.com/groupsum/index.toml/blob/master/pkgs/070-facade/index.toml/NOTICE"><img alt="Notice: attribution" src="https://img.shields.io/static/v1?label=Notice&amp;message=attribution&amp;labelColor=292421&amp;color=994525"></a>
</p>
<p align="center">
<a href="https://pypi.org/project/index.toml/"><img alt="Monthly PyPI downloads: index.toml" src="https://img.shields.io/pypi/dm/index.toml?labelColor=292421&amp;color=08704E"></a>
<a href="https://github.com/groupsum/index.toml/blob/master/pkgs/070-facade/index.toml/README.md"><img alt="README hits: index.toml" src="https://hits.sh/github.com/groupsum/index.toml/pkgs/070-facade/index.toml/README.md.svg?label=README%20hits&amp;labelColor=292421&amp;color=08704E"></a>
</p>
<p align="center">
<a href="https://github.com/groupsum/index.toml/actions/workflows/validate.yml"><img alt="README standards: CI gate" src="https://img.shields.io/static/v1?label=README%20standards&amp;message=CI%20gate&amp;labelColor=292421&amp;color=67437E"></a>
<a href="https://github.com/groupsum/index.toml/actions/workflows/validate.yml"><img alt="Tests: repository CI" src="https://img.shields.io/static/v1?label=Tests&amp;message=repository%20CI&amp;labelColor=292421&amp;color=67437E"></a>
<a href="https://github.com/groupsum/index.toml/blob/master/.ssot/registry.json"><img alt="Certification: not applicable" src="https://img.shields.io/static/v1?label=Certification&amp;message=not%20applicable&amp;labelColor=292421&amp;color=5F584F"></a>
<a href="https://github.com/groupsum/index.toml/blob/master/.ssot/registry.json"><img alt="Governance: repository policy" src="https://img.shields.io/static/v1?label=Governance&amp;message=repository%20policy&amp;labelColor=292421&amp;color=67437E"></a>
<a href="https://github.com/groupsum/index.toml/actions/workflows/validate.yml"><img alt="Evidence: validation results" src="https://img.shields.io/static/v1?label=Evidence&amp;message=validation%20results&amp;labelColor=292421&amp;color=67437E"></a>
</p>
<p align="center"><a href="#overview">Overview</a> · <a href="#installation">Installation</a> · <a href="#quick-start">Quick Start</a> · <a href="#usage">Usage</a> · <a href="#public-api-and-import-surfaces">API</a> · <a href="#contributing">Contributing</a> · <a href="#governance">Governance</a> · <a href="#license">License</a></p>
<!-- readme-standards:end branding -->

---

## Overview

### Summary

Install the public Python API and the `index-toml` command through one distribution. The facade composes the editor, CLI, and the three workspace adapters.

### Why This Package

The package index records package ownership and dependency directions across ecosystems.

### When to Use

Use this component directly when you need the API below. Install the facade for the combined tool.

### Features

One installation provides the CLI, file-backed API, and workspace reconciliation for Python, Cargo, and pnpm.

### Non-Goals

The tooling analyzes manifests and inventories. Package managers resolve and install dependencies.

---

## Getting Started

### Prerequisites

Use CPython 3.10 through 3.15.

### Installation

#### Install with uv

<!-- readme-standards:begin installation.uv -->
```bash
uv add index.toml
```
<!-- readme-standards:end installation.uv -->

#### Install with pip

<!-- readme-standards:begin installation.pip -->
```bash
python -m pip install index.toml
```
<!-- readme-standards:end installation.pip -->

#### Install with Poetry

<!-- readme-standards:begin installation.poetry -->
```bash
poetry add index.toml
```
<!-- readme-standards:end installation.poetry -->

### Quick Start

#### Example

<!-- readme-standards:begin example.quick-start -->
Source: [examples/quick_start.py](https://github.com/groupsum/index.toml/blob/master/pkgs/070-facade/index.toml/examples/quick_start.py).

```python
from index_toml import loads

index = loads('schema_version = "1.0.0"\nlayers = []\npackages = []\n')
assert index["packages"] == []
```
<!-- readme-standards:end example.quick-start -->

#### Expected Result

The command or assertion in the quick-start example completes successfully.

---

## Usage

### Common Workflows

<!-- readme-standards:begin example.usage -->
Source: [examples/usage.py](https://github.com/groupsum/index.toml/blob/master/pkgs/070-facade/index.toml/examples/usage.py).

```python
from pathlib import Path
from tempfile import TemporaryDirectory

from index_toml import IndexFile

with TemporaryDirectory() as directory:
    index = IndexFile(Path(directory) / "index.toml")
    index.initialize()
    index.add_layer("core", order=10)
    index.add_package("demo", layer="core", order=0, path="packages/demo")
    assert index.get_package("demo")["path"] == "packages/demo"
```
<!-- readme-standards:end example.usage -->

### Configuration

Use the schema version declared by your index. Resolve package paths from the workspace root.

### Error Handling

Check validation exceptions or CLI exit codes before committing an index change.

### Best Practices

Use a read-only reconciliation check in CI and review sync previews before writing.

---

## Package Boundary

### What It Owns

The owning repository layer is facade. The root inventory identifies the package and its allowed dependencies.

### Public API and Import Surfaces

Use `index_toml.IndexFile`, `load`, `loads`, `check_workspace`, and `sync_workspace` in Python, or `index-toml` in a shell.

### Entry Points

<!-- readme-standards:begin entry-points -->
- `console_scripts` → `index-toml` → `index_toml.cli:main`
<!-- readme-standards:end entry-points -->

### Injected Dependencies

Use explicit paths when tooling runs outside the workspace root.

### Protocol Consumers

The reconciliation engine consumes the shared workspace adapter protocol.

### Extensions

A new ecosystem adapter implements normalized names, member discovery, and dependency edge reporting.

---

## Operations and Readiness

### Operational Requirements

Use a readable local checkout. Index mutation also requires write access to the index directory.

### Health and Observability

Inspect validation diagnostics and reconciliation differences to locate manifest drift.

### Security and Resource Limits

Use workspace paths you trust and review proposed writes before applying them.

### Compatibility

The Python distributions support CPython 3.10–3.15. The index reader accepts schema 1.0.0 and 1.1.0.

---

## Verification

### Tests

See the [linked test source](tests/test_index_toml_installed.py) and run the workspace suite with uv.

### Certification Status

Read the [SSOT release records](https://github.com/groupsum/index.toml/blob/master/.ssot/registry.json) for the assurance scope of each released version.

### Evidence

The [validation workflow](https://github.com/groupsum/index.toml/actions/workflows/validate.yml) records workspace, installed-artifact, and SSOT-linked results.

---

## FAQ

### Why

A package inventory gives CI a common view of package membership and declared relationships.

### How

Use the adapter that matches your native manifests and compare its discovery output with the inventory.

### When

Reconcile the inventory whenever package membership or local dependency edges change.

---

## Documentation and Related Packages

### More Documentation

[Schema and command guide](https://github.com/groupsum/index.toml/blob/master/docs/usage.md) · [Package inventory](https://github.com/groupsum/index.toml/blob/master/index.toml).

### Related Packages

The facade installs the CLI and core. The CLI installs the built-in adapters. The contracts package defines their shared types.

### Project Links

<!-- readme-standards:begin project-links -->
- [Documentation](https://github.com/groupsum/index.toml/blob/master/docs/usage.md)
- [Issues](https://github.com/groupsum/index.toml/issues)
- [Repository](https://github.com/groupsum/index.toml)
- [pypi: index.toml](https://pypi.org/project/index.toml/)
<!-- readme-standards:end project-links -->

---

## Contributing

### How to Contribute

Open a focused pull request with regression coverage for the behavior being changed.

### Development Setup

Install the locked uv workspace and run pytest from the repository root.

### Notes for Maintainers

Verify the hashes and clean registry installs of the artifacts selected for publication.

---

## Governance

### Ownership and Decision Making

The repository maintainers own package policy and review release scope.

### Standards and Policies

The root index owns package membership and layer policy. The SSOT registry owns decisions, claims, and test links.

### Lifecycle and Migration

Preview schema upgrades first. The tool still reads both supported schema versions.

---

## License and Attribution

### License

<!-- readme-standards:begin license -->
Licensed under `Apache-2.0`. See [LICENSE](https://github.com/groupsum/index.toml/blob/master/pkgs/070-facade/index.toml/LICENSE).
<!-- readme-standards:end license -->

### Notices

<!-- readme-standards:begin notices -->
See [NOTICE](https://github.com/groupsum/index.toml/blob/master/pkgs/070-facade/index.toml/NOTICE) for attribution.
<!-- readme-standards:end notices -->
