Skip to main content

Github CI

deped-primitives

deped-primitives gives DepEd repositories one tested interpretation of shared codes, names, hierarchies, school attributes, filters, metrics, and review rules. Projects import the focused module they need instead of copying those rules locally.

Provider contracts can be consumed through ProviderOutputReader, which binds the producer identity and supported contract/schema window, resolves declared SQLite paths inside the provider repository, validates public relations and columns, delegates complete-receipt and selected output path/contract/hash verification to deped-runtime, and opens the output read-only.

The package covers Philippine Standard Geographic Code (PSGC) identity, administrative hierarchies, boundaries, school vocabulary, access scopes, Structured Query Language (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.governance for DepEd source governance area IDs, canonical division authority ID grammar, division/school match keys, historical division-label aliases, and resolution/status vocabularies.
  • deped_primitives.authority.policy for shared immutable-policy freezing, required text, and canonical PSGC-ID validation.
  • deped_primitives.selection.providers and deped_primitives.selection.provider_contracts for school-keyed provider context and provider contract metadata.
  • deped_primitives.selection.marimo for notebook region-group, territory, and area-scope controls. Use deped-runtime for CLI, SQLite, file, workbook, and other non-semantic runtime plumbing.
  • deped_primitives.selection.navigation and deped_primitives.selection.search for application-neutral territory paths, sibling semantics, Directory targets, and literal matching policy.

Documentation

  • DepEd Orchestrator shows where this shared library fits in the full workspace pipeline.
  • 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
just package

As a shared semantic library, Primitives has no repository-level data product: just build reports that boundary, while just package builds the Python distribution. just preflight, just status --json, and just audit provide the same read-only operating surface as the data repositories.

Useful narrower commands:

just test
uv run zensical build
uv run --extra marimo marimo check notebooks/*.py

Release files for deped-primitives 0.14.0

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-primitives 0.14.0
File Size Uploaded
deped_primitives-0.14.0.tar.gz 139.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for deped-primitives 0.14.0
File Interpreter ABI Platform
deped_primitives-0.14.0-py3-none-any.whl Python 3 none any Details

Total release size: 334.2 kB

Release files / deped_primitives-0.14.0.tar.gz

Download URL deped_primitives-0.14.0.tar.gz
Size 139.4 kB
Tags Source
SHA-256 checksum
How to use checksums
22cfa4a3db6f125b5cf4965a58112779b5a70a17ff42bd30498604497b55bf82
BLAKE2b-256 checksum
How to use checksums
c37e8e15f217029533d7804c592dd469798a5f39fc9f30d1af071e6647926e28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","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.14.0-py3-none-any.whl

Download URL deped_primitives-0.14.0-py3-none-any.whl
Size 194.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d18e2caf3b4cb21ed609c0ab5aa89c2c9b27349c18648faa328774833c424edb
BLAKE2b-256 checksum
How to use checksums
df8e9753ee00d7cec5c5dfcf960dda7d2716d05f810fcdc0b94199f839e37d7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","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

0.14.1

2 release files

This release

0.14.0 This release

2 release files

0.13.0

2 release files

0.11.0

2 release files

0.10.3

2 release files

0.10.2

2 release files

0.10.1

2 release files

0.10.0

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.0

1 release file

0.7.0

1 release file

0.6.1

1 release file

0.6.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

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