a small simple library for generating documentation from docstrings

Overview

inkpot

a small simple library for generating documentation from docstrings

inkpot is available on pip. Please give it a star if you like it!

drawing

GitHub stars GitHub forks Tweet

GitHub PyPI PyPI - Python Version PyPI - Downloads

To know more about way I started this project checkout this blog post

Installation

pip install inkpot

Usage

singel file

python3 -m inkpot myfile.py

or directory

python3 -m inkpot myproject/

output to a file (also works with directories)

python3 -m inkpot myfile.py > doc.md
python3 -m inkpot myproject/ > doc.md

Currently this returns a markdown table. More functionality and a better format will be added.

Example

Python file ex/add.py

def add(a,b):
    """ add to objects """
    return a + b
python3 -m inkpot ex/add.py

returns markdown

# ex/add.py
## ex/add.py
| type   | name   | doc-str        |
|:-------|:-------|:---------------|
| def    | add    | add to objects |
| module | add    | None           |

License

This project is licensed under the MIT License - see the LICENSE file for details

Comments
  • Added support for coroutines declared with async/await syntax

    Added support for coroutines declared with async/await syntax

    Added support for coroutines declared with async/await syntax.

    async def async_def_test(a, b, c):
        """
        Testing coroutines declared with async syntax
        """
        print("hello")
        await asyncio.sleep(1)
        print("world")
    
    opened by ViktorBusk 0
  • Added node visitor support (refactor in file class)

    Added node visitor support (refactor in file class)

    Refactored File class, much better code (more dynamic) with a node visitor. Also fixed directory support bug with double backslash.

    The output is still the same as before.

    opened by ViktorBusk 0
  • Added file-node support (classes, modules etc..) and better formatting for output.

    Added file-node support (classes, modules etc..) and better formatting for output.

    I found a Python base module called "ast". It parses a source file and checks for specified nodes (class, module etc..). I also changed the file-output to a markdown table format which looks much better in my opinion.

    python3 -m inkpot ex/car.py > car_test.md
    

    Output:

    car_test.md

    opened by ViktorBusk 0
  • Fixed issue with function definitions, and removed lowercase

    Fixed issue with function definitions, and removed lowercase

    There was an issue when extracting function definitions in the previous version, for example you could write something like:

    #def 
    test = "def"
    

    Both the comment and the string declaration would be interpreted as functions, but that is no longer the case.

    opened by ViktorBusk 0
  • Added support for multiline-docstrings

    Added support for multiline-docstrings

    Previously, only singleline-docstrings were supported, but not longer.

    Test Car Class:

    class car:
        def __init__(self):
            self.wheels = 0
            self.doors = 0
            self.engine = ""
            self.number_plate = ""
    
        def start(self):
            """starts the engine of the car"""
            self.engine = """Running"""
    
        def stop(self):
            """Stop the engine of the car!"""
            self.engine = "Stopping"
    
        def honk(self):
            """
            Use
            "The"
            ""Horn""
            """
            print("Honking...")
            print("Honk Honk!")
    
        def __str__(self):
            """
            example of a longer multiline-docstring,
            everything will be printed on a single line
            """
            return self.number_plate
    

    Output:

    # ex/car.py
    ## ex/car.py
    | def | doc-str |
    | --- | --- |
    |     __init__(self) | no docstring |
    |     start(self) | starts the engine of the car |
    |     stop(self) | stop the engine of the car! |
    |     honk(self) | use "the" ""horn"" |
    |     __str__(self) | example of a longer multiline-docstring, everything will be printed on a single line |
    
    opened by ViktorBusk 0
  • Skip given directory

    Skip given directory

    There should be a way of skipping a directory. This could be done by a flag -s "./not-included-dir/" or --skip "./not-included-dir/" But I might want to not include multiple directories, in this case one could maybe do something like this:

    --skip "./not-included-dir/|./some-other-dir"

    or

    --skip "./not-included-dir/, ./some-other-dir"

    I don't know what way would be best for multiple files

    or should one use an .inkpot.ignore file for multiple files :man_shrugging:

    enhancement 
    opened by AxelGard 0
Releases(v2.2.1)
Owner
Axel Gard
MSc Software Engineering @ Linköping University
Axel Gard
A super simple script which uses the GitHub API to convert your markdown files to GitHub styled HTML site.

A super simple script which uses the GitHub API to convert your markdown files to GitHub styled HTML site.

Çalgan Aygün 213 Dec 22, 2022
Markdown documentation generator from Google docstrings

