{ "info": { "author": "Matthew Miguel", "author_email": "mmiguel6288code@gmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: Implementation :: CPython" ], "description": "# doctestify\n\ndoctestify is a tool to make it easier to make doctests.\n\n## What are doctests and why should I care?\nDoctests are snippets of text that resemble a Python interactive mode session.\nDoctests can be embedded in the docstrings within your code in order to serve two purposes:\n\n1. To provide executable examples to users so they can better understand how to use your code\n\n2. To support automated testing by running these lines and confirming the expected outputs are produced\n\n\nA docstring is a block of inline text within your code at the start of a module, class, or function to document the function. When the builtin help() function is called on an object, the docstrings for that object's class and methods are displayed. Additionally there are a number of tools, such as sphinx or pdoc that generate polished documentation files by scanning docstrings within a project.\n\n## How to use doctestify\nFirst open a shell or command line window and navigate to the folder containing the packages and/or modules of interest.\nThen run:\n ```\n $ python -m doctestify\n\n Starting doctestify command line interface...\n Welcome to the doctestify shell. Type help or ? to list commands.\n\n (doctestify)$\n ```\n\nYou will then enter the doctestify shell, which was designed to look and feel very similar to a unix shell.\nThe big difference is that instead of navigating through actual files/directories, the doctestify shell navigates through python packages, modules, classes, and functions. Tab-completion is supported.\n\nIn the shell, you can type help to list all the commands.\n ```\n (doctestify)$ help\n\n Documented commands (type help ):\n ========================================\n EOF cd cwd doc doctest doctestify help ls pwd quit source\n ```\n\nYou can also type help followed by a command to get information about that particular command:\n ```\n (doctestify)$ help ls\n\n Help: (doctestify)$ ls\n This will show all items contained within the currently targeted item.\n e.g. for a package, this would list the modules\n e.g. for a module, this would list the functions and classes\n etc\n Note that using this command may result in importing the module containing the currently targeted item.\n Note that setup.py files will be purposefully excluded because importing/inspecting them without providing commands results in terminating python.k\n ```\n\nUse the pwd, cd, and ls commands to navigate through different items:\n\n ```\n doctestify)$ ls\n doctestify package directory\n test_pkg package directory\n tests package directory\n (doctestify)$ cd test_pkg\n (doctestify)$ cd test_subpkg.test_mod.f\n (doctestify)$ pwd\n /test_pkg.test_subpkg.test_mod.f\n ```\n\nOnce you are navigated to the item of interest, run the doctestify command to enter a recorded interactive python session. All items from the containing module of the targeted item will automatically be imported. You essentially just type the doctest inputs, and the interactive session will evaluate them and display the outputs. When done, press Ctrl+D to exit the interactive session. At this point, doctestify will write the recorded actions into the docstring of the targeted object. Afterwards, it will run doctests on that object to ensure there are no issues. If any issues are encountered, the original file will be restored and the problematic file will be saved with a special suffix in the same folder.\n\n ```\n (doctestify)$ doctestify\n Testing doctest execution of original file\n ...done: Fail count = 0, Total count = 0\n Entering interactive console\n Doctest insertion targeting object test_pkg.test_subpkg.test_mod.f within /home/mtm/interspace/doctestify/test_pkg/test_subpkg/test_mod.py\n Press Ctrl+D to stop writing code and incorporate session into the docstring of the targeted object\n To abort this session without writing anything into the targeted file, call the exit() function\n >>> from test_pkg.test_subpkg.test_mod import * # automatic import by doctestify\n >>> f(20)\n 20\n >>>\n Writing doctest lines to file\n Testing doctest execution of new file\n ...done: Fail count = 0 (old=0), Total count = 1 (old=0)\n File successfully updated\n\n ```\n\nYou can use the doc or source commands to verify the doctest was written in:\n\n ```\n (doctestify)$ doc\n >>> f(20)\n 20\n\n (doctestify)$ source\n File: /home/mtm/interspace/doctestify/test_pkg/test_subpkg/test_mod.py\n def f(x):\n \"\"\"\n >>> f(20)\n 20\n \"\"\"\n return x\n\n ```\n\nYou can also change the current working directory that the doctestify shell is scanning for modules and packages with.\nYou can navigate the filestystem using chdir, listdir, and getcwd, which do the same things as the standard python os module methods of the same name.\nTab-completion is supported for chdir and listdir.\n\nTo exit the doctest shell, just press Ctrl+D or type the quit command.\n\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mmiguel6288code/doctestify", "keywords": "doctest,doctests,docstring,docstrings,tests,testing,test", "license": "MIT", "maintainer": "Matthew Miguel", "maintainer_email": "mmiguel6288code@gmail.com", "name": "doctestify", "package_url": "https://pypi.org/project/doctestify/", "platform": "", "project_url": "https://pypi.org/project/doctestify/", "project_urls": { "Homepage": "https://github.com/mmiguel6288code/doctestify" }, "release_url": "https://pypi.org/project/doctestify/1.1.4/", "requires_dist": null, "requires_python": "", "summary": "", "version": "1.1.4" }, "last_serial": 5966142, "releases": { "1.0.3": [ { "comment_text": "", "digests": { "md5": "39d7e40f0278833c7767437bdaacfb1b", "sha256": "6a9e09faead7107ddbb98673cba1357daa7c27865150be54263b75456a4b53e3" }, "downloads": -1, "filename": "doctestify-1.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "39d7e40f0278833c7767437bdaacfb1b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8690, "upload_time": "2019-10-02T04:11:44", "url": "https://files.pythonhosted.org/packages/36/a2/a5a5b7562365ccd6d7e2008f8dc9c3a6ec157eb43dc7e5c8e9e6f5b63896/doctestify-1.0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e1f01c64473c5ad1aacc7c1866261ce3", "sha256": "4dbc4644fbc49867bb1d5183186e144a49261c7a0180ed23e01e5a0e051b5555" }, "downloads": -1, "filename": "doctestify-1.0.3.tar.gz", "has_sig": false, "md5_digest": "e1f01c64473c5ad1aacc7c1866261ce3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5931, "upload_time": "2019-10-02T04:11:46", "url": "https://files.pythonhosted.org/packages/10/40/2f44611df0c9fd020d372804f2feac04ce3543ce0960e40af0c2394a6fb6/doctestify-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "1e54e456323f6f5b5ecfb471f331d5cc", "sha256": "81c917bb4b50367ab22e588776a616024ffdbaaca342f5a0e60fbb132278fca0" }, "downloads": -1, "filename": "doctestify-1.0.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1e54e456323f6f5b5ecfb471f331d5cc", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9039, "upload_time": "2019-10-03T04:17:34", "url": "https://files.pythonhosted.org/packages/84/df/b704a65a4718614e7b88622dc6bf404532c5ab10ece47a48ade0aa8f0fff/doctestify-1.0.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a3d11eeb819540acd5b3b8c1e9056672", "sha256": "1d794403c0daf39ba38417335d4f0c7ef7a84722189fef5593fb02bef33ae292" }, "downloads": -1, "filename": "doctestify-1.0.4.tar.gz", "has_sig": false, "md5_digest": "a3d11eeb819540acd5b3b8c1e9056672", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6456, "upload_time": "2019-10-03T04:17:36", "url": "https://files.pythonhosted.org/packages/74/ff/ad0e707e4a1d9b3cd854a81b4893d663c454bc11690b4de33267955acf12/doctestify-1.0.4.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "bbf81f3bc0e908ce79a1a58957ad9f37", "sha256": "92967e104a24ce820a1a7ca7014289b39cb87dcd108239c5048d924746ddc8f3" }, "downloads": -1, "filename": "doctestify-1.0.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "bbf81f3bc0e908ce79a1a58957ad9f37", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9044, "upload_time": "2019-10-03T04:38:31", "url": "https://files.pythonhosted.org/packages/db/20/f446675d9e6d63befd1df00ea7a70612381d4c1c619b8f63ee61f86f16ef/doctestify-1.0.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3420d40beb51e316e2365791fb9f4492", "sha256": "48c40d46182618368f5404bbc031c9daaea556afa68d25ac5ba5663602aab80c" }, "downloads": -1, "filename": "doctestify-1.0.5.tar.gz", "has_sig": false, "md5_digest": "3420d40beb51e316e2365791fb9f4492", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6460, "upload_time": "2019-10-03T04:38:32", "url": "https://files.pythonhosted.org/packages/a6/10/f3a2f10d0ce6b3d139260e45f6e4b33e8e1d50d647191e5f036d4160b14d/doctestify-1.0.5.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "527dd75942dc715b6fa56072efb62441", "sha256": "79f3d589c94663fda98a8aae10675d346915f6b6f5274d274e90f49475c1928a" }, "downloads": -1, "filename": "doctestify-1.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "527dd75942dc715b6fa56072efb62441", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 13218, "upload_time": "2019-10-05T07:32:22", "url": "https://files.pythonhosted.org/packages/42/8c/2d97073bc11233814d66fcef54f83086917b8d2a2ce19366214715adeb0b/doctestify-1.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "efc119c4d79affaece738afaab6b7b9f", "sha256": "85bdf574f14d462b8414bec57151dcebdc8ccda850d07f4b7b6f218b9e017766" }, "downloads": -1, "filename": "doctestify-1.1.0.tar.gz", "has_sig": false, "md5_digest": "efc119c4d79affaece738afaab6b7b9f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9536, "upload_time": "2019-10-05T07:32:24", "url": "https://files.pythonhosted.org/packages/ef/bc/a54a3cf4fff08ffc00760a32670931e2f17d205a5840d811087bef35f6ab/doctestify-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "316ea0c8679b345ee7278f0f6bdd1cbe", "sha256": "87110ece3755be136e1890021b64f8b981601b3fe0612e4ddc5e95d4338c1bea" }, "downloads": -1, "filename": "doctestify-1.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "316ea0c8679b345ee7278f0f6bdd1cbe", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 13751, "upload_time": "2019-10-05T22:37:36", "url": "https://files.pythonhosted.org/packages/33/73/56c840f48d02d569843dd61ca3739ba98c33f2f3c4784a86c0eba1ccc2ed/doctestify-1.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a6f2f7b2ca5a5acfab736d12c7fae48e", "sha256": "beb14499c8410c9246ba10d6acd5f4e18ebba90e84a9681ec3c7d09c5c6dc40f" }, "downloads": -1, "filename": "doctestify-1.1.1.tar.gz", "has_sig": false, "md5_digest": "a6f2f7b2ca5a5acfab736d12c7fae48e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11209, "upload_time": "2019-10-05T22:37:38", "url": "https://files.pythonhosted.org/packages/14/a3/32f5fa9bcae2ba63b4ee085077db98bf9befbcb457c0e340a99838be6d89/doctestify-1.1.1.tar.gz" } ], "1.1.2": [ { "comment_text": "", "digests": { "md5": "3af67ce01a3be04aa2e35a7925606522", "sha256": "656c9a5ba0765dad90c757011e576d7e69dcf49e88c53b305d76f697ada08982" }, "downloads": -1, "filename": "doctestify-1.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "3af67ce01a3be04aa2e35a7925606522", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 14024, "upload_time": "2019-10-09T03:23:50", "url": "https://files.pythonhosted.org/packages/bc/dd/58705229fab09751dd4ab5584707f065471edb490d2219e20b4799607caf/doctestify-1.1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "afb96654ef10fedc3cc4baf8bd6d5207", "sha256": "840973d3e81eb94880499fb18da3ebb4d8577bd6cc01d75b39c39505e71055b9" }, "downloads": -1, "filename": "doctestify-1.1.2.tar.gz", "has_sig": false, "md5_digest": "afb96654ef10fedc3cc4baf8bd6d5207", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11460, "upload_time": "2019-10-09T03:23:52", "url": "https://files.pythonhosted.org/packages/77/67/5f8bc3f5894321fe3db42922aae36f59d8521653ede315c4e1dcfdcc14c5/doctestify-1.1.2.tar.gz" } ], "1.1.3": [ { "comment_text": "", "digests": { "md5": "9263cff9ec550af026fd606372b64dc4", "sha256": "66c9488950a0f82b9c10d819699232785d6a323a1adee41fdcc7431f95fc2f39" }, "downloads": -1, "filename": "doctestify-1.1.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9263cff9ec550af026fd606372b64dc4", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 14650, "upload_time": "2019-10-11T19:41:47", "url": "https://files.pythonhosted.org/packages/92/08/b7623031e7f30e85dcd5714a852c02ee65ae82e6d0624316fb2b6c75b76f/doctestify-1.1.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "65c29a211f74149b001ce24240c7798b", "sha256": "b16978d4bedbfc1794b01a3a9a02b21c48629a4ca0fbf6ea33793f9ca0799b2b" }, "downloads": -1, "filename": "doctestify-1.1.3.tar.gz", "has_sig": false, "md5_digest": "65c29a211f74149b001ce24240c7798b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12119, "upload_time": "2019-10-11T19:41:48", "url": "https://files.pythonhosted.org/packages/e9/b6/517cf21ad86b6260bda5a950f19490317855751adc8bb41d659e8ec5e231/doctestify-1.1.3.tar.gz" } ], "1.1.4": [ { "comment_text": "", "digests": { "md5": "73168388975fd7b723b970c3947c3e7a", "sha256": "133432e04a6bf5bf5ebdbb00665ccd01ba7fb2ff363f5fdf7b0a5ad6d2fc1a64" }, "downloads": -1, "filename": "doctestify-1.1.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "73168388975fd7b723b970c3947c3e7a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 14915, "upload_time": "2019-10-13T03:04:42", "url": "https://files.pythonhosted.org/packages/ed/5e/aa1748c67140f5ac34b5d6c6da0a1c2a1dcf9c0fd568a3d2a367284069e3/doctestify-1.1.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "175cea1a13dcb6d7d8ac816bfc6cf2db", "sha256": "e7febbcf1e4bc292b2c701e2b32064915f76546ab7afaf23346abf970cbd3c65" }, "downloads": -1, "filename": "doctestify-1.1.4.tar.gz", "has_sig": false, "md5_digest": "175cea1a13dcb6d7d8ac816bfc6cf2db", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12386, "upload_time": "2019-10-13T03:04:44", "url": "https://files.pythonhosted.org/packages/d7/83/9d5273a98f57d30cd62a1e309b4d15e2a10dcf0125d7d092f2b274bab9df/doctestify-1.1.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "73168388975fd7b723b970c3947c3e7a", "sha256": "133432e04a6bf5bf5ebdbb00665ccd01ba7fb2ff363f5fdf7b0a5ad6d2fc1a64" }, "downloads": -1, "filename": "doctestify-1.1.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "73168388975fd7b723b970c3947c3e7a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 14915, "upload_time": "2019-10-13T03:04:42", "url": "https://files.pythonhosted.org/packages/ed/5e/aa1748c67140f5ac34b5d6c6da0a1c2a1dcf9c0fd568a3d2a367284069e3/doctestify-1.1.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "175cea1a13dcb6d7d8ac816bfc6cf2db", "sha256": "e7febbcf1e4bc292b2c701e2b32064915f76546ab7afaf23346abf970cbd3c65" }, "downloads": -1, "filename": "doctestify-1.1.4.tar.gz", "has_sig": false, "md5_digest": "175cea1a13dcb6d7d8ac816bfc6cf2db", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12386, "upload_time": "2019-10-13T03:04:44", "url": "https://files.pythonhosted.org/packages/d7/83/9d5273a98f57d30cd62a1e309b4d15e2a10dcf0125d7d092f2b274bab9df/doctestify-1.1.4.tar.gz" } ] }