cmder


Namecmder JSON
Version 3.2 PyPI version JSON
download
home_pagehttps://github.com/iBiology/cmder.git
SummaryA shortcut for running shell command.
upload_time2021-07-27 01:40:23
maintainer
docs_urlNone
authorFEI YUAN
requires_python>=3.6
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            cmding
======

Cmder is a simple module which aims to bring enjoyable experience for 
running shell commands in Python.

By wrapping Python `subprocess.Popen`, cmder provides a convenient way for you to run any 
shell command through Python and offers some additional features.

Installation
------------

```shell
pip install cmder
```

Features
--------
- Running any command using either a string or a list. 
- Running any command like you run them from the shell. The pipe and redirection operations 
  are native permitted due to the pre-filled argument `shell=True`.
- Automatically reformat the command.  Break long command string into multiple lines and format 
  them nicely.
- Profile command running time and memory usage. Using `/usr/bin/time` to profile the time and memory 
  usage of the running command.
  

Usage
-----

Import the module and call `run` the same way you call `subprocess.run` with two additional 
keyword argument: `msg` and `pmt`. `msg` cam be a simple string for display a message 
before and after running the command. Set `pmt` to True or False will enable or disable time and 
memory profiling feature. Since `cmder.run` wrappers `subprocess.Popen`, all other keyword arguments 
allowed for `subprocess.Popen` are also allowed here.

```python
import cmder
cmder.run('ls -lh', msg='List files with details ...', pmt=True)
```

Note: 
  - Without a message string passed by `msg`, profiling time and memory will be ignored even the 
    `pmt` argument was set to True.
    

Limitations
-----------

1. Since the time and memory profiling depends on GNU version `/usr/bin/time`, it does not work 
  on BSD system.
2. Since the argument `shell=True` was pre-filled when call `subprocess.Popen`, user should be aware 
  of the potential security issue and use this module with caution.







            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/iBiology/cmder.git",
    "name": "cmder",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "",
    "author": "FEI YUAN",
    "author_email": "yuanfeifuzzy@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/41/73/e781d8a395d25073f7bc4fd1f485b582bb7cdc99e36488ff5e6acc9d3d8b/cmder-3.2.tar.gz",
    "platform": "",
    "description": "cmding\n======\n\nCmder is a simple module which aims to bring enjoyable experience for \nrunning shell commands in Python.\n\nBy wrapping Python `subprocess.Popen`, cmder provides a convenient way for you to run any \nshell command through Python and offers some additional features.\n\nInstallation\n------------\n\n```shell\npip install cmder\n```\n\nFeatures\n--------\n- Running any command using either a string or a list. \n- Running any command like you run them from the shell. The pipe and redirection operations \n  are native permitted due to the pre-filled argument `shell=True`.\n- Automatically reformat the command.  Break long command string into multiple lines and format \n  them nicely.\n- Profile command running time and memory usage. Using `/usr/bin/time` to profile the time and memory \n  usage of the running command.\n  \n\nUsage\n-----\n\nImport the module and call `run` the same way you call `subprocess.run` with two additional \nkeyword argument: `msg` and `pmt`. `msg` cam be a simple string for display a message \nbefore and after running the command. Set `pmt` to True or False will enable or disable time and \nmemory profiling feature. Since `cmder.run` wrappers `subprocess.Popen`, all other keyword arguments \nallowed for `subprocess.Popen` are also allowed here.\n\n```python\nimport cmder\ncmder.run('ls -lh', msg='List files with details ...', pmt=True)\n```\n\nNote: \n  - Without a message string passed by `msg`, profiling time and memory will be ignored even the \n    `pmt` argument was set to True.\n    \n\nLimitations\n-----------\n\n1. Since the time and memory profiling depends on GNU version `/usr/bin/time`, it does not work \n  on BSD system.\n2. Since the argument `shell=True` was pre-filled when call `subprocess.Popen`, user should be aware \n  of the potential security issue and use this module with caution.\n\n\n\n\n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A shortcut for running shell command.",
    "version": "3.2",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "b3fe081f5b36a0cc63093d2d67d3a504",
                "sha256": "a56e094365b2995d5df79c0a990d0cfc61e95579d188bc724f7865e306ac2c27"
            },
            "downloads": -1,
            "filename": "cmder-3.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b3fe081f5b36a0cc63093d2d67d3a504",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 4792,
            "upload_time": "2021-07-27T01:40:21",
            "upload_time_iso_8601": "2021-07-27T01:40:21.766459Z",
            "url": "https://files.pythonhosted.org/packages/15/de/f84ca690f927dce595a59cc490d0784510423e9cbefa35c53afc1b3d0cd8/cmder-3.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "0c7721255fd0a9f336d0fbdecf511869",
                "sha256": "f45cad28d5d41d124c0cc78b21d32c82ef691108ca709bf6c311393155373788"
            },
            "downloads": -1,
            "filename": "cmder-3.2.tar.gz",
            "has_sig": false,
            "md5_digest": "0c7721255fd0a9f336d0fbdecf511869",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 4478,
            "upload_time": "2021-07-27T01:40:23",
            "upload_time_iso_8601": "2021-07-27T01:40:23.206126Z",
            "url": "https://files.pythonhosted.org/packages/41/73/e781d8a395d25073f7bc4fd1f485b582bb7cdc99e36488ff5e6acc9d3d8b/cmder-3.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2021-07-27 01:40:23",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "iBiology",
    "github_project": "cmder.git",
    "lcname": "cmder"
}
        
Elapsed time: 0.26191s