# deped-dcp-template

`deped-dcp-template` owns shared templates and cleaning semantics for DepEd DCP
data projects. It bundles the canonical v1.16 Excel collection templates,
extracts their controlled lists into SQLite lookup tables, and exposes
DCP-specific cleaners, catalogs, entity/personnel helpers, and staging models.

Version `0.9.0` is a breaking cutover. Generic operational plumbing now lives
in the sibling `deped-runtime` package; removed DCP utility modules and commands
have no compatibility aliases or re-exports.

## Install

```bash
uv add deped-dcp-template deped-runtime
```

Sibling checkouts use editable sources for `../deped-dcp-template`,
`../deped-primitives`, and `../deped-runtime`.

## Commands

```bash
uv run deped-dcp-template extract --templates-dir templates --output artifacts/base.db
uv run deped-dcp-template show --db artifacts/base.db
uv run deped-runtime r2 upload --source templates --prefix deped-dcp-template/templates --include 'ict-equipment-inventory-*-template_v1.16.xlsx'
uv run profile-table path/to/data.db table_name
```

The last two commands are provided by `deped-runtime`. Existing `just upload`,
`just download`, `just ls-r2`, and `just profile` recipe names are preserved.

## Ownership

This package retains:

- canonical workbook files and lookup extraction;
- DCP configuration, constants, controlled catalogs, and accepted timestamps;
- null/review normalization and DCP school, contact, email, position,
  equipment, and person cleaners;
- collection-loader compatibility helpers, staging models, `SourceArtifact`,
  and legacy DCP dataset-loader orchestration;
- template-specific R2 asset metadata.

`deped-runtime` owns file/CSV/Excel/OOXML handling, console/progress output,
hashing, SQL and SQLite mechanics, source/frame readers, R2 transfers, and
profiling. Consumer repos continue to own ingestion policy, domain schemas,
promotion, and final artifact contracts.

`deped-primitives` owns ecosystem-wide DepEd identities and interpretation,
including canonical school-ID tokens and EBEIS rule semantics. The
similarly-named `deped_dcp_template.cleaners.normalize_school_id` remains only
as an integer-coercing compatibility helper for established collection loaders.

## Documentation and checks

- [Docs index](docs/index.md)
- [Architecture](docs/architecture.md)
- [Lookup extraction](docs/lookup-extraction.md)
- [Normalization](docs/normalization.md)
- [Dataset loaders](docs/dataset-loaders.md)
- [Downstream adoption](docs/downstream-adoption.md)

```bash
uv run pytest -q
uv run zensical build
```
