Skip to content

Docstring wrapper to inherit components from the docstrings of parent class

License

Notifications You must be signed in to change notification settings

kimt33/docinstance

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docinstance

Docinstance is a package for managing docstrings as instances of a Python object, Docstring, rather than string literals. The goal of this package is to develop a framework that allows us to painlessly construct and modify docstrings in different styles.

Features

Since this is a work in progress, we list the intended features of this module:

  • Parse docstring into Docstring instances
    • numpy docstring
    • google docstring
    • sphinx's rst docstring
  • Write docstring from Docstring instance
    • numpy docstring
    • google docstring
    • sphinx's rst docstring
  • Translate docstrings from one style to another
    • numpy to google or sphinx's rst style
  • Inherit (parts of) docstrings
    • from parent
    • from other objects
  • Generate docstring from code
    • List of parameters
    • List of methods/properties in a class
    • List of functions/classes in a module
  • Generate code from docstring
    • static type checking
  • Interface to IDE's
    • Vim
    • Emacs

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

To use this module, no other packages are needed except for the standard Python library for Python 3.

For testing, pytest is the only prerequisite.

pip install pytest

For quality assurance, tox is used along side pytest, pytest-cov, flake8, pylint, pydocstyle, and pycodestyle.

pip install tox
pip install pytest
pip install pytest-cov
pip install flake8
pip install pylint
pip install pydocstyle
pip install pycodestyle

Installing

To install the package from PyPI, use pip:

pip install docinstance

To install the package from source, download the package using git, then install using pip:

git clone https://github.com/kimt33/docinstance.git
cd docinstance
pip install -e ./

Running the tests

To test the code, run pytest from the package directory.

cd /path/to/docinstance/
pytest

Running the quality assurance tests

To run quality assurance, run tox from the package directory

cd /path/to/docinstance/
tox

Note that if you do not have different versions of Python installed, you may need to specify the python version.

tox -e py37
tox -e py36
tox -e py35

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

  • Taewon David Kim - Initial work - kimt33

See also the list of contributors who participated in this project.

License

This project is licensed under the GPLv3 License - see the LICENSE.md file for details

Acknowledgments

About

Docstring wrapper to inherit components from the docstrings of parent class

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages