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

[!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 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.3.tar.gz (12.0 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.3-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hackaprofile-1.3.3.tar.gz
  • Upload date:
  • Size: 12.0 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.3.tar.gz
Algorithm Hash digest
SHA256 0f9c0a9274d4c2eb3346668e69f2b7fe29f6e838227a9b0067274e3be60c977b
MD5 d2fa8a9f1f8aed70abccc00cc1d61234
BLAKE2b-256 57c3bf5d13225ec2fe87280435013168bba260d285846b8398dc9e98d10dfa7e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hackaprofile-1.3.3-py3-none-any.whl
  • Upload date:
  • Size: 15.5 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d4859d9e3e9e54de313b99fe79ef89bfe71735e73744bd1d41ddfbd2324f59d4
MD5 13cfff26cd90f8aca221811f832782ce
BLAKE2b-256 9c75a4cda2bcc0ed012b466d1f351edfdb06a600dadff9611e12de36f2908c6e

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