Skip to main content

A simple tool to automatically update Slack user profile based on their Hackatime/Wakatime heartbeat!

Project description

HackaProfile

HackaProfile logo

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

[!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 shows darwin)
  • {{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

hackaprofile-1.3.1.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

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

hackaprofile-1.3.1-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

Details for the file hackaprofile-1.3.1.tar.gz.

File metadata

  • Download URL: hackaprofile-1.3.1.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for hackaprofile-1.3.1.tar.gz
Algorithm Hash digest
SHA256 2bdfa9ec1caa1cca887670fa48e820fb508cbc747146fff95e6c24269d950eed
MD5 ca0cde6a76416c6c8eca06c4199b8d58
BLAKE2b-256 12f3fdb5a5e413a5f3d163b50ab4fc7c74f77260c2786e7d12816db521848cdc

See more details on using hashes here.

File details

Details for the file hackaprofile-1.3.1-py3-none-any.whl.

File metadata

  • Download URL: hackaprofile-1.3.1-py3-none-any.whl
  • Upload date:
  • Size: 15.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for hackaprofile-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 81cd2fab128fe5e34a7d6deec6834b38622fc14052877541e5e5295ab7bc582c
MD5 eebc9cad84e010e762a2f71a61b59b8c
BLAKE2b-256 38fcce0e65614aef797e2cd71b81623671a718cec2c0ab33c8cc75ae701ecaaa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page