DodonaCLI


NameDodonaCLI JSON
Version 2025.1.26 PyPI version JSON
download
home_pageNone
SummaryA CLI tool for Dodona
upload_time2025-01-26 15:23:49
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT License Copyright (c) 2024 Bram Windey Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords dodona cli
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Command Line Interface for [Dodona](https://dodona.be)

PyPI page: https://pypi.org/project/DodonaCLI/#description

**Contents**:
1) [Disclaimers](#disclaimers)
2) [Installation and updating](#installation-and-updating)
3) [How to use](#how-to-use)
4) [Flags that could be important](#flags-that-could-be-important)
5) [Settings](#settings)
6) [Tab-completion and man-pages](#tab-completion-and-man-pages)
7) [Help, DodonaCLI freezes](#help-dodonacli-freezes)
8) [Roadmap](#roadmap)


## Disclaimers

- DodonaCLI is an independent tool created by me, a student, and is not officially affiliated with the Dodona service or its team. Dodona, provided by the dedicated team at UGent University, offers an exceptional service, and this tool has been created as a complementary project. Only issues related to the Dodona website itself should be directed to the official Dodona support channels. Issues with the CLI tool should be posted on this [project’s Issues](https://github.com/BWindey/DodonaCLI/issues).

- Although the exercise-description formatting is mostly useable, do NOT rely on this for tests and exams! The printed description may be incomplete, or even incorrect. Please be aware of this!

- I did my best to format the output of DodonaCLI in a nice manner. If this is not the case for your terminal, please reach out via the [Issues](https://github.com/BWindey/DodonaCLI/issues) to see if we can fix that. I use the Alacritty and Gnome terminal, so if you’re using those, you can be mostly sure that what you see is intended.


## Installation and updating
Both installation and updating happen through pip:
```pip install DodonaCLI```
and
```pip install --upgrade DodonaCLI```

You can check for a new update with
```dodona info check-update```

Alternatively, you can `git clone https://github.com/BWindey/DodonaCLI && cd DodonaCLI`, and do `pip install -e .`. The `-e` flag ensures that when you change files (or did a `git pull`), the cli will use the new code.
This is mostly useful for those wanting to change/add to the code, or test new features on the develop-branch (not recommended for normal users).


## How to use
There are three main things you can do with Dodona: displaying info (`dodona display`),
selecting (`dodona select`) and posting exercises (`dodona post`).
The behaviour of displaying and selecting will depend on your current selection,
which can be viewed with `dodona status`.
You can imagine it as a tree structure:
- courses
  - exercise series
    - exercises

If nothing is selected, you’ll need to select a course first, then an exercise series, then an exercise.
You can always see all your available options with `dodona display`.
Posting a solution will only work if you have selected an exercise, and can be done with `dodona post <SOLUTION_FILE>`.
This tree-like structure also explains the name of the deselect-flag: `up` and `uptop`.
To select the next exercise, you don’t need to go up and select the new one, you can use the `next` command.

The first time you use DodonaCLI, the program will ask you for an API token,
which you can generate on your Dodona-profile page.
This will be stored in a file 'config.json' in the same directory as this python script.
If you ever delete this file, you’ll need to re-enter your API token.
You can either keep a back-up of your token somewhere else,
or just generate a new token whenever you (accidently) deleted your old token.

If there is some boilerplate code associated with an exercise,
it will get printed out to the terminal once you select the exercise.
You can also find it in the file 'boilerplate'.
You can use it to write your solution in, and post it,
but be aware that this file gets overwritten when you select a new exercise that has boilerplate-code attached
(not all do).


## Flags that could be important
There currently are four flags that can be important when working with non-standard exercises.
- --force
- --hidden
- --other
- --use-link

They are all context-specific. A short explanation can be found in the help-pages, a slightly longer one here:

### Force
This flag is used in combination with the `display` command, when viewing exercise-series and exercise-descriptions.
It will do its best to render the html and markdown of the web-page in your terminal.
You’ll quickly see why this is hidden behind this flag: the formatting can be awful.
For some exercise-descriptions, this can, however, be a nice addition,
and in the future the formatting-"engine" can improve.


### Hidden
This flag is used in combination with the `select` command, when selecting an exercise-series that is hidden.
Series can be hidden when they are used in tests or exams, and to get to them, you’ll receive a link to it from your
teachers. This link will be of the form `.../series/<SERIES-ID>/?token=<TOKEN>`.
The only correct syntax to then select that hidden series with DodonaCLI is:
    ```dodona select --hidden <TOKEN> <SERIES-ID>```


### Other
This flag is used in combination with the `select` command, when selecting a course you’re not registered for.
This allows you, for example, to select courses from previous years to try out those old tests or exams.
You cannot find these courses when using `display`,
so you’ll need the correct course-id to select it, not the course-name.

### Use-link
This flag is used in combination with the `post` command,
when posting a solution-file to a link provided at the first line of the solution-file.
The link has to include "/courses/<COURSE-ID>" and "/activities/<ACTIVITIES-ID"
to know which exercise to submit your solution to.
It also has to start with "https:<!-- comment to prevent link from appearing as real link-->//dodona.be/".
This link is not included in the solution submitted to the Dodona servers; it is stripped out.


## Settings
DodonaCLI has some settings (starting from version 2024.5.20).
Currently they are only editable by editing the settings.json file directly.
In the future, there could be a sub-command to edit these in a more convenient way.
The current settings, with their default values, are:
- `amount_feedback_context`: 3
- `amount_feedback_tab`: -1
- `amount_feedback_testcase`: 3
- `amount_feedback_test`: 3
- `amount_sub_exercise`: 10
- `amount_sub_global`: -1 (-1 means that it will show everything Dodona gives)
- `new_lines_above`: 1 (How many new lines above DodonaCLI output)
- `new_lines_below`: 1
- `paste_force_warning`: false
- `display_series_after_select`: false
- `display_exercises_after_select`: false
- `display_exercise_after_select`: false



## Tab-completion and man-pages
Tab-completion is supported for bash, fish and zsh. The easiest way to install it, is by following the short instructions at
https://click.palletsprojects.com/en/8.1.x/shell-completion/#enabling-completion,
where you replace all occurences of 'foo-bar' with 'dodona'.

You can also use my custom-written script for bash (if you're using bash), by downloading the autocomplete-script from
https://github.com/BWindey/DodonaCLI/blob/master/dodonacli_completion_script.sh
and source it in your ~/.bashrc.
I personally use this custom one, as it allows me more control over the completion.
The disadvantage over using this, however, is that you'll need to redownload it if it ever changes.
I'll promise here and now that if I don't forget, I will always mention in the changelog
(`dodona info changelog`), that you need to download the new completion-script.

A while ago, I strongly recommended the custom script, because the other way took about 200ms to complete, which felt slow, but due to some code-restructuring, the completion happens in around 50ms.

There is also a manual page available (very prefessional).
You can download ["dodonacli.1.gz"](https://github.com/BWindey/DodonaCLI/blob/master/man-page/dodonacli.1.gz) and save this in a folder included in `$(manpath)`.
This will have to be downloaded again if it is updated. I'll let you know in the changelogs.


## Help, DodonaCLI freezes
Since I just got this situation, I wanted to tell you how I fixed it.
My computer didn’t succeed in making any network requests over IPv6, and thus waited and waited and waited ...
To fix this, I had to disable IPv6 entirely on my own pc.
This is not something I’ll show you how to do, you’ll have to do some research on the internet.
Before trying that, confirm first if this is indeed the issue by running `wget` with --inet6-only and --inet4-only
to see if this is indeed the issue.


## Roadmap
This section has a bunch of ideas for me to work on, but also for you, the potential contributor!
Remember to look at the recent branches/commits to see if I’m not working on one of these:
- user-settings (f.e. auto-download of files, language, formatting, number of submissions shown, ...)
  - language
  - whether to save feedback to a file
  - auto download links from sandbox.dodona when selecting exercise
- easy (automatic?) downloading of files mentioned in exercise description
- add connection time-out to prevent long waiting when IPv6 doesn’t want to work along
- add support for more languages syntax checkers
- caching some info for faster navigation and/or autocompletion
- add indicator to series to mark if all their exercises are completely solved (maybe fetch from html-version)
- get exercise-names via html-parsing for a submission list to only need 1 API call (instead of 30)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "DodonaCLI",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "dodona, cli",
    "author": null,
    "author_email": "Bram Windey <windey.bram@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/1d/2d/8e13e16dba2a38f668a3d0d44d48e04390f0a363e2cffbae129da401c296/dodonacli-2025.1.26.tar.gz",
    "platform": null,
    "description": "# Command Line Interface for [Dodona](https://dodona.be)\n\nPyPI page: https://pypi.org/project/DodonaCLI/#description\n\n**Contents**:\n1) [Disclaimers](#disclaimers)\n2) [Installation and updating](#installation-and-updating)\n3) [How to use](#how-to-use)\n4) [Flags that could be important](#flags-that-could-be-important)\n5) [Settings](#settings)\n6) [Tab-completion and man-pages](#tab-completion-and-man-pages)\n7) [Help, DodonaCLI freezes](#help-dodonacli-freezes)\n8) [Roadmap](#roadmap)\n\n\n## Disclaimers\n\n- DodonaCLI is an independent tool created by me, a student, and is not officially affiliated with the Dodona service or its team. Dodona, provided by the dedicated team at UGent University, offers an exceptional service, and this tool has been created as a complementary project. Only issues related to the Dodona website itself should be directed to the official Dodona support channels. Issues with the CLI tool should be posted on this [project\u2019s Issues](https://github.com/BWindey/DodonaCLI/issues).\n\n- Although the exercise-description formatting is mostly useable, do NOT rely on this for tests and exams! The printed description may be incomplete, or even incorrect. Please be aware of this!\n\n- I did my best to format the output of DodonaCLI in a nice manner. If this is not the case for your terminal, please reach out via the [Issues](https://github.com/BWindey/DodonaCLI/issues) to see if we can fix that. I use the Alacritty and Gnome terminal, so if you\u2019re using those, you can be mostly sure that what you see is intended.\n\n\n## Installation and updating\nBoth installation and updating happen through pip:\n```pip install DodonaCLI```\nand\n```pip install --upgrade DodonaCLI```\n\nYou can check for a new update with\n```dodona info check-update```\n\nAlternatively, you can `git clone https://github.com/BWindey/DodonaCLI && cd DodonaCLI`, and do `pip install -e .`. The `-e` flag ensures that when you change files (or did a `git pull`), the cli will use the new code.\nThis is mostly useful for those wanting to change/add to the code, or test new features on the develop-branch (not recommended for normal users).\n\n\n## How to use\nThere are three main things you can do with Dodona: displaying info (`dodona display`),\nselecting (`dodona select`) and posting exercises (`dodona post`).\nThe behaviour of displaying and selecting will depend on your current selection,\nwhich can be viewed with `dodona status`.\nYou can imagine it as a tree structure:\n- courses\n  - exercise series\n    - exercises\n\nIf nothing is selected, you\u2019ll need to select a course first, then an exercise series, then an exercise.\nYou can always see all your available options with `dodona display`.\nPosting a solution will only work if you have selected an exercise, and can be done with `dodona post <SOLUTION_FILE>`.\nThis tree-like structure also explains the name of the deselect-flag: `up` and `uptop`.\nTo select the next exercise, you don\u2019t need to go up and select the new one, you can use the `next` command.\n\nThe first time you use DodonaCLI, the program will ask you for an API token,\nwhich you can generate on your Dodona-profile page.\nThis will be stored in a file 'config.json' in the same directory as this python script.\nIf you ever delete this file, you\u2019ll need to re-enter your API token.\nYou can either keep a back-up of your token somewhere else,\nor just generate a new token whenever you (accidently) deleted your old token.\n\nIf there is some boilerplate code associated with an exercise,\nit will get printed out to the terminal once you select the exercise.\nYou can also find it in the file 'boilerplate'.\nYou can use it to write your solution in, and post it,\nbut be aware that this file gets overwritten when you select a new exercise that has boilerplate-code attached\n(not all do).\n\n\n## Flags that could be important\nThere currently are four flags that can be important when working with non-standard exercises.\n- --force\n- --hidden\n- --other\n- --use-link\n\nThey are all context-specific. A short explanation can be found in the help-pages, a slightly longer one here:\n\n### Force\nThis flag is used in combination with the `display` command, when viewing exercise-series and exercise-descriptions.\nIt will do its best to render the html and markdown of the web-page in your terminal.\nYou\u2019ll quickly see why this is hidden behind this flag: the formatting can be awful.\nFor some exercise-descriptions, this can, however, be a nice addition,\nand in the future the formatting-\"engine\" can improve.\n\n\n### Hidden\nThis flag is used in combination with the `select` command, when selecting an exercise-series that is hidden.\nSeries can be hidden when they are used in tests or exams, and to get to them, you\u2019ll receive a link to it from your\nteachers. This link will be of the form `.../series/<SERIES-ID>/?token=<TOKEN>`.\nThe only correct syntax to then select that hidden series with DodonaCLI is:\n    ```dodona select --hidden <TOKEN> <SERIES-ID>```\n\n\n### Other\nThis flag is used in combination with the `select` command, when selecting a course you\u2019re not registered for.\nThis allows you, for example, to select courses from previous years to try out those old tests or exams.\nYou cannot find these courses when using `display`,\nso you\u2019ll need the correct course-id to select it, not the course-name.\n\n### Use-link\nThis flag is used in combination with the `post` command,\nwhen posting a solution-file to a link provided at the first line of the solution-file.\nThe link has to include \"/courses/<COURSE-ID>\" and \"/activities/<ACTIVITIES-ID\"\nto know which exercise to submit your solution to.\nIt also has to start with \"https:<!-- comment to prevent link from appearing as real link-->//dodona.be/\".\nThis link is not included in the solution submitted to the Dodona servers; it is stripped out.\n\n\n## Settings\nDodonaCLI has some settings (starting from version 2024.5.20).\nCurrently they are only editable by editing the settings.json file directly.\nIn the future, there could be a sub-command to edit these in a more convenient way.\nThe current settings, with their default values, are:\n- `amount_feedback_context`: 3\n- `amount_feedback_tab`: -1\n- `amount_feedback_testcase`: 3\n- `amount_feedback_test`: 3\n- `amount_sub_exercise`: 10\n- `amount_sub_global`: -1 (-1 means that it will show everything Dodona gives)\n- `new_lines_above`: 1 (How many new lines above DodonaCLI output)\n- `new_lines_below`: 1\n- `paste_force_warning`: false\n- `display_series_after_select`: false\n- `display_exercises_after_select`: false\n- `display_exercise_after_select`: false\n\n\n\n## Tab-completion and man-pages\nTab-completion is supported for bash, fish and zsh. The easiest way to install it, is by following the short instructions at\nhttps://click.palletsprojects.com/en/8.1.x/shell-completion/#enabling-completion,\nwhere you replace all occurences of 'foo-bar' with 'dodona'.\n\nYou can also use my custom-written script for bash (if you're using bash), by downloading the autocomplete-script from\nhttps://github.com/BWindey/DodonaCLI/blob/master/dodonacli_completion_script.sh\nand source it in your ~/.bashrc.\nI personally use this custom one, as it allows me more control over the completion.\nThe disadvantage over using this, however, is that you'll need to redownload it if it ever changes.\nI'll promise here and now that if I don't forget, I will always mention in the changelog\n(`dodona info changelog`), that you need to download the new completion-script.\n\nA while ago, I strongly recommended the custom script, because the other way took about 200ms to complete, which felt slow, but due to some code-restructuring, the completion happens in around 50ms.\n\nThere is also a manual page available (very prefessional).\nYou can download [\"dodonacli.1.gz\"](https://github.com/BWindey/DodonaCLI/blob/master/man-page/dodonacli.1.gz) and save this in a folder included in `$(manpath)`.\nThis will have to be downloaded again if it is updated. I'll let you know in the changelogs.\n\n\n## Help, DodonaCLI freezes\nSince I just got this situation, I wanted to tell you how I fixed it.\nMy computer didn\u2019t succeed in making any network requests over IPv6, and thus waited and waited and waited ...\nTo fix this, I had to disable IPv6 entirely on my own pc.\nThis is not something I\u2019ll show you how to do, you\u2019ll have to do some research on the internet.\nBefore trying that, confirm first if this is indeed the issue by running `wget` with --inet6-only and --inet4-only\nto see if this is indeed the issue.\n\n\n## Roadmap\nThis section has a bunch of ideas for me to work on, but also for you, the potential contributor!\nRemember to look at the recent branches/commits to see if I\u2019m not working on one of these:\n- user-settings (f.e. auto-download of files, language, formatting, number of submissions shown, ...)\n  - language\n  - whether to save feedback to a file\n  - auto download links from sandbox.dodona when selecting exercise\n- easy (automatic?) downloading of files mentioned in exercise description\n- add connection time-out to prevent long waiting when IPv6 doesn\u2019t want to work along\n- add support for more languages syntax checkers\n- caching some info for faster navigation and/or autocompletion\n- add indicator to series to mark if all their exercises are completely solved (maybe fetch from html-version)\n- get exercise-names via html-parsing for a submission list to only need 1 API call (instead of 30)\n",
    "bugtrack_url": null,
    "license": "MIT License\n        \n        Copyright (c) 2024 Bram Windey\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy\n        of this software and associated documentation files (the \"Software\"), to deal\n        in the Software without restriction, including without limitation the rights\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n        copies of the Software, and to permit persons to whom the Software is\n        furnished to do so, subject to the following conditions:\n        \n        The above copyright notice and this permission notice shall be included in all\n        copies or substantial portions of the Software.\n        \n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n        SOFTWARE.\n        ",
    "summary": "A CLI tool for Dodona",
    "version": "2025.1.26",
    "project_urls": {
        "Homepage": "https://github.com/BWindey/DodonaCLI"
    },
    "split_keywords": [
        "dodona",
        " cli"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "f05c35783a23baf3c522b829ba835f9484c0a6a27d9a8272afe86c1c4482ec0a",
                "md5": "1a86ddc060d856de7ce254504683d760",
                "sha256": "e410c868abb2e50697a9cd390e258a9b096cd1eb1ac9a2a74bb558988717bbcb"
            },
            "downloads": -1,
            "filename": "DodonaCLI-2025.1.26-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1a86ddc060d856de7ce254504683d760",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 37651,
            "upload_time": "2025-01-26T15:23:47",
            "upload_time_iso_8601": "2025-01-26T15:23:47.985908Z",
            "url": "https://files.pythonhosted.org/packages/f0/5c/35783a23baf3c522b829ba835f9484c0a6a27d9a8272afe86c1c4482ec0a/DodonaCLI-2025.1.26-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "1d2d8e13e16dba2a38f668a3d0d44d48e04390f0a363e2cffbae129da401c296",
                "md5": "02c0e0f47fb135977b7ca7af854d19e3",
                "sha256": "bb68df16759e81ca09180dcd3d3f51397d274e72b781e7bc937a8cf62d11963f"
            },
            "downloads": -1,
            "filename": "dodonacli-2025.1.26.tar.gz",
            "has_sig": false,
            "md5_digest": "02c0e0f47fb135977b7ca7af854d19e3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 35728,
            "upload_time": "2025-01-26T15:23:49",
            "upload_time_iso_8601": "2025-01-26T15:23:49.811018Z",
            "url": "https://files.pythonhosted.org/packages/1d/2d/8e13e16dba2a38f668a3d0d44d48e04390f0a363e2cffbae129da401c296/dodonacli-2025.1.26.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-26 15:23:49",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "BWindey",
    "github_project": "DodonaCLI",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "dodonacli"
}
        
Elapsed time: 1.40584s