Skip to content
/ hltb Public

HLTB Linear & Temporal Breakdown Scripts

License

Notifications You must be signed in to change notification settings

Vinfall/hltb

Repository files navigation

HLTB Linear & Temporal Breakdown

Intro

HowLongToBeat is a website that helps your track play times, which is also in collaboration with Microsoft to show approximate competition time for the Xbox app on PC. The best thing is you can export your records to a CSV file so you really own your data, instead of relying on a third party.

This is a linear and temporal data analysis & visualization based on the exported CSV using Python libraries, notably numpy, pandas and matplotlib, and only tested on GNU/Linux with Python 3.12.

Install

Tip

For a complete list of available commands, run make help.

It's really straightforward though:

# Clone repo
git clone https://github.com/Vinfall/hltb
cd hltb

# Set up venv and use
# NOTE: I assume you use virtualenv, if not,
# replace `virtualenv` with `python -m venv` in Makefile
make install
make run

# Clean up
make clean
make uninstall

Now you are good to go ahead.

Usage

  1. Export your HLTB data in options. Alternatively, you can use provided HLTB_Games_example.csv in example folder for tests.

  2. Run the scripts.

The following information may be useful to you:

  • hltb_sanitizer.py: sanitize exported data
    • Edit BLOCK_TAGS to excluded games with certain tags
    • Edit CUSTOM_TAGS to recognize your custom tab names
    • Change SCORE_MAX to 100 if you prefer Percentage System
  • hltb_analyzer.py: analyze sanitized data
    • Adjust MIN_TIMES to change the word frequency limit
    • Adjust DATE_COL if you don't always add a completion date
  • hltb_visualizer.py: generate a few ugly charts from sanitized data
    • Control plot behavior via SHOW_PLOT: patch CSV to meet the criteria of batchartrace
  • hltb_barchartrace.py
    • Adjust DATE_COL if you don't always add a completion date
  • debug.py: figure out the real line number of invalid lines, the one pandas reported is not trustworthy

That's it. You can find example charts and other information on my blog, or just read code comments.

GLWTPL (Good Luck With That Public License)