GithubHelp home page GithubHelp logo

codecliff / nocommentspython Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 20 KB

Simple yet powerful tool to remove comments from python scripts, with directory recursion

Home Page: https://github.com/codecliff/NoCommentsPython

License: Creative Commons Zero v1.0 Universal

Python 100.00%
code-cleaning comments docstring documentation python

nocommentspython's Introduction

NoCommentsPython

A python script to remove comments from python scripts, with directory recursion

Features

  1. Removes comments and docstrings
  2. Removes blank lines
  3. Can handle all files in a given directory
  4. Can attach a predefined header text to each output
  5. Non destructive - writes output to a separate file

How to use :

  1. See help :

    python nocommentspython.py -h

  2. Specify an input file to strip

    python nocommentspython.py -i /path/to/inputfile.py

    This will create an output file inputfile.py_sanscomments.py in the same directory as input file

  3. (Optional) Retain header section

    python nocommentspython.py -i /path/to/inputfile.py -k yes

  4. (Optional) Specify a header file to insert at the top of output file (Say, for copyright and licenses)

    python nocommentspython.py -i /path/to/inputfile.py -c /path/to/headerfile.txt

  5. Process all files in a directory :

    python nocommentspython.py -i /path/to/directory

    This will process each .py file in that directory and save its respective output file. If any input file has an associated header file, it will be duly inserted in its output file (see below).

Note

Header/Copyright Files: (Automatic headers for output)* If an input file is named abcinput.py, you can store its header text in a file named abcinput.py_header.txt in the same directory. This text will automatically be inserted in the output. This is specially helpful for processing directories (see above).

© Rahul Singh

nocommentspython's People

Contributors

codecliff avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.