deped-primitives
deped-primitives is the shared semantic contract layer for the DepEd data
ecosystem. It centralizes reusable rules for PSGC identity, administrative
hierarchies, boundaries, school vocabularies, access scopes, SQL construction,
provider context, metrics, and review helpers.
It is intentionally small. Producer repos own source ingestion and artifacts; consumer repos own products, notebooks, dashboards, and runtime state. This package owns the deterministic interpretation rules that those repos should not copy locally.
Quick Start
from deped_primitives.identity import GeoType, ancestor_codes, normalize_code
from deped_primitives.identity.codes import normalize_boundary_pcode_to_psgc_id
from deped_primitives.schools.names import clean_school_name
from deped_primitives.selection.access import AccessScope, scope_locks_from_access
assert normalize_code(" 13-3900-0000 ") == "1339000000"
assert ancestor_codes("1380610001", GeoType.BGY) == [
"1300000000",
"1380600000",
"1380610000",
]
assert normalize_boundary_pcode_to_psgc_id("PH0102801") == "0102801000"
assert clean_school_name("baliwag nhs") == "Baliwag National High School"
assert scope_locks_from_access(
AccessScope(level="regional", psgc_region_id="1300000000")
).locked_levels == ("region",)
Import specialized semantics from their owner modules rather than from the root package:
from deped_primitives.areas.boundaries import usable_area_boundary_components
from deped_primitives.authority.legislative import legislative_child_rollups
from deped_primitives.selection.providers import provider_context_sql
from deped_primitives.selection.navigation import build_territory_path
from deped_primitives.selection.search import SEARCH_TARGET_BY_KEY
Current shared semantics to check before copying local code:
deped_primitives.authority.governancefor DepEd source governance area IDs, canonical division authority ID grammar, division/school match keys, historical division-label aliases, and resolution/status vocabularies.deped_primitives.selection.providersanddeped_primitives.selection.provider_contractsfor school-keyed provider context and provider contract metadata.deped_primitives.selection.marimofor notebook region-group, territory, and area-scope controls. Usedeped-runtimefor CLI, SQLite, file, workbook, and other non-semantic runtime plumbing.deped_primitives.selection.navigationanddeped_primitives.selection.searchfor application-neutral territory paths, sibling semantics, Directory targets, and literal matching policy.
Documentation
- Overview explains the domain flow and reading path.
- Ecosystem explains sibling-repo ownership boundaries and what belongs in this package.
- Status is the current capability map.
- Package reference lists the curated package surface and owner-module references.
- Migration to 0.1 covers the current public import layout.
Development
pre-commit run --all-files
just check
Useful narrower commands:
just test
uv run zensical build
uv run --extra marimo marimo check notebooks/*.py
Release files for deped-primitives 0.11.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| deped_primitives-0.11.1.tar.gz | 141.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| deped_primitives-0.11.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 336.2 kB
Release files / deped_primitives-0.11.1.tar.gz
| Download URL | deped_primitives-0.11.1.tar.gz |
|---|---|
| Size | 141.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8c016abfbf7a4284dc854994029df12055840b19340bfafa71a661df300dcad1
|
|
BLAKE2b-256 checksum How to use checksums |
ab762e7d1d3817f4a6940bc348d89e7a2e999edfa0416508b6b66a7af60ad4a7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","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_primitives-0.11.1-py3-none-any.whl
| Download URL | deped_primitives-0.11.1-py3-none-any.whl |
|---|---|
| Size | 195.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8ff4baeebb7183e57e3a1f7d35a90b016ca173afca5b2459e71c3371d4cea81f
|
|
BLAKE2b-256 checksum How to use checksums |
4128e8da77eb122b7e1a395b810ff3b12a4b257602449fc1604abbadea3d6eb6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","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}
|