HPI
Human Programming Interface - a way to unify, access and interact with all of my personal data [my modules]
Install / Use
/learn @purarue/HPIREADME
TLDR: I'm using HPI(Human Programming Interface) package as a means of unifying, accessing and interacting with all of my personal data.
It's a Python library (named my), a collection of modules for:
- social networks: posts, comments, favorites, searches
- shell/program histories (zsh, bash, python, mpv, firefox)
- programming (github/commits)
- instant messaging
- media histories (movies, TV shows, music, video game achievements/history); see https://purarue.xyz/feed/
This is built on top of karlicoss/HPI. These are all additional modules which aren't present in that repository - this is installed alongside the upstream repository (meaning you can use both modules from upstream and here simultaneously), see #install
My Modules
my.zshandmy.bash, access to my shell history w/ timestampsmy.mail.imapandmy.mail.mboxto parse local IMAP sync's of my mail/mbox files -- see doc/MAIL_SETUP.mdmy.mpv.history_daemon, accesses movies/music w/ activity/metadata that have played on my machine, facilitated by a mpv history daemonmy.discord.data_export, parses ~1,000,000 messages/events from the discord data export, parser heremy.todotxt.activeto parse my current todo.txt file;my.todotxt.git_historytracks my history using backups of those files ingit_doc_historymy.rss.newsboat, keeps track of when I added/removed RSS feeds (fornewsboat)my.ipython, for timestamped python REPL historymy.ttt, to parse shell/system history tracked bytttmy.activitywatch.active_window, to parse active window events (what application I'm using/what the window title is) usingwindow_watcherand activitywatch on androidmy.chess.export, to track my chess.com/lichess.org games, usingchess_exportmy.trakt.export, providing me a history/my ratings for Movies/TV Show (episodes) usingtraktexportmy.listenbrainz.export, exporting my music listening history from ListenBrainz (open-source Last.fm) usinglistenbrainz_exportmy.offline.listens, for offline music listen history, using offline_listensmy.mal.export, for anime/manga history usingmalexportmy.grouvee.export, for my video game history/backlog usinggrouvee_exportmy.runelite.screenshots, parses data from the automatic runelite screenshotsmy.minecraft.advancements, parses advancement (local achievement data) from the~/.minecraftdirectorymy.project_euler, when I solved Project Euler problemsmy.linkedin.privacy_export, to parse the privacy export from linkedinmy.scramble.historyfor merged (timed) rubiks cube solves from multiple sources, using scramble_history
'Historical' Modules
These are modules to parse GDPR exports/data from services I used to use, but don't anymore. They're here to provide more context into the past.
my.apple.privacy_export, parses Game Center and location data from the apple privacy exportmy.facebook.gdpr, to parse the GDPR export from Facebookmy.league.export, gives League of Legends game history usinglolexportmy.steam.scraper, for steam achievement data and game playtime usingsteamscrapermy.piazza.scraper, parsing piazza (university forum) posts usingpiazza-scrapermy.blizzard.gdpr, for general battle.net event data parsed from a GDPR exportmy.skype.gdprto parse a couple datetimes from the Skype GDPR export (seems all my data from years ago is long gone)my.spotify.gdpr, to parse the GDPR export from Spotify, mostly to access songs from my playlists from years agomy.twitch, merging the data export and my messages parsed from the overrustle logs dump
See here for my HPI config
Promnesia Sources for these HPI modules
I also have some more personal scripts/modules in a separate repo; HPI-personal
In-use from karlicoss/HPI
my.browser, to parse browser history usingbrowserexportmy.google.takeout.parser, parses lots of (~500,000) events (youtube, searches, phone usage, comments, location history) from google takeouts, usinggoogle_takeout_parsermy.coding.commitsto track git commits across the systemmy.githubto track github events/commits and parse the GDPR export, usingghexportmy.reddit, get saved posts, comments. Usesrexportto create backups of recent activity periodically, andpushshiftto get old comments.my.smscalls, exports call/sms history using SMS Backup & Restoremy.stackexchange.stexport, for stackexchange data usingstexport
Partially in-use/with overrides:
my.location, though since I also have some locations fromapple.privacy_export, I have amy.location.applewhich I then merge intomy.location.allin my overriddenall.pyfile on my personal repo- similarly, I do use
my.ipandmy.location.via_ipfrom upstream, but I have overriddenall.pyand module files here
'Overriding' an all.py file means replacing the all.py from upstream repo (this means it can use my sources here to grab more locations/ips, since those don't exist in the upstream). For more info see reorder_editable, and the module design docs for HPI, but you might be able to get the gist by comparing:
- my.location.all in
karlicoss/HPI - my.location.all in
purarue/HPI-personal
Since I've mangled my PYTHONPATH (see reorder_editable), it imports from my repo instead of karlicoss/HPI. all.py files tend to pretty small -- so overriding/changing a line to add a source is the whole point.
See here for an explanation of how that works.
Companion Tools/Libraries
Disregarding tools which actively collect data (like ttt/window_watcher) or repositories which have their own exporter/parsers which are used here, there are a couple other tools/libraries I've created for this project:
ipgeocache- for any IPs gathered from data exports, provides geolocation info, so I have partial location info going back to 2013sqlite_backup- to safely copy/backup application sqlite databases that may currently be in usegit_doc_history- a bash script to copy/backup files into git history, with a python library to help traverse and create a history/parse diffs between commitsHPI_API- automatically creates a JSON API/server for HPI modulesurl_metadata- caches youtube subtitles, url metadata (title, description, image links), and a html/plaintext summary for any URL
I also use this in my_feed, which creates a feed of media/data using HPI, live at https://purarue.xyz/feed/
Ad-hoc and interactive
Some basic examples.
When was I most using reddit?
import collections, my.reddit.all, pprint
pprint.pprint(collections.Counter([c.created.year for c in my.reddit.all.comments()]))
Counter({2016: 3288, 2017: 801, 2015: 523, 2018: 209, 2019: 65, 2014: 4, 2020: 3})
Most common shell commands?
import collections, pprint, my.zsh
# lots of these are git-related aliases
pprint.pprint(
collections.Counter([c.command for c in my.zsh.history()]).most_common(10)
)
[
("ls", 51059),
("gst", 11361),
("ranger",
Related Skills
node-connect
343.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
92.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
343.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
343.3kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
