{"id":14065487,"url":"https://github.com/vemel/handsdown","last_synced_at":"2025-04-09T18:18:04.436Z","repository":{"id":40910513,"uuid":"214556220","full_name":"vemel/handsdown","owner":"vemel","description":"Python documentation generator for lazy perfectionists","archived":false,"fork":false,"pushed_at":"2025-03-06T03:35:17.000Z","size":3583,"stargazers_count":89,"open_issues_count":7,"forks_count":11,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T18:17:58.436Z","etag":null,"topics":["annotations","docstring-documentation","documentation-generator","pep484","python","python3"],"latest_commit_sha":null,"homepage":"https://vemel.github.io/handsdown/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vemel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-10-12T01:30:50.000Z","updated_at":"2025-03-11T16:50:01.000Z","dependencies_parsed_at":"2023-11-15T00:26:53.534Z","dependency_job_id":"1bd62f68-80ad-4665-a216-a1f7b0e9fbdb","html_url":"https://github.com/vemel/handsdown","commit_stats":{"total_commits":622,"total_committers":4,"mean_commits":155.5,"dds":0.006430868167202619,"last_synced_commit":"31b901aba240bed10e011b6281639e8b861a661c"},"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vemel%2Fhandsdown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vemel%2Fhandsdown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vemel%2Fhandsdown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vemel%2Fhandsdown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vemel","download_url":"https://codeload.github.com/vemel/handsdown/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248085328,"owners_count":21045139,"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":["annotations","docstring-documentation","documentation-generator","pep484","python","python3"],"created_at":"2024-08-13T07:04:31.065Z","updated_at":"2025-04-09T18:18:04.416Z","avatar_url":"https://github.com/vemel.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# 🙌 Handsdown - Python documentation generator\n\n\n[![PyPI - Handsdown](https://img.shields.io/pypi/v/handsdown.svg?color=blue\u0026label=handsdown)](https://pypi.org/project/handsdown)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/handsdown.svg?color=blue)](https://pypi.org/project/handsdown)\n[![PyPI - Downloads](https://static.pepy.tech/badge/handsdown)](https://pepy.tech/project/handsdown)\n[![Code Coverage](https://img.shields.io/codecov/c/gh/vemel/handsdown.svg)](https://codecov.io/gh/vemel/handsdown/tree/main/handsdown)\n[![Docs](https://img.shields.io/readthedocs/handsdown.svg?color=blue)](https://handsdown.readthedocs.io/)\n\nPython docstring-based documentation generator for lazy perfectionists.\n\n- [🙌 Handsdown - Python documentation generator](#-handsdown---python-documentation-generator)\n  - [Features](#features)\n  - [Do you need handsdown?](#do-you-need-handsdown)\n  - [Examples](#examples)\n  - [Usage](#usage)\n    - [💻 From command line](#-from-command-line)\n    - [🚀 Use a new Material design](#-use-a-new-material-design)\n    - [📦 As a Docker image](#-as-a-docker-image)\n    - [📝 As a GitHub Pages manager](#-as-a-github-pages-manager)\n    - [🐏 Deploy on Read the Docs](#-deploy-on-read-the-docs)\n    - [📋 Build static HTML](#-build-static-html)\n    - [🧩 As a module](#-as-a-module)\n    - [⌨️ CLI arguments](#️-cli-arguments)\n  - [Installation](#installation)\n  - [Development](#development)\n  - [Changelog](#changelog)\n\n## Features\n\n- [Material design](#-use-a-new-material-design) support!\n- [PEP 257](https://www.python.org/dev/peps/pep-0257/),\n  [Google](http://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings),\n  [Sphinx](https://sphinx-rtd-tutorial.readthedocs.io/en/latest/docstrings.html)\n  and [reStructuredText](https://www.python.org/dev/peps/pep-0287/)\n  docstrings support. All of them are converted to a valid Markdown.\n- Works with [Django](https://www.djangoproject.com/) and [Flask](https://palletsprojects.com/p/flask/) apps\n- Can be used locally, or\n  [right on GitHub](https://github.com/vemel/handsdown/blob/docs/docsmd/README.md) or even deployed on\n  [GitHub Pages](https://vemel.github.io/handsdown/) and [Read the Docs](https://handsdown.readthedocs.io/)!\n- Signatures for every class, function, property and method.\n- Support for type annotations. Even for the ones from the `__future__`!\n- Nice list of all modules in [Index](https://github.com/vemel/handsdown/blob/docs/docsmd/README.md)\n- Gather all scattered `README.md` in submodules to one place\n- Find related source code from every doc section.\n- Make links by just adding `module.import.String` to docs.\n- Do you use type annotations? Well, you get auto-discovery of related modules for free!\n\n## Do you need handsdown?\n\nYou definitely *do* if you:\n\n- prefer to automate documentation builds\n- work with a team and plan to simplify knowledge sharing\n- want to show your project without navigating through a source code\n- build `Django` or `Flask` applications\n- are proud of your project and not afraid to show it\n- love Open Source\n\nAnd probably *do not* if you:\n\n- not very into docstrings and type annotations\n- like to abstract a documentation away from the way things really are\n- use [Pandas docstrings](https://pandas.pydata.org/pandas-docs/stable/development/contributing_docstring.html)\n  as they are not supported yet\n\n## Examples\n\n- [All documentation](https://vemel.github.io/handsdown/) in this project\n- [Main](https://github.com/vemel/handsdown/blob/main/examples/main_example.py) with [generated output](https://github.com/vemel/handsdown/tree/docs/docsmd/examples/main_example.md)\n- [RST docstrings](https://github.com/vemel/handsdown/blob/main/examples/rst_docstrings.py) with [generated output](https://github.com/vemel/handsdown/tree/docs/docsmd/examples/rst_docstrings.md)\n- [Google docstrings](https://github.com/vemel/handsdown/blob/main/examples/google_docstrings.py) with [generated output](https://github.com/vemel/handsdown/tree/docs/docsmd/examples/google_docstrings.md)\n- [PEP 257 docstrings](https://github.com/vemel/handsdown/blob/main/examples/pep257_docstrings.py) with [generated output](https://github.com/vemel/handsdown/tree/docs/docsmd/examples/pep257_docstrings.md)\n- [Sphinx docstrings](https://github.com/vemel/handsdown/blob/main/examples/sphinx_docstrings.py) with [generated output](https://github.com/vemel/handsdown/tree/docs/docsmd/examples/sphinx_docstrings.md)\n- [Type annotations](https://github.com/vemel/handsdown/blob/main/examples/typed.py) with [generated output](https://github.com/vemel/handsdown/tree/docs/docsmd/examples/typed.md)\n- [Comment-style type annotations](https://github.com/vemel/handsdown/blob/main/examples/comment_typed.py) with [generated output](https://github.com/vemel/handsdown/tree/docs/docsmd/examples/comment_typed.md)\n\n## Usage\n\n### 💻 From command line\n\nJust go to your favorite project that has lots of docstrings but missing\nauto-generated docs and let `handsdown` do the thing.\n\n```bash\ncd ~/my/project\n\n# build documentation *.md* files in docs/* directory\nhandsdown\n\n# or provide custom output directory: output_dir/*\nhandsdown -o output_dir\n\n# generate docs only for my_module, but exclude migrations\nhandsdown my_module --exclude my_module/migrations\n\n# generate documentation for deployment\nhandsdown --external `git config --get remote.origin.url` -n ProjectName --branch main --create-configs\n```\n\nNavigate to `docs/README.md` to check your new documentation!\n\n### 🚀 Use a new Material design\n\n- Add `mkdocs` and `mkdocs-material` to your dev dependencies or just install them\n\n```bash\n# generate MarkDown documentation in docsmd folder\nhandsdown --external `git config --get remote.origin.url` -o docsmd -n \u003cproject_name\u003e --theme=material --create-configs\n\n# generate html files to docs folder\npython -m mkdocs build\n```\n\n### 📦 As a Docker image\n\n- Install [Docker](https://docs.docker.com/install/)\n- Pull latest `handsdown` version and tag it\n\n```bash\ndocker pull ghcr.io/vemel/handsdown/handsdown:latest\ndocker tag ghcr.io/vemel/handsdown/handsdown:latest handsdown\n```\n\n- Generate docs for `ProjectName` in current directory\n\n```bash\n# for Python 3 project\ndocker run -v `pwd`:/app handsdown -n ProjectName\n\n# for Python 2 project\nPYTHON_VER=2 docker run -v `pwd`:/app handsdown -n ProjectName\n\n# generate documentation for deployment\ndocker run -v `pwd`:/app handsdown --external `git config --get remote.origin.url` -n ProjectName --create-configs\n```\n\n### 📝 As a GitHub Pages manager\n\nWith `--external` CLI flag, `handsdown` generates all required configuration\nfor [GitHub Pages](https://pages.github.com/), so you just need to setup your\nGitHub repository.\n\n```bash\n# Generate documentation that points to main branch\n# do not use custom output location, as `GitHub Pages`\n# works only with `docs` directory\nhandsdown --external `git config --get remote.origin.url` --create-configs\n\n# or specify GitHub url directly\nhandsdown --external https://github.com/\u003cuser\u003e/\u003cproject\u003e --create-configs\n```\n\n- Generate documentation with `--external` flag as shown above, do not use `--output`\n  flag, only `docs` folder is supported by `GitHub Pages`\n- Commit and push all changes a to `main` branch.\n- Set your GitHub project `Settings` \u003e `GitHub Pages` \u003e `Source` to `main branch /docs folder`\n\nAll set! You can change `docs/_config.yml` to add your own touch.\n\nWith `--external` flag links to your source are absolute and point to your GitHub repo. If you\nstill want to have relative links to source, e.g. for using docs locally,\ngenerate docs to another folder\n\n```bash\n# `docs_local` folder will be created in your project root\n# you probably want to add it to .gitignore\nhandsdown -o docs_local\n```\n\n### 🐏 Deploy on Read the Docs\n\nWith `--external` CLI flag, `handsdown` generates all required configuration\nfor [Read the Docs](https://readthedocs.org/), so you just need to to add your\nGitHub repository to `Read the Docs`.\n\n```bash\n# Generate documentation that points to main branch\n# do not use custom output location, as `GitHub Pages`\n# works only with `docs` directory\nhandsdown --external `git config --get remote.origin.url` --create-configs\n\n# or specify GitHub url directly\nhandsdown --external https://github.com/\u003cuser\u003e/\u003cproject\u003e/ --create-configs\n```\n\n- Generate documentation with `--external` flag as shown above, do not use `--output`\n  flag, only `docs` folder is supported by `Read the Docs`\n- Commit and push all changes a to `main` branch.\n- Add your repository on [Read the Docs](https://readthedocs.org/)\n\nAll set! You can change `.readthedocs.yml` and `mkdocs.yml` to add your own touch.\n\n### 📋 Build static HTML\n\n```bash\n# Generate documentation that points to main branch\n# with source links pointing to your repository\n# this command also creates `mkdocs.yml`\nhandsdown --external `git config --get remote.origin.url` --create-configs\n\n# Run mkdocs to build HTML\npython -m mkdocs build\n```\n\n### 🧩 As a module\n\n```python\nfrom handsdown.generator import Generator\nfrom handsdown.utils.path_finder import PathFinder\n\n# this is our project root directory\nrepo_path = Path.cwd()\n\n# this little tool works like `pathlib.Path.glob` with some extra magic\n# but in this case `repo_path.glob(\"**/*.py\")` would do as well\npath_finder = PathFinder(repo_path, \"**/*.py\")\n\n# no docs for tests and build\npath_finder.exclude(\"tests/*\", \"build/*\")\n\n# initialize generator\nhandsdown = Generator(\n    input_path=repo_path,\n    output_path=repo_path / 'output',\n    source_paths=path_finder.glob(\"**/*.py\")\n)\n\n# generate all docs at once\nhandsdown.generate_docs()\n\n# or generate just for one doc\nhandsdown.generate_doc(repo_path / 'my_module' / 'source.py')\n\n# generate index.md file\nhandsdown.generate_index()\n\n# and generate GitHub Pages and Read the Docs config files\nhandsdown.generate_configs()\n\n# navigate to `output` dir and check results\n```\n\n### ⌨️ CLI arguments\n\n```bash\nhandsdown [-h] [--exclude [EXCLUDE ...]] [-i INPUT_PATH] [-f [FILES ...]]\n  [-o OUTPUT_PATH] [--external REPO_URL] [--source-code-path REPO_PATH]\n  [--branch BRANCH] [--toc-depth TOC_DEPTH] [--cleanup] [-n PROJECT_NAME]\n  [-e ENCODING] [--panic] [-d] [-q] [-V]\n  [include ...]\n```\n\n| Argument | Description | Default |\n|-|-|-|\n| `include` | Path expressions to include source files | |\n| `--exclude` | Path expressions to exclude source files | `'build/*' 'tests/*' 'test/*' '*/__pycache__/*' '.*/*'` |\n| `-i` / `--input-path` | Path to project root folder | `\u003ccwd\u003e` |\n| `-f` / `--files` | List of source files to use for generation. If empty - all are used. | |\n| `-o` / `--output-path` | Path to output folder | `\u003ccwd\u003e/docs` |\n| `--external` | Build docs and config for external hosting, GitHub Pages or Read the Docs. Provide the project GitHub .../blob/main/ URL here. | |\n| `--source-code-path` | Path to source code in the project. Overrides `--branch` CLI argument | |\n| `--branch` | Main branch name | `main` |\n| `--toc-depth` | Maximum depth of child modules ToC | `3` |\n| `--cleanup` | Remove orphaned auto-generated docs | |\n| `-n` / `--name` | Project name | `\u003ccwd\u003e.name` |\n| `-e` / `--encoding` | Input and output file encoding | `utf-8` |\n| `--panic` | Panic and die on import error | |\n| `--debug` | Show debug messages| |\n| `--quiet` | Hide log output | |\n| `--create-configs` | Create config files for deployment to RtD and GitHub Pages | |\n| `-t` / `--theme` | Output mkdocs theme: `readthedocs` or `material` | `readthedocs` |\n| `-h` | Show help | |\n\n\n## Installation\n\nInstall using `pip` from PyPI\n\n```bash\npip install handsdown\n```\n\nor directly from GitHub if you cannot wait to test new features\n\n```bash\npip install git+https://github.com/vemel/handsdown.git\n```\n\n## Development\n\n- Install [poetry](https://python-poetry.org/)\n- Run `poetry install`\n- Use `black` formatter in your IDE\n\n## Changelog\n\nChangelog can be found in [Releases](https://github.com/vemel/handsdown/releases)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvemel%2Fhandsdown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvemel%2Fhandsdown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvemel%2Fhandsdown/lists"}