Skip to main content

AbleVLabs tools. Includes lana, a weighted record-comparison engine that weighs two records attribute by attribute and tells you which wins.

Project description

ablevlabs

Python tools by AbleVLabs. The first tool in the package is lana.


lana — Logical Attribute Node Aligner

Point lana at two records and it weighs them attribute by attribute, then tells you which one wins. It works on anything with comparable fields — job candidates, products, ML model runs, vehicles, portfolios, game characters.

Unlike a diff tool (which tells you what changed between two versions of the same thing), lana is a matchup tool: it relates two distinct records and renders a weighted verdict based on the fields you decide matter most.

Install

pip install ablevlabs

Optional, for the DataFrame export:

pip install "ablevlabs[pandas]"

Quick start

from ablevlabs import lana

laptop_a = {"name": "Aero 14",  "price": 1200, "ram_gb": 16, "battery_hrs": 10}
laptop_b = {"name": "Vortex 15", "price": 1500, "ram_gb": 32, "battery_hrs": 8}

result = lana.compare(
    laptop_a, laptop_b,
    priority={"ram_gb": 5, "battery_hrs": 2, "price": 2},  # 1-5: how much each matters
    lower_better=["price"],                                # cheaper wins
)

lana.show(result)
  Aero 14  vs  Vortex 15
  --------------------------------------------------
  battery_hrs           10 <-- 8          (priority 2)
  name             Aero 14 !=  Vortex 15
  price               1200 <-- 1500       (priority 2)
  ram_gb                16 --> 32         (priority 5)
  --------------------------------------------------
  OVERALL: Vortex 15 wins   (Aero 14 44.4%  /  Vortex 15 55.6%)

The Aero wins two fields (battery, price) — but they're lower priority. The Vortex wins only RAM, but RAM is rated 5, and that one high-priority win carries the verdict. That is the whole point of lana.

How the verdict works

Each field you list in priority is rated 1–5 (1 = barely matters, 5 = matters most). Whichever record wins a field takes its full priority points; a tie splits them. The record with more total points wins overall. The per-field margins are shown as delta, but they do not secretly sway the verdict — winning a field is winning a field.

compare() options

Argument What it does
a, b The two records (dicts). Required.
name_a, name_b Labels for the output. If omitted, lana reads a name/model/id field, else uses A/B.
priority {field: 1-5} — how much each numeric field counts toward the winner.
lower_better List of fields where a smaller number wins (price, latency, weight).
aliases {variant: canonical} to reconcile differing field names between records.

Getting the result out

compare() returns a plain dict. From there:

lana.show(result)         # readable scorecard (terminal)
lana.to_json(result)      # JSON string
lana.to_csv(result)       # CSV string (Excel / Sheets)
lana.to_markdown(result)  # Markdown table (docs / GitHub)
lana.to_df(result)        # pandas DataFrame (needs pandas)

lana.save(result, "out.json")   # format chosen from the extension
lana.save(result, "out.csv")
lana.save(result, "out.md")

Nested fields

If a field holds a dict, lana compares inside it — shared keys get a winner, and keys unique to one side are flagged:

a = {"stats": {"hp": 100, "atk": 20}}
b = {"stats": {"hp": 80,  "atk": 30, "def": 5}}
lana.show(lana.compare(a, b, "A", "B"))

Guardrails

  • priority values must be 1–5; anything else raises a clear ValueError.
  • Misspelled priority/lower_better field names emit a warning instead of silently doing nothing.
  • Booleans are treated as text, not numbers (so True/False aren't scored as 1/0).

License

MIT © AbleVLabs

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ablevlabs-0.1.0.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ablevlabs-0.1.0-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file ablevlabs-0.1.0.tar.gz.

File metadata

  • Download URL: ablevlabs-0.1.0.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for ablevlabs-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c8ab6c6933de2c50a9b27a937995fb41feb0406c8b6c61a285eaa4590276ed0d
MD5 bb2b94d1d9837948f8cb3640bb8ba580
BLAKE2b-256 b3bc3c8f9a677e26f68fe95868583e7d7116914876a8d17a68e1c34c42458d31

See more details on using hashes here.

File details

Details for the file ablevlabs-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ablevlabs-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for ablevlabs-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a094e04469f44792029518909d3bf98c6c541f6f14c408812601e8422ffe75fd
MD5 51366b6d08d43ce6f10fa81d24b5b333
BLAKE2b-256 72dede35d511d1760d8d82f807c0831c2da68bc47a81aef94f67fd83994e8f94

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page