{"id":21013402,"url":"https://github.com/heavenshell/py-doq","last_synced_at":"2025-04-04T18:06:04.553Z","repository":{"id":39996054,"uuid":"239127507","full_name":"heavenshell/py-doq","owner":"heavenshell","description":"Docstring generator","archived":false,"fork":false,"pushed_at":"2025-03-06T03:39:59.000Z","size":135,"stargazers_count":54,"open_issues_count":15,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T17:05:34.836Z","etag":null,"topics":["docstring","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/heavenshell.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-08T12:16:55.000Z","updated_at":"2025-03-08T14:56:04.000Z","dependencies_parsed_at":"2024-02-16T23:40:13.051Z","dependency_job_id":"afc919d4-f67e-490e-a491-dca71caa305f","html_url":"https://github.com/heavenshell/py-doq","commit_stats":{"total_commits":97,"total_committers":5,"mean_commits":19.4,"dds":"0.44329896907216493","last_synced_commit":"35f6bfc355757039329e04aeb148ff89bfd5c670"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heavenshell%2Fpy-doq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heavenshell%2Fpy-doq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heavenshell%2Fpy-doq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heavenshell%2Fpy-doq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heavenshell","download_url":"https://codeload.github.com/heavenshell/py-doq/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247226213,"owners_count":20904465,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docstring","python"],"created_at":"2024-11-19T09:42:15.443Z","updated_at":"2025-04-04T18:06:04.531Z","avatar_url":"https://github.com/heavenshell.png","language":"Python","readme":"doq\n---\n\n.. image:: https://github.com/heavenshell/py-doq/workflows/build/badge.svg\n    :target: https://github.com/heavenshell/py-doq/actions\n\n.. image:: https://pyup.io/repos/github/heavenshell/py-doq/python-3-shield.svg\n    :target: https://pyup.io/repos/github/heavenshell/py-doq/\n    :alt: Python 3\n\n.. image:: https://pyup.io/repos/github/heavenshell/py-doq/shield.svg\n    :target: https://pyup.io/repos/github/heavenshell/py-doq/\n    :alt: Updates\n\nDocstring generator.\n\nInstallation\n============\n\n.. code::\n\n  $ pip install doq\n\nHow to use\n==========\n\n.. code::\n\n  $ cat spam.py\n  def spam(arg1, arg2: str) -\u003e str:\n      pass\n\n.. code::\n\n  $ cat spam.py | doq\n  def spam(arg1, arg2: str) -\u003e str:\n    \"\"\"spam.\n\n    :param arg1:\n    :param arg2:\n    :type arg2: str\n    :rtype: str\n    \"\"\"\n    pass\n\nDefault formatter is `sphinx`. You can choose `sphinx`, `google` or `numpy`.\n\n.. code::\n\n  $ cat spam.py | doq --formatter=google\n  def spam(arg1, arg2: str) -\u003e str:\n    \"\"\"spam.\n\n    Args:\n        arg1 : arg1\n        arg2 (str): arg2\n\n    Returns:\n        str:\n    \"\"\"\n    pass\n\n.. code::\n\n  $ cat spam.py | doq --formatter=numpy\n  def spam(arg1, arg2: str) -\u003e str:\n    \"\"\"spam.\n\n    Parameters\n    ----------\n    arg1\n          arg1\n    arg2 : str\n         arg2\n\n    Returns\n    -------\n    str\n\n    \"\"\"\n    pass\n\nUsage\n=====\n\n.. code::\n\n    $ python -m doq.cli --help\n    usage: doq [-h] [-f FILE] [--start START] [--end END] [-t TEMPLATE_PATH]\n               [-s STYLE] [--formatter FORMATTER] [--indent INDENT] [--omit OMIT]\n               [-r] [-d DIRECTORY] [-w] [-v] [-c CONFIG] [--ignore_exception]\n               [--ignore_yield] [--ignore_init]\n\n    Docstring generator.\n\n    optional arguments:\n      -h, --help            show this help message and exit\n      -f FILE, --file FILE  File or STDIN\n      --start START         Start lineno\n      --end END             End lineno\n      -t TEMPLATE_PATH, --template_path TEMPLATE_PATH\n                            Path to template directory\n      -s STYLE, --style STYLE\n                            Output style string or json\n      --formatter FORMATTER\n                            Docstring formatter. sphinx,google or numpy\n      --indent INDENT       Indent number\n      --omit OMIT           Omit first argument such as self\n      -r, --recursive       Run recursively over directories\n      -d DIRECTORY, --directory DIRECTORY\n                            Path to directory\n      -w, --write           Edit files in-place\n      -v, --version         Output the version number\n      -c CONFIG, --config CONFIG\n                            Path to a setup.cfg or pyproject.toml\n      --ignore_exception    Ignore exception statements\n      --ignore_yield        Ignore yield statements\n      --ignore_init         Ignore generate docstring to __init__ method\n\nCustomize template\n==================\n\ndoq use Jinja2 template. So you can create your own template.\n\n.. note::\n\n    You must create 3 template files.\n\n+-----------+-----------------------------------------+\n| File name | Description                             |\n+===========+=========================================+\n| class.txt | class docstring                         |\n+-----------+-----------------------------------------+\n| def.txt   | def / method docstring                  |\n+-----------+-----------------------------------------+\n| noarg.txt | def / method without argument docstring |\n+-----------+-----------------------------------------+\n\nAvailable Jinja2's variable\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n+--------------------------+---------------------------+\n| Name                     | Description               |\n+==========================+===========================+\n| name                     | class, method, def's name |\n+-------------+------------+---------------------------+\n| params      | argument   | Method, def's argument    |\n|             +------------+---------------------------+\n|             | annotation | Argument's type hint      |\n|             +------------+---------------------------+\n|             | default    | Defaut keyword argument   |\n+-------------+------------+---------------------------+\n| exceptions               | List of exception         |\n+--------------------------+---------------------------+\n| yields                   | List of yield             |\n+--------------------------+---------------------------+\n| return_type              | Return type hint          |\n+--------------------------+---------------------------+\n\nSee `examples \u003chttps://github.com/heavenshell/py-doq/tree/master/examples\u003e`_\n\nConfiguration\n=============\n\ndoq will automatically search ``setup.cfg`` or ``pyproject.toml`` in your\nproject.\n\n.. note::\n\n    ignore_exception, ignore_exception and ignore_init can set `true` only.\n    If you want turn off, remove from configuration.\n\nsetup.cfg\n~~~~~~~~~\n\nThe section must be ``[doq]``.\n\nconfiguration file example::\n\n  [doq]\n  style = \"json\"\n  template_path = \"/path/to/template\"\n\npyproject.toml\n~~~~~~~~~~~~~~\n\nThe section must be ``[tool.doq]``.\n\nconfiguration file example::\n\n  [tool.doq]\n  style = \"json\"\n  template_path = \"/path/to/template\"\n\nCompletion\n==========\n\nThis program provides shell completions. It should be out of box if you install\nit from a wheel file.\n\nLICENSE\n=======\n\nNEW BSD LICENSE.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheavenshell%2Fpy-doq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheavenshell%2Fpy-doq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheavenshell%2Fpy-doq/lists"}