This release is a pre-release and may not be stable for production use.
compehndly (Python)
Architecture (Polars-First)
This package now follows a two-layer execution model for derived variables:
compehndly.polars.kernels
- Polars-native series kernels for external
map_batchesusage. - Contract:
kernel(*series: pl.Series, **params) -> pl.Series
compehndly.polars.adapters
- Frame adapters that apply kernels to:
polars.DataFrame(eager kernel path)polars.LazyFrame(expression path)
Public Entry Points
External integrations (already have a lazy orchestrator like apply_map):
from compehndly import get_map_fn
map_fn = get_map_fn("summation", all_required=True)
For config/YAML path-based loading, use stable wrappers in compehndly.entrypoints:
map_fn: compehndly.entrypoints.summation
# or
map_fn: compehndly.entrypoints.normalize_specific_gravity
Direct usage (you want this package to add a derived column):
from compehndly import with_derived_column
out = with_derived_column(
frame=df_or_lf,
function_name="summation",
input_columns=["a", "b"],
output_column="sum_col",
all_required=True,
)
# For non-commutative functions use a named mapping
out = with_derived_column(
frame=df_or_lf,
function_name="normalize_specific_gravity",
input_columns={"measured": "measurement_col", "sg_measured": "sg_col"},
output_column="normalized",
sg_ref=1.024,
)
Discover available functions:
from compehndly import list_functions
print(list_functions())
Direct series/expression application:
from compehndly import apply
out_series = apply("summation", df["a"], df["b"], all_required=False)
out_expr = apply("summation", pl.col("a"), pl.col("b"), all_required=False)
# Named data kwargs are supported
out_named = apply(
"normalize_specific_gravity",
measured=df["measured"],
sg_measured=df["sg_measured"],
sg_ref=1.024,
)
# Flexible kwargs-only fallback order
out_coalesced = apply(
"coalesce_by_priority",
primary=df["primary"],
secondary=df["secondary"],
fallback=df["fallback"],
priority=("primary", "secondary", "fallback"),
)
Current Scope
The pattern is applied to:
derived_variables.summationderived_variables.correctionderived_variables.imputation
Cross-Language Conformance
Shared test vectors live in:
shared/conformance/derived_variables_cases.json
Python and R should both execute this same file to verify parity. The Python runner is in:
python/tests/test_conformance_shared_vectors.py
Contributor Workflow (Two Steps)
Add one module in compehndly.derived_variables and do only:
- Implement one kernel:
def my_kernel(*series: pl.Series, scalar_a: float, ...) -> pl.Series
- Implement one expression builder:
def my_expr(*exprs: pl.Expr, scalar_a: float, ...) -> pl.Expr
Then expose one of:
FUNCTION_SPEC = DerivedFunctionSpec(
name="my_function",
kernel=my_kernel,
expr_builder=my_expr,
)
FUNCTION_SPECS = [
DerivedFunctionSpec(...),
DerivedFunctionSpec(...),
]
compehndly.api auto-discovers FUNCTION_SPEC / FUNCTION_SPECS, so there
is no central registry file to edit.
No per-function adapter wrappers are required.
Metadata
Release files for compehndly 0.0.1a4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| compehndly-0.0.1a4.tar.gz | 16.2 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| compehndly-0.0.1a4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 36.6 kB
Release files / compehndly-0.0.1a4.tar.gz
| Download URL | compehndly-0.0.1a4.tar.gz |
|---|---|
| Size | 16.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
813d030ee779a3fe5f0a3d6f332ebdaabd68290fc2d082a823d41fc9f1a4ac52
|
|
BLAKE2b-256 checksum How to use checksums |
c44191ee0b2b207a08e2409a7994f69bc02a86a6acc2a31757ea2d9d8aad4aaa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 9, 2026.
Transparency logRelease files / compehndly-0.0.1a4-py3-none-any.whl
| Download URL | compehndly-0.0.1a4-py3-none-any.whl |
|---|---|
| Size | 20.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
165b1eac69eb5747f19fc5c69e1ccf22e7adc0c59e9f90ca6df0f772147e50f7
|
|
BLAKE2b-256 checksum How to use checksums |
e42ef65e04eabe26018a1860061211b97686b0f4c73787355ec8005e01dd69d9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 9, 2026.
Transparency logSecurity for compehndly 0.0.1a4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for compehndly-0.0.1a4.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 9, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.