Giter Site home page Giter Site logo

docly's Introduction

docly

Please note-------

Docly is not maintained anymore. Codist is in the process of shutting down. Sorry for the inconvenience

Docly - Automatic source code commenting

parser: tree-hugger

Automatically generate docstrings for your python functions

Main documentation (FAQ and all)

http://beta.thedocly.io/

Installing

Requires python 3.6+

NOTE THAT, if you are getting an error (in a fresh virtualenv in ubuntu it is observed) like error: invalid command 'bdist_wheel' then please install wheel by doing pip install wheel

ALSO NOTE that if you are getting an error to build tree-sitter because you do not have gcc installed then you can install it using sudo apt-get install gcc python3-dev for other distros please check here

First install setuptools-rust by

pip install setuptools-rust

Then

pip install docly

Using

To generate comments -

docly-gen /path/to/file_or_folder_with_python_files

Please note that if you do not have the necessary engine (models) downloaded before running the command (which is going to be case the first time you run this command) then it will download and set them up. Which may take a bit of time

It will produce something like this (Shown on a single file but you can run it on a directory full of files also)

The diff has been generated, do you want to see the suggestions for missing Docstrings? [Y/n]
Y
+-----------------+------------------------------+---------------------------------------+
| File Name       | Function Name                | Docstring                             |
+-----------------+------------------------------+---------------------------------------+
| simple_funcs.py | add                          | Add two numbers .                     |
| simple_funcs.py | check_if_even                | Checks if number is even .            |
| simple_funcs.py | check_even_numbers_in_a_list | Return list of numbers in base_list . |
| simple_funcs.py | open_file                    | Open a file .                         |
+-----------------+------------------------------+---------------------------------------+
Do you want to apply the suggestions? [Y/n]
Y
Applying diff
Diff applied. Good bye!

Instead if you just want the above report and not to apply the chages then do this -

docly-gen --no_generate_diff --print_report /path/to/file_or_folder_with_python_files

If you want to revert the changes we applied then use

docly-restore

This will bring back ALL the files that we had touched to the exact state before we applied the changes

docly's People

Contributors

rcshubhadeep avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.