/plugin-python

Set of shortcuts to Python based utilities (pybeatifyjson – clean JSON files, pyclean – remove old .pyc, pyhttp & pysmtp – simple HTTP & SMTP servers)

Primary LanguageShellMIT LicenseMIT


python

This plug-in brings a number of handy functions:

  • pybeautifyjson - Beautify a JSON string
  • pyclean - Recursively clean directory from .pyc and .pyo files and python3 pycache folders
  • pyhttp - Start SimpleHTTPServer, optional argument for port number
  • pysmtp - Start SMTP debugging server, option port argument. Default is 1025

Install

$ omf install python

Usage

$ pyclean  # recursively clean .pyc and .pyo
$ pybeautifyjson '{"foo": "lorem", "bar": "ipsum"}'    # beautify a JSON string
$ pybeautifyjson (curl -s http://api.example.com/foo)  # beautify a JSON output
$ curl -s http://api.example.com/foo | pybeautifyjson  # beautify a JSON output

License

MIT © bpinto et al