{"id":19931205,"url":"https://github.com/sphinx-contrib/prefecttask","last_synced_at":"2025-06-27T03:07:25.947Z","repository":{"id":45615775,"uuid":"434469149","full_name":"sphinx-contrib/prefecttask","owner":"sphinx-contrib","description":"An extension to autodoc Prefect Tasks","archived":false,"fork":false,"pushed_at":"2021-12-04T20:12:05.000Z","size":100,"stargazers_count":3,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-07T15:01:32.286Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sphinx-contrib.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-12-03T04:46:50.000Z","updated_at":"2025-01-23T16:14:12.000Z","dependencies_parsed_at":"2022-08-25T20:11:25.205Z","dependency_job_id":null,"html_url":"https://github.com/sphinx-contrib/prefecttask","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sphinx-contrib%2Fprefecttask","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sphinx-contrib%2Fprefecttask/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sphinx-contrib%2Fprefecttask/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sphinx-contrib%2Fprefecttask/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sphinx-contrib","download_url":"https://codeload.github.com/sphinx-contrib/prefecttask/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252179269,"owners_count":21707108,"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":[],"created_at":"2024-11-12T23:06:27.254Z","updated_at":"2025-05-03T10:32:31.774Z","avatar_url":"https://github.com/sphinx-contrib.png","language":"Python","readme":"# sphinxcontrib-prefecttask\n\nAn extension to autodoc Prefect Tasks\n\n## Installation\n\n```\npip install sphinxcontrib-prefecttask\n```\n\nOnce installed, edit your `docs/source/conf.py` file and add the extension to your current list of extensions:\n\n```\nextensions = [...\n              'sphinxcontrib.prefecttask'\n              ]\n```\n\n:warning: for the below to work, your code must be importable, so your `conf.py` file should probably have something like the following at the top\n\n\n```python\nsys.path.append(os.path.abspath(\"../../\"))  # so we can import flows\n```\n\n## Usage\n\nWith the extension installed, `autodoc` will automatically find [task](https://docs.prefect.io/core/concepts/tasks.html) decorated objects (e.g. when using the automodule directive) and generate the correct documentation (as well as add a ``(task)`` prefix).\n\nFor example, assume you have the following directory structure and files\n\n```\n├── docs\n│   └── source\n│       └── conf.py\n└── flows\n    └── my_flow.py\n```\n\nyou could generate the docs for the tasks found in `my_flow.py` with\n\n```reStructuredText\n.. automodule:: flows.my_flow\n   :members:\n```\n\n\nYou can also refer to the tasks using the syntax\n\n```reStructuredText\n:meth:`flows.my_flow.add`\n```\n\nwhere `add` is the name of a task in `my_flow`\n\nFInally, you can also manually document a single task\n\n```reStructuredText\n.. autotask:: flows.my_flow.add\n```\n\n### Example\n\nA visual for the rendered docs of the given flow are shown below.\n\n```python\n# flows/my_flow.py\nfrom prefect import task, Flow\n\n@task\ndef add(x: int, y:int) -\u003e int:\n  \"\"\"Task to add two numbers together\n  \n  .. note::\n  \tAdmonitions work too!\n  \n  Parameters\n  ----------\n  x\n  \tThe first int\n  y\n  \tThe second int\n  \t\n  Returns\n  -------\n  int\n  \tThe sum of two input numbers\n  \"\"\"\n    print(\"Hello world\")\n\nwith Flow(name=\"foo\") as flow:\n    add(1,2)\n```\n\n![render](render.png)\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsphinx-contrib%2Fprefecttask","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsphinx-contrib%2Fprefecttask","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsphinx-contrib%2Fprefecttask/lists"}