Skip to main content

A Python package to cluster and visualize data from open card sorting tasks

Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public. PyPI GitHub Workflow Status (with event) Read the Docs Python Codecov DOI pyOpenSci All Contributors

Cardsort helps UX researchers quickly analyse data from open card sorting exercises using hierarchical cluster analysis. This task helps to understand how people organize information, and is frequently used to develop information architectures for websites. Click here to learn more about the card sorting method.

More precisely, cardsort helps you to:

  • Create distance matrices using hierarchical cluster analysis
  • Create dendrograms from based on these matrices
  • Extract user-generated category-labels
  • Using data exports from kardsort.com

Table of Contents

Documentation

cardsort.readthedocs.io

Quick start

Installation

$ pip install cardsort

Usage

cardsort can be used to create dendrograms and extract user-generated category-labels:

from cardsort import analysis
import pandas as pd

path = "example-data.csv" # data with columns: card_id, card_label, category_id, category_label, user_id
df = pd.read_csv(path) 

The data used in this example can be found under /docs/example-data.csv.

Create a dendrogram that summarizes user-generated clusters

analysis.create_dendrogram(df)

Output

Dendrogram plot generated from example data

Learn which category labels users gave to clusters

cards = ['Banana', 'Apple']
analysis.get_cluster_labels(df, cards)

Output

  user_id   cluster_label                                              cards
0       2  Healthy snacks                                    [Banana, Apple]
1       3          Snacks     [Sandwich, Croissant, Banana, Mooncake, Apple]
2       4          Fruits                                    [Apple, Banana]
3       5            Food  [Banana, Croissant, Apple, Sandwich, Hot Dog, ...

Interpretation: In this case, the users with IDs 2 and 4 made clusters containing exactly the two cards of interest ('Banana' and 'Apple', as specified in the input variable 'cards'). User 2 labelled this cluster 'Healthy snacks', and user 4 'Fruits'. Users 3 and 5 also clustered these cards together, but they included additional other cards in the same cluster, and labelled the cluster 'Snacks' or 'Food'. User 1 does not appear in the output, because they did not cluster the cards together.

Accepted data

  • This package works with data exports from kardsort.com (Export format 'Casolysis Data (.csv) - Recommended') or other data following the same structure.
  • Columns: card_id, card_label, category_id, category_label, user_id

Advanced usage

See documentation

Project information

License

cardsort is licensed under the of the MIT license.

Contributing

Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.

Citation

If you want to cite cardsort, please use the following DOI: DOI

Credits

cardsort was created with cookiecutter and the py-pkgs-cookiecutter template.

Contributors

Thanks goes to these wonderful people (emoji key):

Katharina Kloppenborg
Katharina Kloppenborg

💻 🤔 📖 🎨 📆 🔬
Bastian Greshake Tzovaras
Bastian Greshake Tzovaras

🔍 💻 🤔 🧑‍🏫
Alex Batisse
Alex Batisse

👀 🤔
Semidán Robaina
Semidán Robaina

👀 🤔
khynder
khynder

👀 🤔

This project follows the all-contributors specification. Contributions of any kind welcome!

Metadata

Release files for cardsort 0.2.45

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

Source distribution (sdist)

Source distribution for cardsort 0.2.45
File Size Uploaded Provenance Actions
cardsort-0.2.45.tar.gz 8.0 kB Without provenance Details for cardsort-0.2.45.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cardsort 0.2.45
File Interpreter ABI Platform Actions
cardsort-0.2.45-py3-none-any.whl Python 3 none any Details for cardsort-0.2.45-py3-none-any.whl

Total release size: 16.4 kB

Release files / cardsort-0.2.45.tar.gz

Download URL cardsort-0.2.45.tar.gz
Size 8.0 kB
Tags Source
SHA-256 checksum
How to use checksums
859a1a410665112f36aefecf7237328987dfa6b25e10cc0cc3ea8d4b1b13a92e
BLAKE2b-256 checksum
How to use checksums
71671f0d8b96d4a494b7821aaece6b99b53540d6f1c2744449c628402af3f3f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.8

Release files / cardsort-0.2.45-py3-none-any.whl

Download URL cardsort-0.2.45-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cc7b39653fbf0d8ebfe3cc21e20455fb0464a356ba749f1f85e39df632128f1a
BLAKE2b-256 checksum
How to use checksums
588d852e77e3e715c6b581d73d41eaa5da6d80cfd223a789248f4f77cd970128
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.8

Security for cardsort 0.2.45

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.45 This release

2 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