Skip to main content

Woffu API client with access to several endpoints.

Project description

woffu-client

PyPI - Python version PyPI - Version PyPI - Downloads PyPI - License pre-commit.ci status

Woffu client with access to several endpoints outside their public API, for those users without access to a Woffu API key.

Installation

PyPI

The build package is publicly available on PyPI:

pip install woffu-client

Development

pip install -e .

Usage

usage: woffu-cli [-h] [--config CONFIG] [--non-interactive] {download-all-documents,get-status,sign,request-credentials,summary-report} ...

CLI interface for Woffu API client

options:
  -h, --help            show this help message and exit
  --config CONFIG       Authentication file path (default: /home/mpalacin/.config/woffu/woffu_auth.json)
  --non-interactive     Set session as non-interactive

actions:
  {download-all-documents,get-status,sign,request-credentials,summary-report}
    download-all-documents
                        Download all documents from Woffu
    get-status          Get current status and current day's total amount of worked hours
    sign                Send sign in or sign out request based on the '--sign-type' argument
    request-credentials
                        Request credentials from Woffu. For non-interactive sessions, set username and password as environment variables WOFFU_USERNAME and WOFFU_PASSWORD.
    summary-report      Summary report of work hours for a given time window

Contributing

GitFlow convention

Please follow the GitFlow convention to do contributions to the code.

Linting

Make use of pre-commit git hooks to ensure that the code complies with PEP8 Style Guide for Python Code. Follow pre-commit instructions to ensure you have both the pre-commit python package installed and the environment initialized:

# Install pre-commit package
pip install pre-commit
# Binaries are include in $HOME/.local/bin in Ubuntu
# Ensure that python binaries path are included in the PATH variable
echo 'export PATH="$HOME/.local/bin:$PATH' >> ~/.bashrc
# Close the terminal and open a new one to apply changes or simply reload the .bashrc file
source ~/.bashrc
# Ensure that you have access to the pre-commit binary
pre-commit --version
# Go to the cloned project path and initialize pre-commit with the provided .pre-commit-config.yaml file
cd /path/to/woffu-client
pre-commit install

With this, each commit you do will be checked and auto-fixed by the pre-commit git hook. You'll have to stage the new changes in the files if something has been fixed.

Testing

:warning: TODO: add instructions on how to test code and where to add new tests

Disclaimer

This project has been partially coded using AI (ChatGPT) for handling HTTP sessions and responses as well as almost all unit tests. Expect either duplicated tests or code that can be improved; I intend to use static code analysis tools later on to achieve a cleaner code.

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

woffu_client-0.1.6.tar.gz (33.9 kB view details)

Uploaded Source

Built Distribution

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

woffu_client-0.1.6-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file woffu_client-0.1.6.tar.gz.

File metadata

  • Download URL: woffu_client-0.1.6.tar.gz
  • Upload date:
  • Size: 33.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for woffu_client-0.1.6.tar.gz
Algorithm Hash digest
SHA256 a1e8b6db54f956f7e8f24b0e992c5a91ae8f9158561b99f5614732084809c903
MD5 19f97bbe8be4c590ccf0ffda93434714
BLAKE2b-256 29fbf332f1bdeb1e79994f83f482ddcb5bce57b49f7556d81878851675a27713

See more details on using hashes here.

File details

Details for the file woffu_client-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: woffu_client-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for woffu_client-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 0123d126422493af4a370dd7c56a0aecb15dbe91738b9b3c967fc6f6a020fe80
MD5 b95aa1b233c06f712c4c4655595233b7
BLAKE2b-256 e7f991a8627453f408bb754527968425ecc171315aed3e69a179e04fdc3587fa

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