A simple tool to automatically update Slack user profile based on their Hackatime/Wakatime heartbeat!
Project description
HackaProfile
A simple tool to automatically update Slack (more platforms SOON) user profile based on their Hackatime/Wakatime heartbeat!
Features
- FULLY local (no data leaves your device except for the API calls to update profile)
- FULLY customizable (see the Place holder variables section)
- More features #TODO
(I don't wanna write README.md >:3)
installation
Install pipx
Check pipx docs
Install Hackaprofile
pipx install hackaprofile
hackaprofile setup
Setup
If you are deploying on a headless device (e.g. a VPS connected via ssh), use:
hackaprofile setup --headless
If you are deploying on your personal device, use:
hackaprofile setup
[!WARNING] Some environments (e.g. Ubuntu Server without GUI) does not have a default keyring service - which is required to safely store the > API keys. It is recommanded to install a third-party keyring service for these environments. For more info, click here
Headless Linux environments: install Gnome-keyring ''' sudo apt install gnome-keyring ''' Or other
[!TIP] No matter which setup you use, the Hackatime data source will be from the computer you are typing from. If you deployed this on a VPS, but you are coding on your PC and Hackatime is installed on it, the data source will be from your PC
Then follow the guided setup
Usage
Configure profile messages via hackaprofile config [platform name e.g. slack].
within the config file, you will see something like this:
# title =
# phone =
# real_name =
# display_name =
Uncomment the values you want to set, e.g:
# title =
# phone =
#real_name =
display_name =
Now you can set the value of this field (which corrosponds to the fields on Slack/the platform you are configuring). There are some useful placeholders and logic operators you could use (see below)
# title =
# phone =
#real_name =
display_name = Bob {% if language %}(Typing {{language}}...){% elif editor == "Slack" %}(Yapping on Slack) {% endif %}
Due to API rate limiting, there will be a ~20s delay between changing tasks (e.g. changing to a new language) and the status updating, this delay could be reduced by reducing the interval value in hackaprofile.conf (#TODO). However, doing so you are risking getting rate-limited. Find a balance.
You could refresh and see the new config in action by running hackaprofile restart - which restarts the background worker
Placeholder Variables
A key feature of HackaProfile is that it allows you to customise your profile however you like (just like how you would change it on Slack/other platforms) BUT it also allows you to use dynamic values (i.e. Placeholder variables).
Example
I am typing {{language}} in {{project}} project becomes I am typing Python in HackaProfile project
-{{id}} Some sort of Hackatime id, might be unique?
{{created_at}}When was the Hackatime data last fetched{{time}}Current time in Unix Timestamp{{category}}: Category of the Hackatime action- communicating
- ai coding
- coding
- writing docs
{{project}}Hackatime project name{{language}}Shows the current language that that you are working on{{editor}}Current IDE/Editor{{operating_system}}The current OS (N.B for MacOS, it showsdarwin){{entity}}Path to the file workng on{{machine}}Current machine's hostname
Logic Operators
You could not only dynamically set variables, but you could also *choose how they are represented dynamically
If Statements:
`{% if [condition] %} ... {% elif [condition] %} ... {% else %} ... {% endif %}
Filters:
Transforms the string to lowercase
{{string|lower}}
Transforms the STRING to UPPERCASE
{{string|upper}}
Transforms the String into a Title format
{{string|title}}
Escaping:
{{ "string to be escaped" }}
or
{% raw %}
string to be escaped
{% endraw %}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hackaprofile-1.3.2.tar.gz.
File metadata
- Download URL: hackaprofile-1.3.2.tar.gz
- Upload date:
- Size: 11.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a69b5911bc4702fdcab53c70a20b7ae333768abb82ac1b4296220294727b831
|
|
| MD5 |
62d96c2d614072b9c8bd4589d5d539e2
|
|
| BLAKE2b-256 |
9f81093d19ab2ce44cbee5f8c0c626f65ca2c2cd9adea35bcf9990cb56ae46f4
|
File details
Details for the file hackaprofile-1.3.2-py3-none-any.whl.
File metadata
- Download URL: hackaprofile-1.3.2-py3-none-any.whl
- Upload date:
- Size: 15.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76ca1a85c50ea58ff20cae2d21e7b2292a74ae8879189dbc5613b7f407df02c9
|
|
| MD5 |
adcc1e677e57c976da53c3ac54dbfb7e
|
|
| BLAKE2b-256 |
dbca5517692fba891271f3301d382e9d5542f548ff1e81ea49cacebb87bda8ac
|