heavenshell / vim-pydocstring

Generate Python docstring to your Python source code.
BSD 3-Clause "New" or "Revised" License
337 stars 53 forks source link

using cli for pydocstring #59

Closed s13g3lb4um closed 5 years ago

s13g3lb4um commented 5 years ago

Pydocstring contains a CLI function that return a autogenerated docstring in multiples formats.

Only need call from bash cli.

Example:

pydocstring -f numpy ../core/models/personas.py 49,0

this generate this exit:

"""

Attributes
----------
user : TYPE
    models.OneToOneField(User, on_delete=models.CASCADE, unique=True)
primer_nombre : TYPE
    models.CharField(max_length=20, db_index=True)
segundo_nombre : TYPE
    models.CharField(max_length=20, db_index=True, blank=True)
primer_apellido : TYPE
    models.CharField(max_length=20, db_index=True)
segundo_apellido : TYPE
    models.CharField(
        max_length=20, db_index=True, blank=True, null=True)
fecha_nacimiento : TYPE
    models.DateField(blank=True, null=True)
rh : TYPE
    models.CharField(max_length=3, blank=True)
genero : TYPE
    models.CharField(max_length=1, blank=True)
cedula : TYPE
    models.CharField(
        max_length=40, db_index=True, unique=True, default=__hash_date__)
telefono : TYPE
    models.CharField(max_length=15, blank=True)

"""

if i use vim-pydocstring configured for Numpy Style this is the exit: """ Persona """

exist any way to add the use the output that generate pydocstring?

Here docs for pydocstring

heavenshell commented 5 years ago

@s13g3lb4um

Thank you for information. Wow. I did't know Pydocstring contains a CLI function.

exist any way to add the use the output that generate pydocstring?

Did you set template like followings? https://github.com/heavenshell/vim-pydocstring/tree/master/test/templates/numpy Here is numpy's templates. You can copy above templates to your own template path.

Note: Pydocstring.vim is pure Vim script. So I can't support full types 😢