Miscellaneous

toggl2pl.rounded(minutes, base=5)

Round the number of provided minutes based on the amount of minutes.

Parameters
  • minutes (int) – Real number of minutes to apply round operation on.

  • base (int) – The base number of minutes to use in rounding.

Returns

Number of minutes rounded based on amount of real amount of minutes.

Return type

int

toggl2pl.__main__.load_config(config)

Load configuration from supplied YAML formatted file.

Parameters

config (str) – The relative or absolute path to YAML configuration file.

Returns

Dictionary object with configuration options loaded from file.

Return type

dict

toggl2pl.__main__.main()

Main entry point used by toggl2pl script to process command line arguments and start application.

toggl2pl.__main__.parse_arguments()

Function to handle argument parser configuration (argument definitions, default values and so on).

Returns

argparse.ArgumentParser object with set of configured arguments.

Return type

argparse.ArgumentParser

toggl2pl.__main__.review(posts, tablefmt='fancy_grid', why_run=False)

Print data into standard output and ask about confirmation before actual data import/export.

Parameters
  • posts (list) – List of posts imported from source time tracker and to be published into target tracker during export.

  • tablefmt (str) – The table format to use (recommended formats are: plain, simple, rst and fancy_grid).

  • why_run (bool) – Optional flag to enable why-run mode (preview posts without publishing).

Returns

The provided list of posts without any modifications.

Return type

list

toggl2pl.__main__.run(known_args)

Run application in client mode (the way how to communicate with trackers depends on configuration file).

Parameters

known_args (argparse.Namespace) – The argument parser namespace object with supplied arguments.

toggl2pl.__main__.serverful(api_token, api_url, since, until, user_key, workspace, excluded_projects=None, why_run=False)

Run application as API service client to use centralized logging and publishing features.

Parameters
  • api_token (str) – The Toggl authentication token to use instead of username and password.

  • api_url (str) – The API service root URL to connect and communicate.

  • since (str) – The start date in ISO 8601 (YYYY-MM-DD) format to pull posts from Toggl.

  • until (str) – The last date in ISO 8601 (YYYY-MM-DD) format to pull posts from Toggl.

  • user_key (str) – The Project Laboratory authentication token to use instead of username and password.

  • workspace (str) – The Toggl workspace name (case sensitive) to pull information from.

  • excluded_projects (list) – List of Project Laboratory projects names to exclude from pull.

  • why_run (bool) – Optional argument to enable why-run mode useful to review posts without publishing.

toggl2pl.__main__.start(known_args)

Start application in server mode to serve incoming HTTP requests and process data received from clients.

Parameters

known_args (argparse.Namespace) – The argument parser namespace object with supplied arguments.