Skip to main content

Gil (Python — iyulab-gil)

Gil answers the decided attributes of a record from the records people have already settled, and chooses — by replaying them in the order they were settled — how far each answer can be trusted and how often a trusted one will be right.

This package binds its Rust decision core: replay settled records to choose how far each layer's answers for a schema attribute can be trusted, and get back the decision records the choice rests on.

pip install iyulab-gil
import gil

schema = gil.Schema.from_dict(
    {
        "name": "ticket",
        "attributes": [
            {"name": "product", "role": "observed"},
            {"name": "summary", "role": "observed"},
            {"name": "team", "role": "decided"},
        ],
    }
)
records = gil.read_records(
    "settled.jsonl"
)  # one JSON object per line, in settlement order
thresholds, decisions = gil.select_layers(
    schema, "team", records, target_precision=0.8
)
print(thresholds["key"]["chosen"], len(decisions))

Before choosing thresholds, narrow the attributes that key the decided attribute. An attribute that happened to settle with one value for a while would otherwise key every later record that shares it:

choice = gil.select_key_fields(schema, "team", records, target_precision=0.8, minimum_answered=30)
definition = {
    "name": "ticket",
    "attributes": [
        {"name": "product", "role": "observed"},
        {"name": "summary", "role": "observed"},
        {"name": "team", "role": "decided", "key_fields": choice["key_fields"]},
    ],
}
thresholds, decisions = gil.select_layers(
    gil.Schema.from_dict(definition), "team", records, target_precision=0.8
)

key_fields is None when no narrower set did better than every attribute — leave it unset then.

The other settings follow the same pattern — choose, then set on the attribute: select_key_concentrations (set as key_concentrations, after key_fields) and, for an attribute with a coarse level ("coarse": {"prefix": 2}), select_coarse once its value thresholds are set.

Status: early. The API may change within 0.x — each change is listed in CHANGELOG.md with what to do about it.

Apache-2.0 — see LICENSE.

Metadata

Release files for iyulab-gil 0.4.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 iyulab-gil 0.4.0
File Size Uploaded Provenance
iyulab_gil-0.4.0.tar.gz 78.5 kB Without provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for iyulab-gil 0.4.0
File
iyulab_gil-0.4.0-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details
iyulab_gil-0.4.0-cp311-abi3-musllinux_1_2_x86_64.whl CPython 3.11 abi3 Linux musl 1.2+ x86-64 Details
iyulab_gil-0.4.0-cp311-abi3-manylinux_2_28_x86_64.whl CPython 3.11 abi3 Linux glibc 2.28+ x86-64 Details
iyulab_gil-0.4.0-cp311-abi3-manylinux_2_28_aarch64.whl CPython 3.11 abi3 Linux glibc 2.28+ ARM64 Details
iyulab_gil-0.4.0-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details
iyulab_gil-0.4.0-cp311-abi3-macosx_10_12_x86_64.whl CPython 3.11 abi3 macOS 10.12+ x86-64 Details

Total release size: 4.2 MB

Release files / iyulab_gil-0.4.0.tar.gz

Download URL iyulab_gil-0.4.0.tar.gz
Size 78.5 kB
Tags Source
SHA-256 checksum
How to use checksums
483b4fe73c866377f22a959475d40963bb31e043227e8e6e490010a5192f8d45
BLAKE2b-256 checksum
How to use checksums
033aebdeb94b5be7bbe7afe99d3b53be78addf6cce4ae05ec3cc441487805438
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / iyulab_gil-0.4.0-cp311-abi3-win_amd64.whl

Download URL iyulab_gil-0.4.0-cp311-abi3-win_amd64.whl
Size 540.7 kB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
f4d2220119dd596c86d8d320eeb4b474f68a5ee157f457589516706f46cf28b3
BLAKE2b-256 checksum
How to use checksums
f38a9328ae745143ef790e549643f1c2736bdd4bb6b8f6b3d0142c43bd1af4f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / iyulab_gil-0.4.0-cp311-abi3-musllinux_1_2_x86_64.whl

Download URL iyulab_gil-0.4.0-cp311-abi3-musllinux_1_2_x86_64.whl
Size 917.4 kB
Tags CPython 3.11 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
77708f260902d7577e25bdb4716b7bfd58fda2cae2b6c0a319f659760223d20e
BLAKE2b-256 checksum
How to use checksums
e67d978d0c07597f6738b0154d094be97a4afeb99ba75a14fa18e8d8a4bae9e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / iyulab_gil-0.4.0-cp311-abi3-manylinux_2_28_x86_64.whl

Download URL iyulab_gil-0.4.0-cp311-abi3-manylinux_2_28_x86_64.whl
Size 713.2 kB
Tags CPython 3.11 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
675dddea98654365fe13f4fe4e099722724bca108f872479313706e09276e402
BLAKE2b-256 checksum
How to use checksums
7d4db0007a05ca26d48ab721cfd40605f4c856481d4a01bfaa3c2672ca213374
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / iyulab_gil-0.4.0-cp311-abi3-manylinux_2_28_aarch64.whl

Download URL iyulab_gil-0.4.0-cp311-abi3-manylinux_2_28_aarch64.whl
Size 673.6 kB
Tags CPython 3.11 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
e0a9b938f897695c63c0c664fbad1d2a7c518f009c27cdab3784043875cc676e
BLAKE2b-256 checksum
How to use checksums
e2f1d97053e8df13008c8ada52a2f272d3acbdd9ad915b85f29f4614aab0742b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / iyulab_gil-0.4.0-cp311-abi3-macosx_11_0_arm64.whl

Download URL iyulab_gil-0.4.0-cp311-abi3-macosx_11_0_arm64.whl
Size 626.8 kB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
75466f3a6ed5f6a83e4efea272844da8dcf483db3aa6742dfed366beacae2089
BLAKE2b-256 checksum
How to use checksums
49e6cdb2180c42937ec9c03213bde63c7cc01ed4e423d751986d420f62163e57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / iyulab_gil-0.4.0-cp311-abi3-macosx_10_12_x86_64.whl

Download URL iyulab_gil-0.4.0-cp311-abi3-macosx_10_12_x86_64.whl
Size 662.2 kB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
974c0d1da958a28b1a2fd6ac332dc4625db1090e18ab76f87a056d449ec9f7e6
BLAKE2b-256 checksum
How to use checksums
5639b3a0300e28e54a0e96cd9f266ee69a4ed0be69fbf639d48eec3f73785473
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for iyulab-gil 0.4.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Release history Release notifications | RSS feed

This release

0.4.0 This release

7 release files No provenance

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