GithubHelp home page GithubHelp logo

fitnesshut's Introduction

Download your FitnessHut receipts and send them to HR

This python script was created due the need to send every month receipts for my sports reimbursement to HR. Yes, I know this is really stupid when you have sports reimbursement agreed in your contract, but you still need to send these receipts everytime..๐Ÿคฆ๐Ÿฝโ€โ™‚๏ธ๐Ÿคฆ๐Ÿฝโ€โ™‚๏ธ

This script will download your receipts for the current month and:

  • will create an email in Outlook ready to be sent
    or
  • will create a Jira issue with receipts attached

Tested on Mac with Microsoft Outlook app.

Getting Started

  1. Clone repository
  2. Create and enable virtualenv (optional)
python -m venv .venv
source .venv/bin/activate
  1. Install requirements
pip install -r requirements.txt
  1. Export environment variables
export MYHUT_PASS='[email protected]'
export MYHUT_USER='Supersecretpassword'
export HR_EMAIL='[email protected]'
export JIRA_PROJECT='HRP'
export JIRA_ISSUE_TYPE='Employee request'
export JIRA_SERVER='https://jira.yourdomain.com'
export JIRA_TOKEN='your_token'
export JIRA_USER='your_jira_email'

OR to set it permanent in your project folder without exporting environment variables you can create a .env file and set these variables there

[email protected]
MYHUT_USER=SuperSecretPassword
[email protected]
JIRA_PROJECT='HRP'
JIRA_ISSUE_TYPE='Employee request'
JIRA_SERVER='https://jira.yourdomain.com'
JIRA_TOKEN='your_token'
JIRA_USER='your_jira_email'
  1. Edit subject and email body in outlook.py

Usage

Outlook

  1. Review body(line 7-12) in outlook.py and edit it accordingly.
  2. Run the script:
python fitnesshut.py --outlook

Script should download receipts and open Outlook with inserted message body, subject and these receipts as attachments. 2. Press "Send"

Jira ticket

  1. Run the script:
python fitnesshut.py --jira

Script should download receipts (by default for the current month only) and create Jira issue with title, description, and these receipts as attachments. It will post created issue link.
In case you want to download receipts for the last 2-3 months, then you should pass the -m flag with number of months.
For example if you want to download receipts for the last 2 months, then execute:

python fitnesshut.py --jira -m 2

Amount of months should not exceed 3 unfortunately MyHut platform does not support filtering receipts for more than 3 months back.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.