Skip to main content

A library that is used to remove print statements or converting quotes in python files (if present) in a folder

Project description

wrapup

This is a python library that will help you to remove print statements or convert the quotes of python files based on your given input. You have to input the path of the file or folder, and if the filepath is correct then the changes will be applied to all the python files in the folder or the file whose path was added.


IMPORTANT NOTES TO CONSIDER:

  1. In case if path of folder is passed as parameter, then the changes will be applied to all the python files (if possible) in the folder.
  2. No changes will be made to the python file, if by any chance removing print statement or converting the quotes leads to some syntactical errors.

To install the library, type in the command line: pip install wrapup

Import the package using: import wrapup

Usage:

  • To remove print statements from the files, use rmv_print function which takes the following arguments:

    1. filepath: The path of the file to be provided. The path can be relative or absolute. (If not provided; current working directory is considered)

    2. rmv_main: (default: False) Boolean value if True then, print statements should be removed from the main function main( ) or under
      if __name__ == "__main__":

    3. rmv_root: : (default: False) Boolean value if True then, print statements from level 0 indentations will be removed

    4. funcs_to_spare: Optional argument of list type that will ignore the functions specified in the list (not removing the print statements from the specified functions)

    Return value of the function is a list of path of python files to which changes were applied.




  • To convert single quotes to double quotes or vices versa, use convert_quotes function which takes the following arguments:

    1. filepath: The path of the file to be provided. The path can be relative or absolute. (If not provided; current working directory is considered)

    2. single: (default: True) Boolean value if True, convert all the quotes of the file to single quotes and to double quotes if False

      Return value of the function is a list of path of python files to which changes were applied.

    The below example will convert all the quotes of all the python files in the folder (subsequently in all sub-folders) to double quotes,

    from wrapup import convert_quotes
    convert_quotes(filepath="folder", single=False)
    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wrapup-1.0.1.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wrapup-1.0.1-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file wrapup-1.0.1.tar.gz.

File metadata

  • Download URL: wrapup-1.0.1.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6

File hashes

Hashes for wrapup-1.0.1.tar.gz
Algorithm Hash digest
SHA256 839069d5a253720f30fb5ed6f79695373b29e23dd53c2274720480b838f23db3
MD5 c4ed1a39485d93c71f0a4f89806e4d18
BLAKE2b-256 ee367865b2436eb1a0cb2bf69f386635b774d8a6fc6ecf6d0f7ab2e3e046a646

See more details on using hashes here.

File details

Details for the file wrapup-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: wrapup-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6

File hashes

Hashes for wrapup-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5547c42c4bf34b200022eb678046aaa59d2522574c1fdf136a557e224c3a7d67
MD5 d3e4532ef3faa01d536d7dc70e254077
BLAKE2b-256 3c08a2cedc591235d506c5eb23029de7464ecfd3dbcb3a40b3ffead0e4c2f7c2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page