Skip to main content

likingInitiative — Python

CI DOI

The Liking Rating Database in Python: subjective liking ratings from published decision-making studies, as polars frames.

Install

pip install git+https://github.com/liking-initiative/likingInitiative-py

Requires Python 3.9 or newer. Data is downloaded from Zenodo on first use and cached locally; no account or token is needed.

Use

import likingInitiative

likingInitiative.list_datasets()                      # 59 datasets
likingInitiative.list_studies()                       # 38 studies
likingInitiative.list_items()                         # 2,217 stimuli

d = likingInitiative.get_dataset("leeholyoak2021")
d.data                                        # polars DataFrame
d.scale                                       # (1.0, 100.0)
d.timepoints                                  # [1, 2, 3]
print(d.cite())

likingInitiative.get_dataset(["leeholyoak2021", "leehare2023exp2"]).data   # stacked

One item across every study that used it

The cross-study view — the thing this database is built for:

k = likingInitiative.get_item("kitkat")     # 1,626 ratings across 25 datasets
k.by_dataset()                      # mean / sd / median per study, 0-1 scale

The whole corpus

db = likingInitiative.load_database()
db["ratings"]        # 759,399 rows

Two things to get right

Cross-study comparisons must use normalized_rating. Studies use different response scales (0–4, 1–100, 1–870, willingness-to-pay in dollars), so raw rating values are not comparable. normalized_rating is (rating − scale_min) / (scale_max − scale_min) and always lies in 0–1.

Subject ids are unique only within a dataset. Subject "12" in two datasets is two different people — key on (dataset_code, subject_id).

Repeated rating phases

Six datasets repeat the whole rating phase (chenhol1, chenhol2, crosswebb, hamesmcc, leehare2023exp2, leeholyoak2021), so (subject_id, item_id) alone is not unique for them:

d = likingInitiative.get_dataset("leeholyoak2021")        # phases 1, 2, 3
d.data.group_by("timepoint").agg(pl.col("normalized_rating").mean())

likingInitiative.get_dataset("leeholyoak2021", timepoint=2)   # one phase

get_item() uses each dataset's first phase only, so a repeated-phase study does not carry extra weight in a cross-study comparison.

Versions and caching

Data comes from versioned release files, not a live service, so a pinned version returns the same rows however long from now.

likingInitiative.release_info()          # version, date, counts, migrations applied
likingInitiative.get_dataset("leeholyoak2021", version="1.6.2")   # pin it
likingInitiative.cache_info();  likingInitiative.clear_cache()

Set LIKING_INITIATIVE_RELEASE_DIR to a directory built by scripts/build_release.py to work against an unreleased build.

API

Function Returns
list_studies() / list_datasets() / list_items() catalogue frames
get_dataset(code, version, timepoint) Dataset — .data, .metadata, .cite()
get_item(name, version) Item — .data, .by_dataset(), .cite()
load_database(version) dict of frames
cite(x) / bibtex(x) citation text
release_info() / cache_info() / clear_cache() housekeeping

Citation

Please cite the database and the studies whose data you use. cite() with no argument returns the database citation; cite(d) returns a study's.

Fernandez, K., Goyal, S., & Krajbich, I. (2026). The Liking Initiative: a database of subjective evaluation ratings for decision-making research [Data set]. Zenodo. https://doi.org/10.5281/zenodo.22216442

That is the concept DOI, which always resolves to the newest version. To name the exact bytes an analysis ran on, cite the version DOI that Zenodo lists for the version release_info() reports.

License

MIT. The underlying data remain subject to the terms of the original publications.

Metadata

Release files for likingInitiative 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for likingInitiative 0.2.1
File Size Uploaded
likinginitiative-0.2.1.tar.gz 16.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for likingInitiative 0.2.1
File Interpreter ABI Platform
likinginitiative-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 30.9 kB

Release files / likinginitiative-0.2.1.tar.gz

Download URL likinginitiative-0.2.1.tar.gz
Size 16.1 kB
Tags Source
SHA-256 checksum
How to use checksums
61726bcfa8bee4e2ac8249ed5bfa78554af97d8a920e7caef1de378d130927dc
BLAKE2b-256 checksum
How to use checksums
eacfcdd48ff25a6475fa7c57aa1cf659fe27453afd5f38da5410f8d7c15957c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 2, 2026.

Transparency log

Release files / likinginitiative-0.2.1-py3-none-any.whl

Download URL likinginitiative-0.2.1-py3-none-any.whl
Size 14.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
52a3793c013164903b60911a5fa831889697f23a7c7944fa73a20a09d18449bd
BLAKE2b-256 checksum
How to use checksums
8e9576957210e54f1e5c2815f62951f1ef400bce02480d05f605caff4534437c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 2, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.1 This release

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