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 --headless

[!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.0.tar.gz (11.7 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.0-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hackaprofile-1.3.0.tar.gz
  • Upload date:
  • Size: 11.7 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.0.tar.gz
Algorithm Hash digest
SHA256 488f0c2f3ee6f7c0d131b32b27cb762625d154544e857b9c94e2a0343593bd81
MD5 3befd8c263599a86b257bcb52a014a6c
BLAKE2b-256 e90d066b35058797a960490a376f9a1eb444af8baaaa88e0b1e7abd184810ea0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hackaprofile-1.3.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 652c52d71004f648d45afaf59c6f52f442bce8dbec093e4363d197507ec152d2
MD5 24ed7778823d79cd354bb99c5dbaf6b7
BLAKE2b-256 2e519a5a31361c37ab0ae0691dbc42131a5185012d18ea19625cb8fbe3c3e834

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