Skip to main content
personality_questionnaire

Administer, score and record validated personality and affect questionnaires.

GitHub Release PyPI CI Coverage Docs
Python Code style: ruff License


What this is

Collecting validated self-reports is the unglamorous half of an affective-computing pipeline. This package administers published psychometric instruments, scores them correctly, and records every response with the provenance needed to reproduce the score months later.

It is built around one idea: an instrument is data, not code. Items, response ranges, subscale membership and reverse keys are declared as values; a single vectorised scorer turns responses into scores without knowing which questionnaire it is holding. Adding an instrument adds no arithmetic.

Instruments

Key Instrument Items Scale Scores
bfi2 Big Five Inventory-2 60 1–5 5 domains, 15 facets
bfi2-xs BFI-2 Extra-Short Form 15 1–5 5 domains
bfi10 Big Five Inventory-10 10 1–5 5 domains
vasf Visual Analogue Scale to Evaluate Fatigue Severity 18 0–10 Fatigue, Energy, composite

BFI-2 and BFI-2-XS: Soto & John (2017). BFI-10: Rammstedt & John (2007). VAS-F: Lee, Hicks & Nino-Murcia (1991). See docs/instruments.md for full citations and licence notes.

Quickstart

Score responses you already have:

pip install personality_questionnaire
import personality_questionnaire as pq

result = pq.score(pq.get("bfi2"), answers)  # answers: (n_participants, 60)
result.by_level("domain")  # {"openness": array([...]), ...}
result.as_dict()  # one participant, every subscale

Administer one at the terminal:

pq list                                  # what is available
pq info bfi2                             # items, subscales, citation
pq run bfi2 --participant P01            # ask the questions, score the answers
pq score bfi2 --input answers.csv        # score a file

How it works

flowchart LR
    I["instruments/<br/><i>pure data</i>"] --> R[registry]
    R --> S["scoring<br/><i>one vectorised scorer</i>"]
    S --> C[cli]
    S --> D[db]
    S --> U[ui]
Module Responsibility
registry.py Item, Subscale, Questionnaire — what an instrument is, plus validation
instruments/ One module per questionnaire. Data only, no arithmetic
scoring.py The single scorer: reverse-keying, subscale means, normalisation, pre/post deltas
io.py Reading and writing responses and scores
provenance.py Package version, git SHA, instrument hash for each record
cli/ pq list | info | run | score

Design decisions

Instruments are Python literals, not data files. A literal is checked by the type checker, validated at import, and present in the wheel by construction. A shipped CSV is checked by nothing until a participant has already answered every item — and the two scale files this repo used to carry were never read by any code path and misspelled neuroticism, which is exactly how unread data drifts.

Reverse-keying belongs to the subscale, not the item. The VAS-F scores its five energy items forward in Energy and reversed in Fatigue (composite), so a per-item mask cannot express both. The reflection is folded into a signed weight matrix, which also means every subscale at every level is computed by one matrix multiplication.

Both hierarchy levels are declared flat. The BFI-2's five domains and fifteen facets are siblings, each listing its own item numbers, rather than domains being composed from facets. The arithmetic is identical and the flat form scores both levels in a single pass.

Polarity is recorded as data. Every subscale carries a higher_is string, so no consumer has to infer direction from a name — the inference that produced the bug below.

Development

make dev          # install everything
make fix          # format and autofix
make check        # lint, type-check, test, docs -- mirrors CI
make check-ci     # the same, in a throwaway venv built like CI's

Tests are unittest under coverage, mirroring the package layout in tests/.

Related work

PersonalityLinMulT predicts perceived Big Five traits from video. This package sits on the other side of that problem: it collects self-reported ground truth, on the same [0, 1] scale and in the same openness, conscientiousness, extraversion, agreeableness, neuroticism column order, so an exported BFI-2 record drops into a self-report-versus-perception comparison. The two are deliberately uncoupled in code — this package has no ML dependencies.

Citation

@software{fodor_personality_questionnaire,
  author = {Fodor, Ádám},
  title  = {personality_questionnaire: administering and scoring validated psychometric instruments},
  url    = {https://github.com/fodorad/personality_questionnaire},
}

Contact

Download files

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

Source Distribution

personality_questionnaire-2.1.0.tar.gz (36.6 kB view details)

Uploaded Source

Built Distribution

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

personality_questionnaire-2.1.0-py3-none-any.whl (46.1 kB view details)

Uploaded Python 3

File details

Details for the file personality_questionnaire-2.1.0.tar.gz.

File metadata

File hashes

Hashes for personality_questionnaire-2.1.0.tar.gz
Algorithm Hash digest
SHA256 1d37b0eb43ee75d223546ff914e36c6580d9ea949ecbfa63d3442de9c571900d
MD5 fbbd4307c1a987c59b62f80f69fb7a40
BLAKE2b-256 099650f0f8d35f21226bf9893fa6a5314dabbd2f1c5231574ecffaf1a4faee81

See more details on using hashes here.

Provenance

The following attestation bundles were made for personality_questionnaire-2.1.0.tar.gz:

Publisher: cd.yml on fodorad/personality_questionnaire

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file personality_questionnaire-2.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for personality_questionnaire-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1bc653668abeaaafc4dbadd5e9d29c9e7a1a1fd19732c2e6d7684163416375ef
MD5 f6c82404b689e140f98d0b479fa7f5a2
BLAKE2b-256 ffee32d47b0634adc2ffc7dce3d106e873235fb7efc6b05daf865e55f310cfd3

See more details on using hashes here.

Provenance

The following attestation bundles were made for personality_questionnaire-2.1.0-py3-none-any.whl:

Publisher: cd.yml on fodorad/personality_questionnaire

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

2.7.0

2 files

2.6.0

2 files

2.5.0

2 files

2.4.1

2 files

2.4.0

2 files

2.3.0

2 files

2.2.0

2 files

This release

2.1.0 This release

2 files

2.0.0

2 files

1.1.2

2 files

1.1.1

2 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