Skip to main content

docly

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

Metadata

Release files for docly 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for docly 0.3.0
File Size Uploaded
docly-0.3.0.tar.gz 18.1 kB Details

Release files / docly-0.3.0.tar.gz

Download URL docly-0.3.0.tar.gz
Size 18.1 kB
Tags Source
SHA-256 checksum
How to use checksums
fa83aba3159e273f6445f9deef14c2562d8a9b4e73fdbf89969a29d76ec87439
BLAKE2b-256 checksum
How to use checksums
c4757b98b39d980d14d16db1c8953b5e059822e402de01914eb17cab2ffe33fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.3.0 This release

1 release file

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.30

2 release files

0.0.29

2 release files

0.0.28

2 release files

0.0.27

2 release files

0.0.21

2 release files

0.0.20

2 release files

0.0.19

2 release files

0.0.18

2 release files

0.0.17

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page