hopla-cli


Namehopla-cli JSON
Version 0.1.2a0 PyPI version JSON
download
home_pagehttps://github.com/melvio/hopla
SummaryHopla is a CLI to interact with the habitica.com API
upload_time2024-10-17 18:27:07
maintainerNone
docs_urlNone
authormelvio
requires_python>=3.8
licenseApache-2.0
keywords cli habitica productivity todo tasks
VCS
bugtrack_url
requirements requests pylint click build pytest pytest-cov flake8
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": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "cli, habitica, productivity, todo, tasks",
    "author": "melvio",
    "author_email": "hopla.pypi@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/74/ed/c01ea606883531c847a36cc5f1fa101d8aac0a193109dc0d63192340ab42/hopla_cli-0.1.2a0.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.1.2a0",
    "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": "ece1649a86009708833a1fcbd9274adff4047ecbed3a26ffba18faad9d84477f",
                "md5": "3d404c76381f116b422e93f5638bc6f9",
                "sha256": "44d03bd5c7632cc520ecc353819016fe0a5a90f3ad4e83a9be6091743d6e5538"
            },
            "downloads": -1,
            "filename": "hopla_cli-0.1.2a0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3d404c76381f116b422e93f5638bc6f9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 131458,
            "upload_time": "2024-10-17T18:27:05",
            "upload_time_iso_8601": "2024-10-17T18:27:05.328207Z",
            "url": "https://files.pythonhosted.org/packages/ec/e1/649a86009708833a1fcbd9274adff4047ecbed3a26ffba18faad9d84477f/hopla_cli-0.1.2a0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "74edc01ea606883531c847a36cc5f1fa101d8aac0a193109dc0d63192340ab42",
                "md5": "2c76804e7320c67f903ec8299d6a4b68",
                "sha256": "ec82610375064697b898cfab314c54a9e63dd2855af0187ba2df7208634010b3"
            },
            "downloads": -1,
            "filename": "hopla_cli-0.1.2a0.tar.gz",
            "has_sig": false,
            "md5_digest": "2c76804e7320c67f903ec8299d6a4b68",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 94992,
            "upload_time": "2024-10-17T18:27:07",
            "upload_time_iso_8601": "2024-10-17T18:27:07.715600Z",
            "url": "https://files.pythonhosted.org/packages/74/ed/c01ea606883531c847a36cc5f1fa101d8aac0a193109dc0d63192340ab42/hopla_cli-0.1.2a0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-17 18:27:07",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "melvio",
    "github_project": "hopla",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "requests",
            "specs": []
        },
        {
            "name": "pylint",
            "specs": []
        },
        {
            "name": "click",
            "specs": []
        },
        {
            "name": "build",
            "specs": []
        },
        {
            "name": "pytest",
            "specs": []
        },
        {
            "name": "pytest-cov",
            "specs": []
        },
        {
            "name": "flake8",
            "specs": []
        }
    ],
    "lcname": "hopla-cli"
}
        
Elapsed time: 0.33662s