{ "info": { "author": "Tilman Blumenbach", "author_email": "tilman+pypi@ax86.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: End Users/Desktop", "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3 :: Only", "Topic :: Office/Business", "Topic :: Utilities" ], "description": "toggl-fetch |pypi-badge|\n========================\n\n``toggl-fetch`` makes it easy to periodically retrieve summary reports for a `Toggl`_ workspace.\n\nDoing that manually is tedious: Each time you need to generate a new report, you need to remember on what date\nthe previous report ends -- so that you can let the new report start on the correct date. ``toggl-fetch`` takes\ncare of remembering that piece of information and downloading the report for you.\n\n.. contents::\n\nOperation overview\n------------------\n\nThe first time you fetch a report for a workspace using ``toggl-fetch``, you need to tell it on what date the report\nshould start. If you don't specify a start date, then ``toggl-fetch`` lets the report start four weeks ago.\n\nOptionally, you can specify the date the report should end (herafter simply called the \"end date\"). If you don't\nspecify an end date, ``toggl-fetch`` uses today's date.\n\nBeing given this information, ``toggl-fetch`` downloads the report as a PDF file and stores it on your computer.\nIt also remembers the \"end date\" for the report; it does that separately for each workspace, so you can use it for\nmultiple workspaces.\n\nNow, the next time you use ``toggl-fetch`` to fetch a report for the workspace, you can omit the start date.\n``toggl-fetch`` then adds one day to the saved \"end date\" (which it stored the last time you fetched a report)\nand uses the result as the new start date for the report. It then remembers the \"end date\" for the current report so\nthat it can use that information the next time you use ``toggl-fetch``.\n\n.. note::\n\n Both the \"start date\" and the \"end date\" are treated as *inclusive* dates; that is, the generated reports will\n *include* data for the specified dates.\n\nInstallation\n------------\n\nYou can install ``toggl-fetch`` using `pip`_::\n\n pip install toggl-fetch\n\nA short how-to\n--------------\n\nObtaining a Toggl API token\n+++++++++++++++++++++++++++\n\n``toggl-fetch`` needs a Toggl API token in order to log in to your Toggl account. You can obtain the API token\nfor your account at the end of your `profile page`_.\n\nFor the following examples, let's assume that you API token is ``9fc1632af9abac871694d49727685b90``.\n\nGenerating the first report\n+++++++++++++++++++++++++++\n\nHaving obtained an API token, you can now generate your first report. To do that, you need to know the name of the\nworkspace you want to generate a report for; let's assume it to be \"John Doe's workspace\". Also, the report should\nbegin on 2016-01-01 and end on today's date (since the latter is the default, you don't need to specify an\nend date).\n\nTo download the report as a PDF file into your current working directory, execute the\nfollowing command::\n\n toggl-fetch --api-token 9fc1632af9abac871694d49727685b90 --workspace \"John Doe's workspace\" --start-date 2016-01-01\n\nThat's it. Provided that the API token is valid and a workspace with the specified name exists, you should now\nfind the report as a PDF file named ``summary_-.pdf`` in the current working directory\n(see `Specifying an output file template`_ to learn how to change that filename).\n\nGenerating subsequent reports\n+++++++++++++++++++++++++++++\n\nNow that you have generated your first report, generating subsequent reports is as easy as running the following\ncommand::\n\n toggl-fetch --api-token 9fc1632af9abac871694d49727685b90 --workspace \"John Doe's workspace\"\n\nNote that we omitted the start date -- this makes ``toggl-fetch`` calculate it from the \"end date\" it stored when you\ngenerated the last report (which in this case, was the first report ever generated).\n\nThis again will download the report to a file named ``summary_-.pdf`` in your current\nworking directory (see also `Specifying an output file template`_).\n\nDetailed usage\n--------------\n\nTo view all the command line arguments accepted by ``toggl-fetch``, simply do::\n\n toggl-fetch --help\n\nSpecifying an output file template\n----------------------------------\n\nBy default, the report is downloaded into the current working directory as a file named\n``summary_-.pdf``, where ``end_year`` and ``end_month`` are taken from\nthe end date of the report.\n\nThis filename template can be changed using the ``--output`` option. It takes a relative or absolute filename\nas an argument; the special placeholders ``{start_date}`` and ``{end_date}`` are replaced to produce the name of\nthe output file.\n\nThe default template is ``summary_{end_date:%Y}-{end_date:%m}.pdf``. Here, ``{end_date}`` is used twice, but\neach of the two placeholders contains a different string after the colon: This is a date format specification\nspecifying how to format the end date. In this case, the placeholder ``{end_date:%Y}`` is replaced by the\nyear of the end date and the placeholder ``{end_date:%m}`` is replaced by the month of the end date.\n\nThe Python documentation contains a `list of valid date format codes`_ which can be used in the date format\nspecification. For example, the two ``{end_date}``\nplaceholders above could be replaced with a single placeholder ``{end_date:%Y-%m}`` to produce the same result.\n\nUsing a configuration file\n--------------------------\n\nSpecifying the workspace name, your API token and maybe even an output file template each time you use ``toggl-fetch``\nis annoying. You can avoid having to specify options on the command line by placing them in a configuration file\ninstead.\n\n``toggl-fetch`` follows the `XDG Base Directory Specification`_. In most cases, this means you can place a configuration\nfile in ``~/.config/toggl-fetch/config.ini`` and ``toggl-fetch`` will find it.\n\nTaking the command line parameters used in `A short how-to`_ as an example, a valid configuration file would look like\nthis:\n\n.. code:: ini\n\n [options]\n api_token = 9fc1632af9abac871694d49727685b90\n workspace = John Doe's workspace\n\nSpecifying these two options in the configuration file is enough to be able to run ``toggl-fetch`` without having to\nspecify any command line options.\n\nAll command line options can be used in the ``[options]`` section. Command line parameters without a value\n(like ``--force``) can be set by simply using the option name without a value, like this:\n\n.. code:: ini\n\n [options]\n force\n\n.. warning::\n\n This is only an example. Placing the ``force`` option in the configuration file is *discouraged* for obvious\n reasons.\n\nLines starting with optional whitespace followed by either ``#`` or ``;`` are treated as comments and are ignored.\n\n.. note::\n\n Inline comments (comments at the end of non-empty lines) are **not** supported.\n\nVersion history\n---------------\n\nVersion 1.0.1\n+++++++++++++\n\n- Fix: Add forgotten short option ``-V`` as a counterpart to ``--version``.\n- Fix: Document return codes for the ``main()`` function.\n- Fix: ``User-Agent`` header: Add our version number and correctly format our URL.\n\nVersion 1.0.0\n+++++++++++++\n\n- Initial release.\n\n\n.. _Toggl: https://toggl.com\n.. _pip: https://pypi.python.org/pypi/pip\n.. _profile page: https://toggl.com/app/profile\n.. _list of valid date format codes: https://docs.python.org/3.5/library/datetime.html#strftime-and-strptime-behavior\n.. _XDG Base Directory specification: https://specifications.freedesktop.org/basedir-spec/basedir-spec-0.6.html\n\n\n..\n NB: Without a trailing question mark in the following image URL, the\n generated HTML will contain an element instead of an \n element, which apparently cannot be made into a link (i. e. a\n \"clickable\" image).\n\n.. |pypi-badge| image:: https://img.shields.io/pypi/v/toggl-fetch.svg?\n :alt:\n :align: middle\n :target: https://pypi.python.org/pypi/toggl-fetch", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Tblue/toggl-fetch", "keywords": "toggl report export", "license": "", "maintainer": "", "maintainer_email": "", "name": "toggl-fetch", "package_url": "https://pypi.org/project/toggl-fetch/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/toggl-fetch/", "project_urls": { "Homepage": "https://github.com/Tblue/toggl-fetch" }, "release_url": "https://pypi.org/project/toggl-fetch/1.0.1/", "requires_dist": [ "python-dateutil (~=2.0)", "pyxdg (~=0.20)", "requests (~=2.2)" ], "requires_python": "", "summary": "Fetch summary reports from Toggl.com, with automatic date range calculation.", "version": "1.0.1" }, "last_serial": 2040302, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "ad8e2b48c1e5aea4045f0f41f7679346", "sha256": "a70ef64d851093b940c35def9e52478723663e3aed57c5bd13cfb87844d56f41" }, "downloads": -1, "filename": "toggl_fetch-1.0.0-py3-none-any.whl", "has_sig": true, "md5_digest": "ad8e2b48c1e5aea4045f0f41f7679346", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 18537, "upload_time": "2016-03-01T16:24:54", "url": "https://files.pythonhosted.org/packages/a5/b3/961f4b1bdcb398a9b7a47456d2bd3acab3f76ae92861870eea533dae3e6d/toggl_fetch-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "46faaa198ad636cb2f27e5ab4118decb", "sha256": "46bfad13684d33be1cee129258760119369c528f21441513f4ac82d2b7e7ac4c" }, "downloads": -1, "filename": "toggl-fetch-1.0.0.tar.gz", "has_sig": true, "md5_digest": "46faaa198ad636cb2f27e5ab4118decb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29213, "upload_time": "2016-03-01T16:25:04", "url": "https://files.pythonhosted.org/packages/a0/c9/6684ad70164eef9e888b77b8347079f19d8e31c409b5a3e91c8ee52b0381/toggl-fetch-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "7807bca3860295f1f4fe5d4dcad6611a", "sha256": "9f499a89bf4ac9c3fdccba3cb629d5b1dd5ee3502fcb21c6904dc3dc446077b1" }, "downloads": -1, "filename": "toggl_fetch-1.0.1-py3-none-any.whl", "has_sig": true, "md5_digest": "7807bca3860295f1f4fe5d4dcad6611a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 18820, "upload_time": "2016-04-01T13:24:07", "url": "https://files.pythonhosted.org/packages/b6/05/be2843f4895cfb6a690ed08208dcd17e5fc795b68bca56ba2aaea3992f1b/toggl_fetch-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "53545918dc45d9b665d3c54a2f09e9a4", "sha256": "d1dc2c51774ffd7b78e65a53b292a93b0290002d7385ba794cc56454fe5a5c4d" }, "downloads": -1, "filename": "toggl-fetch-1.0.1.tar.gz", "has_sig": true, "md5_digest": "53545918dc45d9b665d3c54a2f09e9a4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29488, "upload_time": "2016-04-01T13:24:22", "url": "https://files.pythonhosted.org/packages/a0/fd/993bbf927178d7bba25c1bf462c50b39d140e393883df811574ce2060a35/toggl-fetch-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7807bca3860295f1f4fe5d4dcad6611a", "sha256": "9f499a89bf4ac9c3fdccba3cb629d5b1dd5ee3502fcb21c6904dc3dc446077b1" }, "downloads": -1, "filename": "toggl_fetch-1.0.1-py3-none-any.whl", "has_sig": true, "md5_digest": "7807bca3860295f1f4fe5d4dcad6611a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 18820, "upload_time": "2016-04-01T13:24:07", "url": "https://files.pythonhosted.org/packages/b6/05/be2843f4895cfb6a690ed08208dcd17e5fc795b68bca56ba2aaea3992f1b/toggl_fetch-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "53545918dc45d9b665d3c54a2f09e9a4", "sha256": "d1dc2c51774ffd7b78e65a53b292a93b0290002d7385ba794cc56454fe5a5c4d" }, "downloads": -1, "filename": "toggl-fetch-1.0.1.tar.gz", "has_sig": true, "md5_digest": "53545918dc45d9b665d3c54a2f09e9a4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29488, "upload_time": "2016-04-01T13:24:22", "url": "https://files.pythonhosted.org/packages/a0/fd/993bbf927178d7bba25c1bf462c50b39d140e393883df811574ce2060a35/toggl-fetch-1.0.1.tar.gz" } ] }