Skip to main content

Equipment cleaner extracted from the DepEd asset pipeline.

Project description

deped-equipment

deped-equipment cleans equipment CSV exports into a standalone SQLite database. It consumes three upstream artifacts: lookups.db from deped-template, entities.db from deped-entity, and personnel.db from deped-hr.

What This Package Owns

  • Equipment row cleaning and normalization
  • Canonicalization of equipment dimensions such as brand, model, unit, category, acquisition mode, and DCP year
  • Review-driven DCP attribution normalization layered on top of lookups.db
  • Review-driven equipment location normalization for classroom, lab, office, and other storage/use contexts
  • Review-driven supplier and disposition-status normalization for common vendor and asset-state variants
  • Entity import from the upstream entity artifact
  • Linking accountable personnel using a personnel snapshot artifact
  • Equipment views and dimension issue audits

This package owns the equipment database contract only.

Inputs And Outputs

Required inputs:

  • an equipment CSV export
  • a lookup database produced by deped-template
  • an entity database produced by deped-entity
  • a personnel database produced by deped-hr

Primary outputs:

  • equipment.db
  • equipment_dimension_issues.txt

The database stores normalized equipment rows plus canonical dimension tables seeded from the lookup artifact and reviewed dictionaries under src/deped_equipment/dictionaries/.

CLI

Build the equipment database:

uv run equipment build \
  --equipment data/equipment.csv \
  --lookups artifacts/lookups.db \
  --entities-db artifacts/entities.db \
  --personnel-db artifacts/personnel.db \
  --db artifacts/equipment.db

Run the lightweight audit command:

uv run --package deped-equipment deped-equipment audit \
  --db artifacts/equipment.db

Nuances

  • Entity loading is artifact-driven. This package imports entities from entities.db using the same upstream contract as deped-hr.
  • Personnel matching is artifact-driven. This package reads a snapshot from personnel.db and reuses shared helpers from deped-hr and deped-dcp-template where appropriate.
  • Link resolution uses multiple signals, including scoped employee counts and name matching. Ambiguous matches are preserved as ambiguous rather than guessed.
  • Equipment rows whose natural key is missing from the upstream entity artifact are flagged in equipment_dimension_issues.txt and skipped rather than aborting the build.
  • Dimension issues are treated as first-class audit output. Raw values that cannot be canonicalized cleanly are emitted to equipment_dimension_issues.txt.
  • DCP attribution is review-driven. Raw DCP Package values stay in dcp_package_raw, while approved canonical values resolve through equipment_dcp_attributions.
  • Equipment location is review-driven. Raw equipment_location values remain intact, while approved canonical groupings resolve through equipment_locations.
  • Only equipment-owned SQL assets live here now. Retired monolith views and unrelated tables were intentionally removed.

Tests

Run the package tests from this directory:

uv run pytest -q

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deped_equipment-0.1.0.tar.gz (78.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

deped_equipment-0.1.0-py3-none-any.whl (52.6 kB view details)

Uploaded Python 3

File details

Details for the file deped_equipment-0.1.0.tar.gz.

File metadata

  • Download URL: deped_equipment-0.1.0.tar.gz
  • Upload date:
  • Size: 78.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for deped_equipment-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b75d948255a76de2828b2e40a551791bec80e134352e5d82966804184435f20c
MD5 f276688a7fabb33954a5668b68003539
BLAKE2b-256 05ad920fab337954f7c7f6230a2d8bb958f90a36c736c6ae289722a8c7f08259

See more details on using hashes here.

File details

Details for the file deped_equipment-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: deped_equipment-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 52.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for deped_equipment-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7f2b3f93d8c7fa00695664a2678af63ff62041d74a6c87d2e435720aa73bc57d
MD5 54da3c75007df20ec2af14f75da3bc85
BLAKE2b-256 5f7cfaf81e7ef8c33e85c3a85e2663cb621f18df6fc2622667f9612ac8444b35

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page