hopla-cli


Namehopla-cli JSON
Version 0.0.36a0 PyPI version JSON
download
home_pagehttps://github.com/melvio/hopla
SummaryHopla is a CLI to interact with the habitica.com API
upload_time2024-02-13 17:37:50
maintainer
docs_urlNone
authormelvio
requires_python>=3.8
licenseApache-2.0
keywords cli habitica productivity todo tasks
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Hopla

[![hopla](https://img.shields.io/static/v1?label=melvio&message=hopla&color=blue&logo=github)](https://github.com/melvio/hopla)
[![stars - hopla](https://img.shields.io/github/stars/melvio/hopla?style=social)](https://github.com/melvio/hopla)      
[![Continuous Integration](https://github.com/melvio/hopla/actions/workflows/ci-lint-and-test.yml/badge.svg)](https://github.com/melvio/hopla/actions/workflows/ci-lint-and-test.yml)

hopla - a command line interface (CLI) for [habitica.com](https://habitica.com)

Hopla is a XDG-compliant CLI which uses `python3` to interact with
the [Habitica API](https://habitica.com/apidoc/).

Hopla is currently under active development so new features are added rapidly.

## How to Use Hopla

### Installation

Hopla can be installed by running the following command:

```bash
python3 -m pip install --user hopla-cli
```


### First Time Usage

Hopla needs your `User Id` and `API Token` to connect to Habitica. 
You can find these over at `https://habitica.com/user/settings/api`. 

Run the following command to configure this automatically:

```bash
$ hopla authenticate 
Please enter your credentials.
You can find them over at <https://habitica.com/user/settings/api>.
They have the following format: 'c0ffee69-dada-feed-abb1-5ca1ab1ed004'.
The user id can be found under 'User ID'.
Please paste your user ID here (press Ctrl-C to abort): c0ffee69-dada-feed-abb1-5ca1ab1ed004
Please paste your user API Token here (input remains hidden):
```

This will create a credentials file at `~/.config/hopla/authenticate.conf` that Hopla uses. 
If you want to use a different file, you can set the `${HOPLA_AUTH_FILE}` environment 
variable to choose your own file.

##### Autocompletion

If you want bash autocompletion, you can run the following command:

```bash
$ hopla complete bash --enable
enabled autocompletion
restart bash to make use of it
```

To make use of the autocompletion you need to reload your bashrc.
You can do this by either opening up a new terminal window, or
running `bash` again, or running `source ~/.bashrc`.


To print the autocomplete code for bash|zsh|fish, so that you can install 
it yourself, optionally run:

```bash
# optionally, install the autocomplete code yourself:
hopla complete bash
hopla complete zsh
hopla complete fish
```

## Everyday Usage

After installation, you can use `hopla`. 
The supported commands can be found by running:

```bash
$ hopla --help
Usage: hopla [OPTIONS] COMMAND [ARGS]...

  hopla - a command line interface (CLI) to interact with habitica.com

Options:
  --version   Show the version and exit.
  -h, --help  Show this message and exit.

Commands:
  add                  GROUP for adding things to Habitica.
  api                  GROUP for requesting Habitica API metadata.
  authenticate         Authorize yourself to access the Habitica.com API.
  buy                  GROUP to buy things.
  complete             Print or enable shell autocompletion.
  # etcetera
```

More functionality is currently being implemented. 
Hopla is open-source. 
Pull request, feature requests, and issues are welcomed at <https://github.com/melvio/hopla>. 
If you want to contribute, but don't know where to start, you might want to look at
`.github/CONTRIBUTING.md` and the `./developers` folder.

[![License](https://img.shields.io/badge/License-apache--2.0-blue)](#license)

### Environment Variables for Hopla's options

*Use case*: You can use environment variables to set default values for all Hopla options. 

Hopla automatically recognizes environment variables starting with `HOPLA_`. 
All option (such as `--difficulty` for `hopla add todo` and `--times` for `hopla feed`) can be 
set in this manner.

To get the right environment variable name, use this logic:

1. Define an environment variable starting with `HOPLA_`

2. Append the subcommand to the environment variable as follows:
    * `hopla add todo` -> `HOPLA_ADD_TODO_`
    * `hopla support-development` -> `HOPLA_SUPPORT_DEVELOPMENT_`
    * `hopla feed` -> `HOPLA_FEED_`
 
3. Append the option name that you want to set as follows:
    * `hopla add todo --difficulty` -> `HOPLA_ADD_TODO_DIFFICULTY`
    * `hopla support-development --gems` -> `HOPLA_SUPPORT_DEVELOPMENT_GEMS`
    * `hopla feed --times` -> `HOPLA_FEED_TIMES`


For example:

```bash
HOPLA_ADD_TODO_DIFFICULTY=hard    hopla add todo "Hello"
HOPLA_SUPPORT_DEVELOPMENT_GEMS=8  hopla support-development
HOPLA_FEED_AMOUNT=3               hopla feed Wolf-Shade Chocolate
````


Other examples:

```bash
# add a To-Do for today
HOPLA_ADD_TODO_DUE_DATE=today hopla add todo "Task with Deadline from today"

# automatically enable autocomplete for bash 
HOPLA_COMPLETE_ENABLE=true    hopla complete bash
HOPLA_COMPLETE_ENABLE=yes     hopla complete bash
HOPLA_COMPLETE_ENABLE=1       hopla complete bash

# only print autocomplete for bash
HOPLA_COMPLETE_ENABLE=0       hopla complete bash   
HOPLA_COMPLETE_ENABLE=false   hopla complete bash   
HOPLA_COMPLETE_ENABLE=no      hopla complete bash   
```

### Background

Hopla is a XDG-compliant bash-based command line interface (CLI). 
It was created because no other CLI supported the creation of To-Dos with both a 
due date and a checklist. 
Hopla provides the following command to create these with the following command:

```bash
# Add a hard To-Do. Every line in the specified file will being added as
#  an item of this To-Do's checklist.
hopla add todo --difficulty hard \
               --due-date 2027-12-07 \
               --checklist ./my_todo.txt \
               "my todo name here"
```

The most simple way to add a To-Do would be to run `hopla add todo` without arguments.
Hopla will then prompt you for a To-Do name:

```bash
$ hopla add todo
Please provide a name for your todo: Feed the dog
```








            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/melvio/hopla",
    "name": "hopla-cli",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "cli,habitica,productivity,todo,tasks",
    "author": "melvio",
    "author_email": "hopla.pypi@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/2e/83/ef93877e6a80355b7a4bd59e14cef24655f1fbabb9e27cce4b87a2de78ce/hopla-cli-0.0.36a0.tar.gz",
    "platform": null,
    "description": "# Hopla\n\n[![hopla](https://img.shields.io/static/v1?label=melvio&message=hopla&color=blue&logo=github)](https://github.com/melvio/hopla)\n[![stars - hopla](https://img.shields.io/github/stars/melvio/hopla?style=social)](https://github.com/melvio/hopla)      \n[![Continuous Integration](https://github.com/melvio/hopla/actions/workflows/ci-lint-and-test.yml/badge.svg)](https://github.com/melvio/hopla/actions/workflows/ci-lint-and-test.yml)\n\nhopla - a command line interface (CLI) for [habitica.com](https://habitica.com)\n\nHopla is a XDG-compliant CLI which uses `python3` to interact with\nthe [Habitica API](https://habitica.com/apidoc/).\n\nHopla is currently under active development so new features are added rapidly.\n\n## How to Use Hopla\n\n### Installation\n\nHopla can be installed by running the following command:\n\n```bash\npython3 -m pip install --user hopla-cli\n```\n\n\n### First Time Usage\n\nHopla needs your `User Id` and `API Token` to connect to Habitica. \nYou can find these over at `https://habitica.com/user/settings/api`. \n\nRun the following command to configure this automatically:\n\n```bash\n$ hopla authenticate \nPlease enter your credentials.\nYou can find them over at <https://habitica.com/user/settings/api>.\nThey have the following format: 'c0ffee69-dada-feed-abb1-5ca1ab1ed004'.\nThe user id can be found under 'User ID'.\nPlease paste your user ID here (press Ctrl-C to abort): c0ffee69-dada-feed-abb1-5ca1ab1ed004\nPlease paste your user API Token here (input remains hidden):\n```\n\nThis will create a credentials file at `~/.config/hopla/authenticate.conf` that Hopla uses. \nIf you want to use a different file, you can set the `${HOPLA_AUTH_FILE}` environment \nvariable to choose your own file.\n\n##### Autocompletion\n\nIf you want bash autocompletion, you can run the following command:\n\n```bash\n$ hopla complete bash --enable\nenabled autocompletion\nrestart bash to make use of it\n```\n\nTo make use of the autocompletion you need to reload your bashrc.\nYou can do this by either opening up a new terminal window, or\nrunning `bash` again, or running `source ~/.bashrc`.\n\n\nTo print the autocomplete code for bash|zsh|fish, so that you can install \nit yourself, optionally run:\n\n```bash\n# optionally, install the autocomplete code yourself:\nhopla complete bash\nhopla complete zsh\nhopla complete fish\n```\n\n## Everyday Usage\n\nAfter installation, you can use `hopla`. \nThe supported commands can be found by running:\n\n```bash\n$ hopla --help\nUsage: hopla [OPTIONS] COMMAND [ARGS]...\n\n  hopla - a command line interface (CLI) to interact with habitica.com\n\nOptions:\n  --version   Show the version and exit.\n  -h, --help  Show this message and exit.\n\nCommands:\n  add                  GROUP for adding things to Habitica.\n  api                  GROUP for requesting Habitica API metadata.\n  authenticate         Authorize yourself to access the Habitica.com API.\n  buy                  GROUP to buy things.\n  complete             Print or enable shell autocompletion.\n  # etcetera\n```\n\nMore functionality is currently being implemented. \nHopla is open-source. \nPull request, feature requests, and issues are welcomed at <https://github.com/melvio/hopla>. \nIf you want to contribute, but don't know where to start, you might want to look at\n`.github/CONTRIBUTING.md` and the `./developers` folder.\n\n[![License](https://img.shields.io/badge/License-apache--2.0-blue)](#license)\n\n### Environment Variables for Hopla's options\n\n*Use case*: You can use environment variables to set default values for all Hopla options. \n\nHopla automatically recognizes environment variables starting with `HOPLA_`. \nAll option (such as `--difficulty` for `hopla add todo` and `--times` for `hopla feed`) can be \nset in this manner.\n\nTo get the right environment variable name, use this logic:\n\n1. Define an environment variable starting with `HOPLA_`\n\n2. Append the subcommand to the environment variable as follows:\n    * `hopla add todo` -> `HOPLA_ADD_TODO_`\n    * `hopla support-development` -> `HOPLA_SUPPORT_DEVELOPMENT_`\n    * `hopla feed` -> `HOPLA_FEED_`\n \n3. Append the option name that you want to set as follows:\n    * `hopla add todo --difficulty` -> `HOPLA_ADD_TODO_DIFFICULTY`\n    * `hopla support-development --gems` -> `HOPLA_SUPPORT_DEVELOPMENT_GEMS`\n    * `hopla feed --times` -> `HOPLA_FEED_TIMES`\n\n\nFor example:\n\n```bash\nHOPLA_ADD_TODO_DIFFICULTY=hard    hopla add todo \"Hello\"\nHOPLA_SUPPORT_DEVELOPMENT_GEMS=8  hopla support-development\nHOPLA_FEED_AMOUNT=3               hopla feed Wolf-Shade Chocolate\n````\n\n\nOther examples:\n\n```bash\n# add a To-Do for today\nHOPLA_ADD_TODO_DUE_DATE=today hopla add todo \"Task with Deadline from today\"\n\n# automatically enable autocomplete for bash \nHOPLA_COMPLETE_ENABLE=true    hopla complete bash\nHOPLA_COMPLETE_ENABLE=yes     hopla complete bash\nHOPLA_COMPLETE_ENABLE=1       hopla complete bash\n\n# only print autocomplete for bash\nHOPLA_COMPLETE_ENABLE=0       hopla complete bash   \nHOPLA_COMPLETE_ENABLE=false   hopla complete bash   \nHOPLA_COMPLETE_ENABLE=no      hopla complete bash   \n```\n\n### Background\n\nHopla is a XDG-compliant bash-based command line interface (CLI). \nIt was created because no other CLI supported the creation of To-Dos with both a \ndue date and a checklist. \nHopla provides the following command to create these with the following command:\n\n```bash\n# Add a hard To-Do. Every line in the specified file will being added as\n#  an item of this To-Do's checklist.\nhopla add todo --difficulty hard \\\n               --due-date 2027-12-07 \\\n               --checklist ./my_todo.txt \\\n               \"my todo name here\"\n```\n\nThe most simple way to add a To-Do would be to run `hopla add todo` without arguments.\nHopla will then prompt you for a To-Do name:\n\n```bash\n$ hopla add todo\nPlease provide a name for your todo: Feed the dog\n```\n\n\n\n\n\n\n\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Hopla is a CLI to interact with the habitica.com API",
    "version": "0.0.36a0",
    "project_urls": {
        "Homepage": "https://github.com/melvio/hopla",
        "Issue Tracker": "https://github.com/melvio/hopla/issues/",
        "License": "https://github.com/melvio/hopla/blob/main/LICENSE",
        "PyPi": "https://pypi.org/project/hopla-cli/",
        "Readme": "https://github.com/melvio/hopla/blob/main/README.md",
        "Source": "https://github.com/melvio/hopla/",
        "Stackoverflow Account": "https://stackoverflow.com/users/12520740/melvio",
        "Wiki": "https://habitica.fandom.com/wiki/Hopla"
    },
    "split_keywords": [
        "cli",
        "habitica",
        "productivity",
        "todo",
        "tasks"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6dbc71c86e110a3c9c9bb07ef9839866aafd52d7bfb4afe48c1133d0beada236",
                "md5": "27587f0faad6ae57eb48a5ce1947f847",
                "sha256": "ae1bd5a1d38af76eaa3ec8bde1c8b581b2cf61720d82f9cad6e560552090a689"
            },
            "downloads": -1,
            "filename": "hopla_cli-0.0.36a0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "27587f0faad6ae57eb48a5ce1947f847",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 130943,
            "upload_time": "2024-02-13T17:37:47",
            "upload_time_iso_8601": "2024-02-13T17:37:47.547631Z",
            "url": "https://files.pythonhosted.org/packages/6d/bc/71c86e110a3c9c9bb07ef9839866aafd52d7bfb4afe48c1133d0beada236/hopla_cli-0.0.36a0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2e83ef93877e6a80355b7a4bd59e14cef24655f1fbabb9e27cce4b87a2de78ce",
                "md5": "e6d0b04788f5fa2435c171b5a0a3b4b1",
                "sha256": "b532d31a64a974f537d680bf13745981eef87d82ad5cf20ed684908034c55825"
            },
            "downloads": -1,
            "filename": "hopla-cli-0.0.36a0.tar.gz",
            "has_sig": false,
            "md5_digest": "e6d0b04788f5fa2435c171b5a0a3b4b1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 94535,
            "upload_time": "2024-02-13T17:37:50",
            "upload_time_iso_8601": "2024-02-13T17:37:50.007911Z",
            "url": "https://files.pythonhosted.org/packages/2e/83/ef93877e6a80355b7a4bd59e14cef24655f1fbabb9e27cce4b87a2de78ce/hopla-cli-0.0.36a0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-13 17:37:50",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "melvio",
    "github_project": "hopla",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "hopla-cli"
}
        
Elapsed time: 0.21682s