mkgendocs A Python package for automatically generating documentation pages in markdown for Python source files by parsing Google style docstring. The

Davide Nunes 44 Dec 18, 2022
Black for Python docstrings and reStructuredText (rst).

Style-Doc Style-Doc is Black for Python docstrings and reStructuredText (rst). It can be used to format docstrings (Google docstring format) in Python

Telekom Open Source Software 13 Oct 24, 2022
A python package to avoid writing and maintaining duplicated python docstrings.

docstring-inheritance is a python package to avoid writing and maintaining duplicated python docstrings.

Antoine Dechaume 15 Dec 7, 2022
VSCode extension that generates docstrings for python files

VSCode Python Docstring Generator Visual Studio Code extension to quickly generate docstrings for python functions. Features Quickly generate a docstr

Nils Werner 506 Jan 3, 2023
Pydocstringformatter - A tool to automatically format Python docstrings that tries to follow recommendations from PEP 8 and PEP 257.

Pydocstringformatter A tool to automatically format Python docstrings that tries to follow recommendations from PEP 8 and PEP 257. See What it does fo

Daniël van Noord 31 Dec 29, 2022
This is a small project written to help build documentation for projects in less time.

Documentation-Builder This is a small project written to help build documentation for projects in less time. About This project builds documentation f

Tom Jebbo 2 Jan 17, 2022
Fast image augmentation library and easy to use wrapper around other libraries. Documentation: https://albumentations.ai/docs/ Paper about library: https://www.mdpi.com/2078-2489/11/2/125

Albumentations Albumentations is a Python library for image augmentation. Image augmentation is used in deep learning and computer vision tasks to inc

null 11.4k Jan 9, 2023
Fast image augmentation library and easy to use wrapper around other libraries. Documentation: https://albumentations.ai/docs/ Paper about library: https://www.mdpi.com/2078-2489/11/2/125

Albumentations Albumentations is a Python library for image augmentation. Image augmentation is used in deep learning and computer vision tasks to inc

null 11.4k Jan 2, 2023
Basic loader is a small tool that will help you generating Cloudflare cookies

Basic Loader Cloudflare cookies loader This tool may help some people getting valide cloudflare cookies Installation ?? : pip install -r requirements.

IHateTomLrge 8 Mar 30, 2022
Small-File-Explorer - I coded a small file explorer with several options

Petit explorateur de fichier / Small file explorer Pour la première option (création de répertoire) / For the first option (creation of a directory) e

Xerox 1 Jan 3, 2022
A reddit.com bot that will return reference links from official python documentation site for the standard library.

Python Docs Bot A reddit.com bot that will return documentation links for the library and language reference sections of the python docs website. The

Trevor Miller 2 Sep 14, 2021
Feature engineering library that helps you keep track of feature dependencies, documentation and schema

Feature engineering library that helps you keep track of feature dependencies, documentation and schema

null 28 May 31, 2022
A simple library for temporary storage of small files

TemporaryStorage An simple library for temporary storage of small files. Navigation Install Usage In Python console As a standalone application List o

null 2 Apr 17, 2022
Python Fire is a library for automatically generating command line interfaces (CLIs) from absolutely any Python object.

Python Fire Python Fire is a library for automatically generating command line interfaces (CLIs) from absolutely any Python object. Python Fire is a s

Google 23.6k Dec 31, 2022
A library and tool for generating .pex (Python EXecutable) files

PEX Contents Overview Installation Simple Examples Integrating pex into your workflow Documentation Development Contributing Overview pex is a library

Pants Build 2.2k Jan 1, 2023
A library for generating fake data and populating database tables.

Knockoff Factory A library for generating mock data and creating database fixtures that can be used for unit testing. Table of content Installation Ch

Nike Inc. 30 Sep 23, 2022
A tiny Python library for generating public IDs from integers

pids Create short public identifiers based on integer IDs. Installation pip install pids Usage from pids import pid public_id = pid.from_int(1234) #

Simon Willison 7 Nov 11, 2021
Python library for generating CycloneDX SBOMs

Python Library for generating CycloneDX This CycloneDX module for Python can generate valid CycloneDX bill-of-material document containing an aggregat

CycloneDX SBOM Standard 31 Dec 16, 2022
Python library for generating sequences with uniform stimulus history

Sampling Euler tours for uniform stimulus history Table of Contents About Examples Experiment 1 Experiment 2 Experiment 3 Experiment 4 Experiment 5 Co

null 5 Nov 11, 2021