{
"info": {
"author": "Aleix Bon\u00e9 (Leix_b)",
"author_email": "abone9999@gmail.com",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Education",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Education"
],
"description": "jutge\\_cli: a command line interface for `jutge.org`_\n=========================================================================\n\n#. `Intro`_\n#. `Installation`_\n\n #. `Global installation (root)`_\n #. `Archlinux PKGBUILD`_\n #. `Installation using virtualenv (no root)`_\n\n#. `Usage`_\n#. `Configuration`_\n\n #. `Basic options`_\n #. `Problem sets`_\n #. `Login credentials`_\n\n#. `Authenticate to jutge`_\n\n #. `login command`_\n #. `cookie command`_\n #. `cookie flag`_\n\n#. `Commands`_\n\n #. `add-test (add)`_\n #. `archive`_\n #. `check`_\n #. `cookie`_\n #. `download (down)`_\n #. `login`_\n #. `new`_\n #. `show`_\n #. `test`_\n #. `import`_\n #. `upload (up)`_\n\n#. `License`_\n\nIntro\n-----\n\n``jutge_cli`` is a python3 console application that aims to automate common\ntasks when working with `jutge.org`_ problems. Those tasks\ninclude:\n\n* Creating new files named after problem title given the problem code\n* Displaying statement and public test cases of a given problem\n* Compiling and testing a program against public test cases\n* Uploading program solutions to `jutge.org`_\n* Checking `jutge.org`_ results for last submissions or for\n a specific problem.\n* Adding ant testing against custom test cases to a problem\n* Batch uploading problems from a given problem set\n* Batch creating new files of a given problem set\n* Extract and rename problem solutions from a `jutge.org`_ zip file export\n to a specific folder.\n\n\nInstallation\n------------\n\n``jutge_cli`` is included in `pypi `_\nand as such, it can be installed through ``pip3``.\n\n\nGlobal installation (root)\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nTo install python module run:\n\n.. code:: sh\n\n sudo pip3 install jutge_cli\n\nThis should install all dependencies and create an executable named\n``jutge`` in ``/usr/bin/jutge``.\n\n\nArchlinux PKGBUILD\n~~~~~~~~~~~~~~~~~~\n\nThere is also a ``PKGBUILD`` included in the repository for arch linux users.\n\n\nInstallation using virtualenv (no root)\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nYou can install this program inside of a python3\n`virtualenv `_:\n\n.. code:: sh\n\n virtualenv -p /usr/bin/python3 jutge_cli_venv && cd jutge_cli_venv\n source bin/activate\n pip3 install jutge_cli\n\nOnce the above commands complete successfully, the ``jutge`` will be installed\ninside the ``bin`` folder of the virtualenv. It is recommended to link it to\nthe user ``bin`` folder and add it to your ``$PATH``.\n\n.. code:: sh\n\n mkdir ~/bin\n ln -s bin/jutge ~/bin/jutge\n\nRemember to add bin to your path by adding the following line to ``.bashrc``\nor equivalent:\n\n.. code:: sh\n\n export PATH=$PATH:~/bin\n\n\nUsage\n-----\n\nTo use ``jutge_cli`` run the command ``jutge`` followed by the\nsubcommand you want to execute:\n\n.. code:: sh\n\n jutge [SUBCOMMAND] [SUBCOMMAND_OPTIONS]\n\nFor the program to work you will have to either specify the code of the\nproblem you want to test (``-c`` flag) or rename the program file so\nthat it begins with the code. The code must match the following regular\nexpression: ``[PGQX]\\d{5}_(ca|en|es)`` (note that the code includes the\nlanguage although it is not mandatory).\n\n\nConfiguration\n-------------\n\nYou can configure default parameters through the YAML configuration file:\n``~/.jutge_cli.yaml``.\n\nBasic options\n~~~~~~~~~~~~~\n\nThe following example lists all the basic options and\ntheir default values:\n\n.. code:: yaml\n\n database : ~/Documents/jutge/DB\n regex : '[PGQX]\\d{5}_(ca|en|es)'\n diff-prog : diff\n diff-flags : -y\n inp-suffix : inp\n cor-suffix : cor\n folder : ~/Documents/jutge/Done\n\nThose options can also be specified using the flags with the same name.\n\nAlthough you can change the regex it is **not** recommended to do so since bad\nregex may break correct functionality.\n\n\nProblem sets\n~~~~~~~~~~~~\n\nYou can also add problem sets with the ``problem_sets`` group. These will\nmake the commands ``new``, ``archive`` and ``update`` classify problems into\nfolders:\n\n.. code:: yaml\n\n problem_sets:\n P1: [P19724, P34279, P37297, P37469, P42042, P51126, P51352, P61634, P66529, P67171, P70955, P82374, P89265, P92351, P98960, P99182, X54725, X59678, X64734, X89070]\n P2: [P27341, P28754, P29448, P32046, P34451, P35547, P37500, P55622, P59539, P59875, P60816, P64976, P65171, P74398, P79784, P85370, P97156, X30229, X32391, X80452]\n P3: [P13623, P19991, P29973, P32533, P61061, P79817, P80660, P87323, P96767, X01646, X08783, X26853, X29759, X59091, X84338, X98097]\n\nThe above configuration file will save problems ``P19724, P34279...`` into\nfolder ``P1``, problems ``P27341, P28754...`` into ``P2`` and so on.\n\n\nLogin credentials\n~~~~~~~~~~~~~~~~~\n\nYou can also provide login credentials in the configuration file inside\nthe group ``login``:\n\n.. code:: yaml\n\n login:\n email: myemail@mydomain.com\n password: mypassword\n\nYou can omit either email, password or both and the login command will\nprompt the user for input when issued.\n\n\nAuthenticate to jutge\n---------------------\n\nTo upload problem solutions or to access private problems (the ones which code\nstarts with ``X``) you must be logged in into `jutge.org`_.\nThe preferred method to login is through the ``jutge login`` command although\nthere are 2 more methods involving cookies.\n\n\nlogin command\n~~~~~~~~~~~~~\n\nIssuing the command ``jutge login`` will prompt the user for their email and\npassword and save the session cookie for next use. If email or\npassword are already provided in `Login credentials`_ it will not prompt the\nuser to input them. For more details on the command see `login`_\n\n\ncookie command\n~~~~~~~~~~~~~~\n\nThe command ``jutge cookie`` accepts a cookie as a parameter and will\nstore it for next use. For more details on the command see `cookie`_\n\n\ncookie flag\n~~~~~~~~~~~\n\nYou can also explicitly provide a cookie to each subcommand call through the\n``--cookie`` flag:\n\n.. code:: sh\n\n jutge --cookie MY_COOKIE download -c X00000\n\n\nGlobal flags\n------------\n\nMost of the flags depend on the subcommands, but there are some global\nflags that effect all subcommands. Those are:\n\n- ``--regex MY_REGEX`` regular expression used to extract codes from filenames\n- ``--cookie MY_COOKIE`` Cookie used to connect to `jutge.org`_\n- ``--database FOLDER`` Change database location\n- ``--no-download`` If this flag is provided, ``jutge_cli`` will not attempt\n to connect to the internet\n\n\nCommands\n--------\n\n#. `add-test (add)`_\n#. `archive`_\n#. `check`_\n#. `cookie`_\n#. `download (down)`_\n#. `login`_\n#. `new`_\n#. `show`_\n#. `test`_\n#. `import`_\n#. `upload (up)`_\n\nadd-test (add)\n~~~~~~~~~~~~~~\n\nThis command adds a custom test case into the database. A test case consists\nof two files, the input that will be feed to the program and the expected\noutput or solution. Those files can be provided through the flags ``-i``\n(input) and ``-o`` (expected output) or if omitted the user will be prompted to\ninput them manually through stdin.\n\nThe following example will add the contents of files ``inp`` and ``cor`` to\nthe database as test cases for the problem ``P00001_ca``\n\n.. code:: sh\n\n # Add the contents of inp and cor to the database for problem P00001_ca:\n jutge add-test -i inp -o cor P00001_ca_prog.cpp\n\n # Prompt the user to enter the input and expected output and add them to\n # the database for problem P00001_ca:\n jutge add-test P00001_ca_prog.cpp\n\n\narchive\n~~~~~~~\n\nMove problem file to the archive folder. This folder can be\nchanged through the ``-f`` flag. To overwrite files already in the folder\nuse the ``--overwrite`` flag.\n\nThe default behaviour is to move the file to the folder, if you want to copy\nit instead use the ``--copy`` flag.\n\nThe following example will move the file ``P00001_ca_prog.cpp`` to the\nfolder ``Accepted`` and overwrite if already in the folder.\n\n.. code:: sh\n\n jutge archive --folder Accepted/ P00001_ca_prog.cpp --overwrite\n\n\ncheck\n~~~~~\n\nChecks submissions to `jutge.org`_\nand displays them in the terminal. The program will return 0 if the last\nsubmission's verdict is ``AC`` or ``100/100`` and 1 otherwise.\n\nThis subcommand accepts 3 flags:\n\n* ``--last`` show only the last submission\n* ``--reverse`` order the output so that the last submission is on top\n* ``--code`` check if a given problem code is accepted, rejected or not done\n yet\n\n\ncookie\n~~~~~~\n\nAdd cookie provided as first argument to a temporary directory so it is used\nfor next commands. If the first argument is ``delete`` the current cookie\nwill be deleted and if the argument is ``print`` or ``show`` it will\noutput the current saved cookie.\n\nThe command will check that the provided cookie is valid before saving the\nvalue, to skip this check use the flag ``--skip-check``.\n\n\ndownload (down)\n~~~~~~~~~~~~~~~\n\nThis command will attempt to download the html page and zip file corresponding\nto the given problem from `jutge.org`_ and add them to the\ndatabase. Either a code flag (``-c``) or a program file (``-p``) must be\nprovided.\n\nNote that other commands that depend on the database files will\nautomatically try to download them if they don't exist and therefore\nthis command is only useful when populating the database in advance.\n\nThe following example will populate the local database for problem\n``P00001_en``:\n\n.. code:: sh\n\n jutge download P00001_en\n\n\nlogin\n~~~~~\n\nPrompt the user to input their credentials and login to `jutge.org`_. If\ncredentials are already specified in the configuration file (`Login\ncredentials`_) it will not prompt for them.\n\nThe flags ``--email`` and ``--password`` can be used to specify the credentials\nwithout prompting and to override the ones specified in the configuration file.\n\n\nnew\n~~~\n\nThis command must be followed by a code. It will fetch the problem title\nfrom the code and create a new file whose name is the code followed by\nthe title. The ``--extension`` or ``-e`` flag can be used to specify the\nextension of the file (defaults to ``cpp``).\n\nIf flag ``--problem-set`` is provided, all programs in the specified problem\nset will be created inside a folder named after the problem set.\n\nThe following example will populate create a new python file named\n``P87523_ca_-_Hola-ad\u00e9u.py``\n\n.. code:: sh\n\n jutge new P87523_ca --extension py\n\n\nshow\n~~~~\n\nThis command provides 3 sub commands to print information about the problem.\nThose are:\n\n- ``title`` print problem title\n- ``stat`` print statement\n- ``cases`` print test cases in database\n\nBy default ``stat`` will parse the problem statement through ``pypandoc`` to\noptimize the output for terminal if you prefer raw HTML or ``pypandoc`` takes\nto much time to parse the output you can use the flag ``--html``.\n\nThe following example will print all cases in the database for the problem\n``P87523_ca`` (if any).\n\n.. code:: sh\n\n jutge show cases P87523_ca\n\n\ntest\n~~~~\n\nThis is the most useful command in the tool set. It allows to test your\ncode against all the test cases found in the database and output side by\nside differences using ``diff``.\n\nThe command takes a file that can be either an executable or source file or\nscript of a supported language executable file as parameter and tests it\nagainst the test cases in the database folder. Note that if the program if a\nsource file that needs to be compiled, ``jutge_cli`` will compile it to\na file named after the original name with extension ``.x``.\n\nYou can specify an other program to act as ``diff`` (such as ``colordiff``) and\nits flags (separated by commas) through ``--diff-prog`` and ``--diff-flags``.\n\nThe following example will test the executable ``P87523_ca_prog.x`` against\nthe test cases for problem P87523\\_ca. The expected output and the output of\nthe program will be shown side by side using ``colordiff``.\n\n.. code:: sh\n\n jutge test P87523_ca_prog.x --diff-prog colordiff\n\n\nimport\n~~~~~~\n\nThis command extracts all accepted submissions from a `jutge.org`_ zip file,\nrenames them according to their title and adds them to the archive folder\nthat can be specified through the ``-f`` flag or in the main configuration\nfile. Note that the zip file must be the one downloaded from your\n`jutge.org`_ profile.\n\n.. code:: sh\n\n jutge import problems.zip\n\n\nupload (up)\n~~~~~~~~~~~\n\nThis command uploads a file to `jutge.org`_ to be\nevaluated. Note that you must have a valid cookie previously saved by ``jutge\ncookie PHPSSID`` or you can provide it through the ``--cookie`` flag. As of\nnow, the program cannot report if the upload was successful so you will have to\ncheck your submissions page manually. The compiler to use will be determined by\nthe filename extension but you can specify another one through the\n``--compiler`` flag.\n\n.. code:: sh\n\n jutge upload P00001_ca_prog.cpp --compiler 'G++'\n\nIf the flag ``--problem-set`` the command will upload all problems from the\nspecified set found in the current working directory or in the set folder in\nthe current working directory. (Keep in mind that `jutge.org`_ limits the\nnumber of submissions to 20 per hour so it is discouraged to use this flag\nwith large problem sets)\n\nBy default upload will test all problems against public test cases in the\ndatabase (not including custom ones). You can skip those checks with the flag\n``--skip-test``\n\nIf you want to check the submitted problem verdict directly after upload, use\nthe flag ``--check`` which will wait for the judge verdict and output it.\n\nLicense\n-------\n\nThis software is licensed under the `GPL v3 license\n`_.\n\n.. _jutge.org: https://jutge.org\n",
"description_content_type": "",
"docs_url": null,
"download_url": "",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "http://github.com/Leixb/jutge_cli",
"keywords": "jutge jutge.org jutge_cli",
"license": "GPL3",
"maintainer": "",
"maintainer_email": "",
"name": "jutge_cli",
"package_url": "https://pypi.org/project/jutge_cli/",
"platform": "",
"project_url": "https://pypi.org/project/jutge_cli/",
"project_urls": {
"Homepage": "http://github.com/Leixb/jutge_cli"
},
"release_url": "https://pypi.org/project/jutge_cli/2.2.3/",
"requires_dist": null,
"requires_python": "",
"summary": "CLI to automate tests for jutge.org problems",
"version": "2.2.3"
},
"last_serial": 3897691,
"releases": {
"2.1.10": [
{
"comment_text": "",
"digests": {
"md5": "2782a82fa12c53481520cc9d270944c3",
"sha256": "120fbf51d2b6cc834a1649e5b6f5da18dab1063cd2ebcb6176cf85054e09e382"
},
"downloads": -1,
"filename": "jutge_cli-2.1.10.tar.gz",
"has_sig": false,
"md5_digest": "2782a82fa12c53481520cc9d270944c3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 42085,
"upload_time": "2017-12-23T17:26:26",
"url": "https://files.pythonhosted.org/packages/2c/75/80373e798eaa87d76ceae4009687ab95cb15d1de3c3581ddce130d207cb2/jutge_cli-2.1.10.tar.gz"
}
],
"2.1.11": [
{
"comment_text": "",
"digests": {
"md5": "8093fcc680226b3517cc68fb3deec95f",
"sha256": "ba9b25424d5fe196e3354aa1384a24ab0249e489595a3ee1adfd84e39df2eeec"
},
"downloads": -1,
"filename": "jutge_cli-2.1.11.tar.gz",
"has_sig": false,
"md5_digest": "8093fcc680226b3517cc68fb3deec95f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 42165,
"upload_time": "2017-12-29T11:22:40",
"url": "https://files.pythonhosted.org/packages/e0/09/811a3c0371c679dbab91a9211f06d4b2ca05a45804ce70c4e39c4011dfd5/jutge_cli-2.1.11.tar.gz"
}
],
"2.1.7": [
{
"comment_text": "",
"digests": {
"md5": "990d41557bd3716429ee56f9fa20f5ec",
"sha256": "83ab5c421e2c436d394a6b5a69d5f7bf0cdbafdb1ca5f002286823674283f75d"
},
"downloads": -1,
"filename": "jutge_cli-2.1.7.tar.gz",
"has_sig": false,
"md5_digest": "990d41557bd3716429ee56f9fa20f5ec",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 41812,
"upload_time": "2017-10-30T19:23:41",
"url": "https://files.pythonhosted.org/packages/7c/15/8a2eca67543f5e55be19c5eca4733877a9e089a410fd04f475b21d411c54/jutge_cli-2.1.7.tar.gz"
}
],
"2.1.8": [
{
"comment_text": "",
"digests": {
"md5": "b9fa34f92a9f09d191c51695b1d8bf52",
"sha256": "29d1e109b476e0c9e515f9b1e5c84e7d5602addce75b13886a44b62af447c044"
},
"downloads": -1,
"filename": "jutge_cli-2.1.8.tar.gz",
"has_sig": false,
"md5_digest": "b9fa34f92a9f09d191c51695b1d8bf52",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 41861,
"upload_time": "2017-11-19T22:46:25",
"url": "https://files.pythonhosted.org/packages/a0/b9/2c6eda889e5c986a6a005b34462ffe5b98fe912f870a51547d9c7d452a3a/jutge_cli-2.1.8.tar.gz"
}
],
"2.1.9": [
{
"comment_text": "",
"digests": {
"md5": "26b82dd72c75d929566a943bbb283eeb",
"sha256": "c1e9539088387fd77edcddd198e34037d632eac5b1cb489b587c40de04d824b4"
},
"downloads": -1,
"filename": "jutge_cli-2.1.9.tar.gz",
"has_sig": false,
"md5_digest": "26b82dd72c75d929566a943bbb283eeb",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 41952,
"upload_time": "2017-12-22T11:26:02",
"url": "https://files.pythonhosted.org/packages/9c/7e/206d5ed8e2a709ce109ae3243e60987feba58cfbc90e791072ca337edb5e/jutge_cli-2.1.9.tar.gz"
}
],
"2.1.9.post1": [
{
"comment_text": "",
"digests": {
"md5": "3eae2534822525ee578006df3985f20f",
"sha256": "dfb47eb531f0cda1d9c821312a9fe42beca0998fac6a8717a55e447d5708b394"
},
"downloads": -1,
"filename": "jutge_cli-2.1.9.post1.tar.gz",
"has_sig": false,
"md5_digest": "3eae2534822525ee578006df3985f20f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 41967,
"upload_time": "2017-12-22T11:34:51",
"url": "https://files.pythonhosted.org/packages/a1/4b/b7914eb6ee5c55700ffc3f384995c4e0cdc4d143bb818dee8e253f8ffc7c/jutge_cli-2.1.9.post1.tar.gz"
}
],
"2.2.0": [
{
"comment_text": "",
"digests": {
"md5": "aee48b02800b608028240d3f771b2cea",
"sha256": "b8a28c0ff244350e8fde51735734845790fec0cbf39e3a013964fc32d5a8f50c"
},
"downloads": -1,
"filename": "jutge_cli-2.2.0.tar.gz",
"has_sig": false,
"md5_digest": "aee48b02800b608028240d3f771b2cea",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 42164,
"upload_time": "2017-12-31T15:03:25",
"url": "https://files.pythonhosted.org/packages/14/be/74f12efb68d6e981c37c7098458202e84e6403525acf48652eb870f5a125/jutge_cli-2.2.0.tar.gz"
}
],
"2.2.3": [
{
"comment_text": "",
"digests": {
"md5": "131fffb25e0abc88132c2773044839af",
"sha256": "d07d3d25173605a4e96aad85d61c663a305d8c4453a11e98a5eae37d9246e152"
},
"downloads": -1,
"filename": "jutge_cli-2.2.3.tar.gz",
"has_sig": false,
"md5_digest": "131fffb25e0abc88132c2773044839af",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 42464,
"upload_time": "2018-05-25T06:14:59",
"url": "https://files.pythonhosted.org/packages/88/fd/af6849f3f6359bef26e5d60b3b1d27bbf9e917cce8a7cab4045e9184cbf4/jutge_cli-2.2.3.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "131fffb25e0abc88132c2773044839af",
"sha256": "d07d3d25173605a4e96aad85d61c663a305d8c4453a11e98a5eae37d9246e152"
},
"downloads": -1,
"filename": "jutge_cli-2.2.3.tar.gz",
"has_sig": false,
"md5_digest": "131fffb25e0abc88132c2773044839af",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 42464,
"upload_time": "2018-05-25T06:14:59",
"url": "https://files.pythonhosted.org/packages/88/fd/af6849f3f6359bef26e5d60b3b1d27bbf9e917cce8a7cab4045e9184cbf4/jutge_cli-2.2.3.tar.gz"
}
]
}