Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support more docstring formats through napoleon #3

Open
epsy opened this issue Oct 8, 2012 · 2 comments
Open

Support more docstring formats through napoleon #3

epsy opened this issue Oct 8, 2012 · 2 comments
Milestone

Comments

@epsy
Copy link
Owner

epsy commented Oct 8, 2012

Currently Clize supports docstrings in docutils/Sphinx format and in its own legacy docstring format.

This could be done in one of two ways:

  • Sphinx includes a 'napoleon' extension that converts docstrings in Numpy and Google style to something that docutils can process. We may be able to use it for this purpose. If so we need to ask about API stability with them
  • If the above solution is too overkill, maybe we can implement our own converter.
@epsy epsy modified the milestones: 3.1, 2.1 Mar 25, 2015
@epsy epsy modified the milestones: 3.1, 3.x Mar 26, 2015
@epsy epsy changed the title Support more docstring formats Support more docstring formats through napoleon Apr 28, 2017
@timcera
Copy link

timcera commented Feb 5, 2021

Came to this issue because Clize looks pretty nice but all my docstrings are in Numpy format. The current library that I use for CLI is 'mando' which went the sphinx napoleon route. There are a lot of dependencies to make that happen.

There is however a much nicer solution by going with something like https://github.com/rr-/docstring_parser which parses REST, Google, and Numpy docstrings. Pure python, no additional dependencies.

@TomekTrzeciak
Copy link

This can be achieved by subclassing ClizeHelp and passing it to Clize constructor via helper_class argument:

https://github.com/metoppv/improver/blob/8194d01/improver/cli/__init__.py#L57-#L102

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants