Metadata-Version: 2.4
Name: deped-dcp-template
Version: 0.9.0
Summary: Shared templates and cleaning semantics for DepEd DCP data packages.
Requires-Python: >=3.14
Requires-Dist: click>=8.4
Requires-Dist: deped-primitives>=0.11
Requires-Dist: deped-runtime[excel,polars,r2]>=0.5
Requires-Dist: email-validator>=2.3
Requires-Dist: environs>=15.0
Requires-Dist: fastexcel>=0.20.2
Requires-Dist: openpyxl>=3.1.5
Requires-Dist: polars>=1.42
Requires-Dist: pydantic-settings>=2.14.0
Requires-Dist: pydantic>=2.13.0
Requires-Dist: rich>=15.0
Requires-Dist: sqlite-utils>=4.1
Description-Content-Type: text/markdown

# 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
```
