Skip to main content

deped-entity

deped-entity turns validated Portal stakeholder rows into a versioned SQLite database of schools and governance entities. It applies shared value cleanup, records a build receipt, and provides a supported read-only reader.

deped-entity builds the canonical stakeholder entity artifact for DepEd data repositories. Package version 0.3.2 produces schema entities_v10 at artifacts/entities.db from the portal stakeholder_profile table.

Installed consumers use deped_entity.reader.load_reader() to validate the current or previous supported contract, database surfaces, and common build receipt before opening the artifact read-only.

The artifact preserves each admitted source row, derives shared entity identity, normalizes repeatable detail records, publishes current stakeholder and remoteness views, and records build provenance. Reporting marts, consumer-specific filters, authoritative geography, and ITO access policy stay with their owning repositories.

Start by task

The complete documentation starts at docs/index.md.

Standard workflow

just preflight
just build
just status --json
just audit

just download and just fetch explain that the raw source is owned by azure-db-extractor; they do not contact the network. Use just package only to build the Python distribution.

The default paths are:

Purpose Path
Portal source ../azure-db-extractor/data/portal.db
Generated artifact artifacts/entities.db

Set PORTAL_DB to use another portal database. To pass both paths explicitly:

uv run entity build \
  --portal-db ../azure-db-extractor/data/portal.db \
  --db artifacts/entities.db

uv run entity audit --db artifacts/entities.db

The build validates the source relation and its required snake_case columns, creates schema entities_v10 in a same-directory staging database, loads and checks the artifact, then atomically replaces the output. A failed build leaves the previous artifact intact. The audit opens an existing artifact read-only.

Public surfaces

Surface Use
entities Source-row identity, provenance, submitted geography, and transaction fields
entity_stakeholder_current Latest raw stakeholder row per natural_key
entity_remoteness_current Latest raw stakeholder row with explicit known/unknown remoteness evidence
school_remoteness_current One canonical school after reviewed school-ID aliases and evidence consolidation
detail and relation tables Normalized location, remoteness, community, contact, personnel, institution, road, and transport evidence
build_runs Source hash, row counts, schema version, and completion metadata

Consumer rules

  • Use entity_id only for joins inside entities.db; use natural_key across artifacts.
  • Use school_remoteness_current.school_id for school-grain remoteness joins. The view keeps contributing raw IDs in source_school_ids.
  • Treat missing detail rows and false _known fields as absent evidence, not a negative answer.
  • Treat psgc_code, longitude, and latitude as cleaned portal submissions. Canonical geography and coordinate review belong to deped-dataset and deped-maps.
  • Read ITO personnel and office-access surfaces from deped-hr.

Development

just test
just check

just check runs lint, formatting and ty checks through pre-commit, tests, and the Zensical docs build.

Shared-library development

The [tool.uv.sources] entries select sibling checkouts for this coordinated release; published packages retain versioned requirements. Keep the declared sibling repositories next to this checkout. Run uv sync --locked --all-extras, then pre-commit run --all-files and just check. Candidate distributions are also validated without editable sources before external publication.

Command environment

just publish uses op run --env-file=env.publish; only the upload process receives UV_PUBLISH_TOKEN. Package builds do not require vault access. Just does not load or generate .env. Export ordinary configuration overrides in your shell. Existing local .env files are not deleted automatically; move any needed overrides before removing old plaintext copies.

Without 1Password

For package publication, build with just package, then supply UV_PUBLISH_TOKEN from your secret manager or CI secret store to uv publish:

just package
uv publish

This requires publishing permission for the package. just publish still invokes op; use the direct command above when 1Password is unavailable.

Keep actual secrets out of reference files, committed files, and shell command history. Ordinary offline builds and checks do not require 1Password.

Metadata

Release files for deped-entity 0.3.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for deped-entity 0.3.6
File Size Uploaded
deped_entity-0.3.6.tar.gz 16.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for deped-entity 0.3.6
File Interpreter ABI Platform
deped_entity-0.3.6-py3-none-any.whl Python 3 none any Details

Total release size: 41.8 kB

Release files / deped_entity-0.3.6.tar.gz

Download URL deped_entity-0.3.6.tar.gz
Size 16.7 kB
Tags Source
SHA-256 checksum
How to use checksums
00c65b5832dcdc4aaf8420cf917337515ecc862d56fb70faebedf788c6259e5f
BLAKE2b-256 checksum
How to use checksums
a5084a2521db984ce19daec2abfff86609783a31f89151647d96920b0cc2233a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","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}

Release files / deped_entity-0.3.6-py3-none-any.whl

Download URL deped_entity-0.3.6-py3-none-any.whl
Size 25.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2564349616c890a84e99e4deb2e68a92c0acb8d1bf76431ebccf4bce196fb718
BLAKE2b-256 checksum
How to use checksums
394f412e16cc3a580676d765cf319dca023a0bd18d4a8a3cb86d45bf132a437a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","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}

Release history Release notifications | RSS feed

This release

0.3.6 This release

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.2.1

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page