A module comment generator for python

Overview

Module Comment Generator

The comment style is as a tribute to the comment from the RA .

The comment generator can parse the ast tree from the python script, then extract docstring from classes and functions. The information about user comes from git config. There could be some problems on windows, because it's only tested on arch linux. Issues or PR are welcome.

Usage

Help Info

usage: cmtprinter [-h] [--desc DESC] [--tablechar TABLECHAR] filepath

positional arguments:
  filepath              the target python script path

optional arguments:
  -h, --help            show this help message and exit
  --desc DESC           the module description.
  --tablechar TABLECHAR
                        the char used for table drawing.
  1. Description(desc): the content filled in Description key,default is empty.
  2. Tbla(tablechar): the char used for table drawing, default is #

Examples

$ cmtprinter ./cmtprinter/core.py --desc "The core module for cmtprinter"
###############################################################################
#                              Filename: core.py                              #
#                 Description: The core module for cmtprinter                 #
#                      Created Time: 2021-10-21 14:33:47                      #
#                             Created By: ssfdust                             #
#                  Last Moidified Time: 2021-10-21 14:33:47                   #
#                         Last Moidified By: ssfdust                          #
###############################################################################
# Change Log:                                                                 #
#   - Initilize.                                                              #
#-----------------------------------------------------------------------------#
# Functions:                                                                  #
#   - parse_ast_tree: extract functions and classes from python script.       #
#   - dump_module_nodes: convert the ModuleNodes class into a dictionary,     #
#     which means dumping.                                                    #
#   - print_table: Print the information from the dumped node json.           #
#-----------------------------------------------------------------------------#
# Classes:                                                                    #
#   - DumpedModuleNodes: A typed dict class for dumped ModuleNodes class.     #
#   - ModuleNodes: The data class with parsed ast tree data.                  #
#-----------------------------------------------------------------------------#

$ cmtprinter ./cmtprinter/core.py --desc "The core module for cmtprinter" --tablechar '*'
*******************************************************************************
*                              Filename: core.py                              *
*                 Description: The core module for cmtprinter                 *
*                      Created Time: 2021-10-21 14:33:47                      *
*                             Created By: ssfdust                             *
*                  Last Moidified Time: 2021-10-21 14:33:47                   *
*                         Last Moidified By: ssfdust                          *
*******************************************************************************
* Change Log:                                                                 *
*   - Initilize.                                                              *
*-----------------------------------------------------------------------------*
* Functions:                                                                  *
*   - parse_ast_tree: extract functions and classes from python script.       *
*   - dump_module_nodes: convert the ModuleNodes class into a dictionary,     *
*     which means dumping.                                                    *
*   - print_table: Print the information from the dumped node json.           *
*-----------------------------------------------------------------------------*
* Classes:                                                                    *
*   - DumpedModuleNodes: A typed dict class for dumped ModuleNodes class.     *
*   - ModuleNodes: The data class with parsed ast tree data.                  *
*-----------------------------------------------------------------------------*
You might also like...
Get you an ultimate lexer generator using Fable; port OCaml sedlex to FSharp, Python and more!

NOTE: currently we support interpreted mode and Python source code generation. It's EASY to compile compiled_unit into source code for C#, F# and othe

VCC-Generator is a python script that generate VCC for testing purposes only
VCC-Generator is a python script that generate VCC for testing purposes only

VCC-Generator is a python script that generate VCC for testing purposes only

A Python module for decorators, wrappers and monkey patching.

wrapt The aim of the wrapt module is to provide a transparent object proxy for Python, which can be used as the basis for the construction of function

Python screenshot library, replacement for the Pillow ImageGrab module on Linux.

tldr: Use Pillow The pyscreenshot module is obsolete in most cases. It was created because PIL ImageGrab module worked on Windows only, but now Linux

An ultra fast cross-platform multiple screenshots module in pure Python using ctypes.

Python MSS from mss import mss # The simplest use, save a screen shot of the 1st monitor with mss() as sct: sct.shot() An ultra fast cross-platfo

 This module is for finding the execution time of a whole python program
This module is for finding the execution time of a whole python program

exetime 3.8 This module is for finding the execution time of a whole program How to install $ pip install exetime Contents: General Information Instru

Python module to work with Magneto Database directly without using broken Magento 2 core
Python module to work with Magneto Database directly without using broken Magento 2 core

Python module to work with Magneto Database directly without using broken Magento 2 core

This python module allows to extract data from the RAW-file-format produces by devices from Thermo Fisher Scientific.

fisher_py This Python module allows access to Thermo Orbitrap raw mass spectrometer files. Using this library makes it possible to automate the analys

Module for working with the site dnevnik.ru with python

dnevnikru Module for working with the site dnevnik.ru with python Dnevnik object accepts login and password from the dnevnik.ru account Methods: homew

Owner
飘尘
一心顶礼南无大方广佛华严经,华严海会佛菩萨,十六字洪名法宝
飘尘
Random pass word generator made with python. PyQt5 module is used to design GUI.

Differences in this GUI program : Default titlebar removed Custom Minimize,Maximize and Close Buttons Drag & move window from any point Program work l

Dimuth De Zoysa 1 Jan 26, 2022
Module for remote in-memory Python package/module loading through HTTP/S

httpimport Python's missing feature! The feature has been suggested in Python Mailing List Remote, in-memory Python package/module importing through H

John Torakis 220 Dec 17, 2022
Run python scripts and pass data between multiple python and node processes using this npm module

Run python scripts and pass data between multiple python and node processes using this npm module. process-communication has a event based architecture for interacting with python data and errors inside nodejs.

Tyler Laceby 2 Aug 6, 2021
PyPIContents is an application that generates a Module Index from the Python Package Index (PyPI) and also from various versions of the Python Standard Library.

PyPIContents is an application that generates a Module Index from the Python Package Index (PyPI) and also from various versions of the Python Standar

Collage Labs 10 Nov 19, 2022
Python communism - A module for initiating the communist revolution in each of our python modules

Python communist revolution A man once said to abolish the classes or something

null 758 Jan 3, 2023
Python Excuse Generator

Excuse Generator Python Excuse Generator This project is an excuse generator that provides the user with an excuse as to why they weren't paying atten

Collin Sanders 5 Jul 7, 2022
PyScaffold is a project generator for bootstrapping high quality Python packages

PyScaffold is a project generator for bootstrapping high quality Python packages, ready to be shared on PyPI and installable via pip. It is easy to use and encourages the adoption of the best tools and practices of the Python ecosystem, helping you and your team to stay sane, happy and productive. The best part? It is stable and has been used by thousands of developers for over half a decade!

PyScaffold 1.7k Jan 3, 2023
A faster Python generator that get function results from multi-process workers

multiyield This package implements a Python generator that get function results from multi-process workers. The faster_fifo Queue (instead of the stan

Xin Du 1 Nov 18, 2021
A not exist cat image generator python package

A not exist cat image generator python package

Fayas Noushad 2 Dec 3, 2021
Python NZ COVID Pass Verifier/Generator

Python NZ COVID Pass Verifier/Generator This is quick proof of concept verifier I coded up in a few hours using various libraries to parse and generat

NZ COVID Pass Community 12 Jan 3, 2023