Metadata-Version: 2.4
Name: clearmetric-core
Version: 0.2.0
Summary: ClearMetric Core — local compiler, graph engine, and CLI foundation.
Author: ClearMetric Labs
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/ClearMetric-Labs/ClearMetric-Core
Project-URL: Source, https://github.com/ClearMetric-Labs/ClearMetric-Core
Project-URL: Issues, https://github.com/ClearMetric-Labs/ClearMetric-Core/issues
Keywords: catalog,lineage,metadata,graph,sql,dbt,powerbi,analytics
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Database
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: pydantic>=2.10.0
Requires-Dist: sqlglot>=25.0.0
Requires-Dist: pbi-parsers>=0.9.5
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: PyYAML>=6.0; extra == "dev"
Provides-Extra: release
Requires-Dist: build>=1.2.2; extra == "release"
Requires-Dist: twine>=5.1.1; extra == "release"

# clearmetric-core

One PyPI package. All ClearMetric Core modules (`clearmetric.core`, `.lineage`,
`.query`, `.powerbi`, `.cli`) ship inside this distribution.

## Install

```bash
python -m pip install clearmetric-core
```

## CLI

```bash
cm compile ./manifest.json --dialect postgres
cm impact orders.amount ./manifest.json --dialect postgres --upstream
```

If `cm` is occupied on your PATH:

```bash
python -m clearmetric.cli compile ./manifest.json --dialect postgres
```

## Modules

| Module | Purpose |
|--------|---------|
| `clearmetric.core` | Artifact schema, canonical IDs, merge, cross-graph interop |
| `clearmetric.lineage` | Project-level SQL lineage from dbt manifests and SQL folders |
| `clearmetric.query` | Single-statement SQL structure mapping |
| `clearmetric.powerbi` | PBIP file lineage and warehouse merge |
| `clearmetric.cli` | `cm` command router |

## Imports

```python
from clearmetric.core import (
    CatalogArtifact,
    Edge,
    Evidence,
    Node,
    Warning,
    load_table_alias_map,
    merge,
    resolve_table_match,
)
from clearmetric.lineage import build_catalog_artifact, trace_upstream
```

For local development:

```bash
python -m pip install -e ".[dev,release]"
```

## Contract

The source of truth for the shared artifact contract is
[`docs/contract.md`](docs/contract.md).
