{ "info": { "author": "Albert Aleksieiev", "author_email": "albert.aleksieiev@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Environment :: Console", "License :: OSI Approved :: MIT License", "Operating System :: Unix", "Programming Language :: Python", "Topic :: Software Development :: Interpreters", "Topic :: Terminals" ], "description": "Zpy shell\n=================\n![ZpyContent](https://github.com/albertaleksieiev/zpy/raw/content/img/screenshot-1.png)\n**Next level command line shell with script languages, like python or js. Work in shell with your favorite language.**\n```\n(Zpy) pwd | \"Current folder %s\" % z | cat\nCurrent folder /Users/XXXX/pytho-nal\n(Zpy) j request = require('request')\n(Zpy) j ['New York', 'Paris', 'London', 'Berlin', 'San Francisco'] \n |[for] j request(`http://weathers.co/api.php?city=${z}`, (err,res,body) => sync(JSON.parse(body).data)) \n |j z.map((data) => `${data.location} has temperature ${data.temperature} \u00b0F`) \n |[for] echo $z >> weather.txt\n['', '', '', '', '']\n(Zpy) cat weather.txt\nNew York has temperature -7 \u00b0F\nParis has temperature -7 \u00b0F\nLondon has temperature -7 \u00b0F\nBerlin has temperature 4 \u00b0F\nSan Francisco has temperature 24 \u00b0F\n```\n### Demo\n![Zpy Demo](https://github.com/albertaleksieiev/zpy/raw/content/img/zpy_demo.gif)\nCombine Python and JavaScript together in the terminal is really easy! Just look at [Full Video](https://asciinema.org/a/3fam2wma6o16onjx01xdod0fe) with additional features!\n### Pipeline\nZpy ideology says - pipeline make work in terminal great again! Pipeline play the major role in zpy. If you want to use every opportunity of Zpy you should know a few things about the pipeline. Input command will be splited by pipeline character, each of token will be evaluated by shell,python or js interpreter, and tokens will be chained into 1 chain. Zpy pass previous token evaluation result as stdin to next token and you have access to z-variable if token not expects to stdin. So Zpy pipes work like standard unix pipes.\n\n### Syntax\nIf you want use Zpy you should a few rules.\n * Command will be evaluated by **unix system** if you add **`** symbol in begin of the token, or you command begin with [142 linux commands](http://www.mediacollege.com/linux/command/linux-command.html)\n * Command will be evaluated by [**javascript**](#javascript) language if you add `j` at begining of token. \n * Command will be evaluated by [**Chain Pool**](#chain-pool) if you add specific characters like `for` in the begin the line.\n * Command will be evaluated by [**python**](#python) command **in any other case**(by default just evaluate python code - python is default language)\n \n#### From Python to Unix \n```\n(Zpy) \"\\n\".join([\"Zpy so awesome #review #1e%s\"%i for i in range(10)]) | grep \"5\\|6\\|8\"\nZpy so awesome #review #1e5\nZpy so awesome #review #1e6\nZpy so awesome #review #1e8\n```\nGenerate array with text joined with number from zero to ten, join it by using `\\n` character, that we can use it in **unix pipe** cause grep use data splited by `\\n` characher. Filtering results by using **grep** command, show only string which contrains 5,6 or 8 digits.\n```\n(Zpy) \"%s.%s\" % ('index','php') | cat $z\ncat: index.php: No such file or directory\n(Zpy) \"%s.%s\" % ('index','cpp') | touch $z\n```\nGenerate \"index.php\" as z-value, and send it to next pipe. Last pipe will be evaluated by unix system, we have access to z-variable as like path variable or stdin. So you can write `$z` to access variable `...|touch $z` or stdin `...|grep \"index\"`.\n#### From Unix to Python\n```\n(Zpy) ls | z.split('\\n') | filter(lambda x : 'index' in x, z) | list(z)\n['index.py']\n```\nGet current files, convert it into array and filter it by some condition\nWe have access to z-variable as `z`.\n#### From (Unix or Python) to Js and back\nAs you can see abowe, we have access to `z` variable from unix or python just use `z` or `$z` variables, this rule works the same way in js. \n```\n(Zpy) 'http://weathers.co/api.php?city=New+York' | j req(z, (err,res,body) => sync(body)) | j JSON.parse(z).data | \"Today is %s and current temperature %s\" % (z['date'], z['temperature'])\nToday is 03-12-2017 and current temperature -14\n```\n`python` -> `javascript`-> `javascript`-> `python` \nGet current temperature and date from weather.co.\n**Note** here we use `sync` function from javascript, this command will send data from **Async** function call (see description in javascript section).\n\n#### Salad of languages\n```\n(Zpy) j [1,2,3,4].map((e) => `js ${e}`) | [\"python + %s\" %x for x in z] | \"\\n\".join(z) | sed -e 's/$/ + bash = Zpy/'\npython + js 1 + bash = Zpy\npython + js 2 + bash = Zpy\npython + js 3 + bash = Zpy\npython + js 4 + bash = Zpy\n```\nHow about dah? `javascript` -> `python` -> `bash`\n\n### Requirements\n* Python 3\n* pip3\n* compgen\n* nodejs or any other js runtime.\n\n### Install\nInstall via pip\n```\npip3 install zpyshell\n```\nInstall from github sources:\n```\ngit clone git@github.com:albertaleksieiev/zpy.git\ncd zpy;pip3 install -r requirements.txt\n```\nIf you want use power of js, install [nodejs](https://nodejs.org/en/). \n\n### Run\nIf you install zpy via pip just run in terminal\n```\n$ zpy\n```\nBut if you install from sources, navigate to repository root folder and run it like python script\n```\npython3 Zpy/main.py \n```\n### Test\n```\npython3 tests/main_test.py\n```\n\n-----\n## Languages\nCurrently zpy support 3 languages\n* [Python](#python)\n* [Javascript](#javascript)\n* Unix shell script\n* [Chain Pool](#chain-pool) (additional language)\n\n### More languages\n Now Zpy supports python and js, but in the first release, we will add more languages!\n \n## Python\nZpy written in python, so python it's the first language which was be added and supported.\n* [Imports](#python-imports)\n* [Default imports](#default-imports)\n* [Own modules](#adding-new-module)\n * [Create python module](#1create-python-module)\n * [Import module](#2add-module-to-zpy)\n * [Advanced usage pipe and module](#3processing-input-from-pipe)\n\n\n### Python Imports\nIf you wan't import some modules into zpy, just add `~` in the begging and type your import command.\n```\n(Zpy) ~import random,os\n(Zpy) ~from PIL import Image\n(Zpy) find /Users/XXXX/Pictures -name \"*.jpg\" | z.split('\\n') | z[random.randint(0,len(z))] | Image.open(z).show()\n```\nShow random Image from your Pictures folder. \n**Note: change /Users/XXXX/Pictures to your folder with images**\n```\n(Zpy) ~import os\n(Zpy) pwd | os.listdir(z)\n['__pycache__', 'a.txt', 'index.py', 'linux-command-to-list-all-available-commands-and-aliases', 'README.md', 'Zpy']\n(Zpy) ~from Zpy.Utils import get_linux_commands\n['adduser', 'arch', 'awk', 'bc', 'cal', 'cat', 'chdir', 'chgrp', 'chkconfig', 'chmod', 'chown', 'chroot', 'cksum', 'clear', 'cmp', 'comm', 'cp', 'cron', 'crontab', 'csplit', 'cut', 'date', 'dc', 'dd', 'df', 'diff', 'diff3', 'dir', 'dircolors', 'dirname', 'du', 'echo', 'ed', 'egrep', 'eject', 'env', 'expand', 'expr', 'factor', 'FALSE', 'fdformat', 'fdisk', 'fgrep', 'find', 'fmt', 'fold', 'format', 'free', 'fsck', 'gawk', 'grep', 'groups', 'gzip', 'head', 'hostname', 'id', 'info', 'install', 'join', 'kill', 'less', 'ln', 'locate', 'logname', 'lpc', 'lpr', 'lprm', 'ls', 'man', 'mkdir', 'mkfifo', 'mknod', 'more', 'mount', 'mv', 'nice', 'nl', 'nohup', 'passwd', 'paste', 'pathchk', 'pr', 'printcap', 'printenv', 'printf', 'ps', 'pwd', 'quota', 'quotacheck', 'quotactl', 'ram', 'rcp', 'rm', 'rmdir', 'rpm', 'rsync', 'screen', 'sdiff', 'sed', 'select', 'seq', 'shutdown', 'sleep', 'sort', 'split', 'su', 'sum', 'symlink', 'sync', 'tac', 'tail', 'tar', 'tee', 'test', 'time', 'touch', 'top', 'traceroute', 'tr', 'TRUE', 'tsort', 'tty', 'umount', 'uname', 'unexpand', 'uniq', 'units', 'unshar', 'useradd', 'usermod', 'users', 'uuencode', 'uudecode', 'vdir', 'watch', 'wc', 'whereis', 'which', 'who', 'whoami', 'xargs', 'yes']\n ```\nPrint all linux commands defined in zpy.\n#### Default imports\nIf you don't want import general modules like `os` every time when you launch zpy, you can use **default imports**\nYou just need execute zpy method `add_def_imports`.\n```\n(Zpy) zpy.add_def_imports(\"numpy\",\"import numpy as np\")\n(Zpy) zpy.get_def_imports()\nnumpy => import numpy as np\n```\nDone! When you launch Zpy, this modules will be imported automatically. Let's try evaluate something.\n```\n(Zpy) np.arange(20)\n[ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19]\n(Zpy) np.arange(20) | np.std\n5.76628129734\n```\n**Note** Here we use np.std without input arguments, Zpy will pass z-value as 1 argument to function and evaluate it.\nFunction will be evaluated with z parameter as argument by default, if return type of evaluation is function. \n#### Modules\nZpy have some cool things, like modules! Modules is your own script which will be imported by default. Zpy have own zpy module.\n```\n(Zpy) zpy\n\n```\nzpy is just python class, which can storage some information (like scripts).\nzpy Methods : \n- - return list of scripts\n- add_script(name) - Currying `add_new_script` method, returns `add_new_script(name=name)` \n- add_new_script(name, script) - create new script\n- remove_script(name) - remove script\n- eval(name, input='') - eval script and send input\n- eval_with_input(name) - Currying `eval` method, returns `eval(name=name)`\n- last_zcommand() - return last z-command. **Note** after evaluation `last_zcommand()` method and value returns,, last z-command will be `last_zcommand()`\n- add_module(module_name, path_to_module_file_py) - add module, it will be available from zpy like `module_name`\n- get_modules() - returns all modules\n- remove_module(name) - remove module by name, **file will not be deleted**\n- as_table(data) - trying to convert string to table data\n```\n(Zpy) zpy.get_scripts()\n(Zpy) zpy.add_new_script(\"ls\", \"ls -lah\")\n(Zpy) zpy.get_scripts()\nls => ls -lah\n(Zpy) zpy.eval('ls')\ntotal 408\ndrwxr-xr-x 9 albert staff 306B Feb 27 22:29 .\ndrwxr-xr-x 33 albert staff 1.1K Feb 24 22:47 ..\ndrwxr-xr-x 8 albert staff 272B Feb 27 22:36 .idea\n-rw-r--r-- 1 albert staff 6.1K Feb 27 22:13 README.md\ndrwxr-xr-x 7 albert staff 238B Feb 27 22:35 Zpy\n-rw-r--r-- 1 albert staff 685B Feb 27 22:25 index.py\n-rw-r--r-- 1 albert staff 182K Feb 1 20:00 linux-command-to-list-all-available-commands-and-aliases\n-rw-r--r-- 1 albert staff 36B Feb 27 15:47 random.file\n-rw-r--r-- 1 albert staff 24B Feb 27 22:13 zpy.conf\n```\nSome advanced stuff\n```\n(Zpy) ~import requests, json\n(Zpy) requests.get('http://finance.google.com/finance/info?client=ig&q=NSE:HDFC') | z.text | z.replace('//','') | json.loads(z)[0] | z['pcls_fix']\n1375.7\n(Zpy) zpy.last_zcommand()\nrequests.get('http://finance.google.com/finance/info?client=ig&q=NSE:HDFC') | z.text | z.replace('//','') | json.loads(z)[0] | z['pcls_fix']\n(Zpy) zpy.last_zcommand()\nzpy.last_zcommand()\n(Zpy) requests.get('http://finance.google.com/finance/info?client=ig&q=NSE:HDFC') | z.text | z.replace('//','') | json.loads(z)[0] | z['pcls_fix']\n1375.7\n(Zpy) zpy.last_zcommand() | zpy.add_script(\"Get stock NSE:HDFC\")\n(Zpy) zpy.eval('Get stock NSE:HDFC')\n1375.7\n```\n#### Adding new module\nYou may want to add the module to Zpy functionality written in python, in Zpy you can do this in few steps\n##### 1)Create python module\n\n```\n(Zpy) pwd\n/path\n(Zpy) cd to\n(Zpy) pwd\n/path/to\n(Zpy) ['def square(a):','\\treturn a * a'] | \"\\n\".join(z) | cat > some_module.py\n(Zpy) cat some_module.py\ndef square(a):\n return a * a\n```\n##### 2)Add module to Zpy\nRun zpy method `add_module` from zpy python module.\n ```\n(Zpy) zpy.add_module(\"some_model\",\"/path/to/some_module.py\"\n ```\nOr edit **zpy.conf** file - add name and py file location to [MODULE] section :\n```\n....\n[MODULE]\n....\nsome_model = /path/to/some_module.py\n```\n*zpy.conf*\n\nAnd try evaluate method from some_module\n```\n(Zpy) some_module.square(4)\n16\n```\n##### 3)Processing input from pipe\nPassing pipe output to your module function - really easy. You just need declare `zpy_input` in your function argument list :\n```\ndef square(a):\n return a * a\ndef square_from_pipe(zpy_input):\n return square(zpy_input)\n```\n*some_module.py*\n```\n(Zpy) 12 | some_module.square_from_pipe\n144\n```\nAlso, we can use currying if we want implement pow function, we should pass 2 variables - base value and exponent value. But pipe can send only 1 variable, we can pass them as string array and parse them inside our function **OR** we can use carrying,\n```\nimport math\ndef square(a):\n return a * a\n\ndef square_from_pipe(zpy_input):\n return square(zpy_input)\n \ndef power(base, exponent=None):\n if exponent is None:\n def currying_function(zpy_input):\n return math.pow(base, zpy_input)\n\n return currying_function\n else:\n return math.pow(base, exponent)\n```\n*zpy.conf*\nUniversal function power is done! Let's test it\n```\n(Zpy) some_module.power(2)(2)\n4.0\n(Zpy) some_module.power(2)(4)\n16.0\n(Zpy) 5 | some_module.power(2)\n32.0\n```\n\n## Javascript\nJavascript one of the most popular language ever, so zpy work with them. You can use nodejs with some features like File System I/O, or other JS runtime. Special thanks for [PyExecJS](https://github.com/doloopwhile/PyExecJS)! Zpy use this module inside, so you can see the full list of available runtimes in the link above.\nEverybody knows javascript use async functions, this is a problem cause pipes do not works async. This problem will be solved bu using [`sync`](#sync-function) or [`sync_err`](#sync_err) functions.\n* [Syntax](#js-syntax)\n* [Imports](#js-imports)\n * [Default imports](#js-default-imports)\n* [Async](#async-to-sync)\n * [`sync` function](#sync-function)\n * [`sync_err` function](#sync_err)\n\n### JS Syntax\nCommand will be evaluated by **javascript** command if you add `j` at begining of token. \n```\n(Zpy) j 2 + 3\n5\n```\n### JS Imports\nIf you wan't import some modules into js chain, use `require`.\n```\nnpm i request --global\n...\n(Zpy) j request = require('request')\nAdded new requirements : { [['request', 'request']] }\n```\n**Note** your modules should be installed globaly \n##### JS Default imports\nIf you want import general modules like `request` every time when you launch Zpy, you can use **default imports**.\nYou just need execute method `add_def_imports` from `zjs` object.\n```\n(Zpy) zjs.add_def_imports('request', 'require(\"request\")')\n(Zpy) zjs.get_def_imports()\nrequest => require(\"request\")\n```\nDone!\n### Async to Sync\nAs I wrote above, we should have ability going from async function to sync function, but why we cannot use async without any modification? If we want make a request and after request send data to next chain, request should be fineshed before we go to next chain.\n```\n(Zpy) j [1,2,3].join(\"-\") | z.split(\"-\")\n['1', '2', '3'] //It's work great! Cause js chain not async.\n(Zpy) j request('http://weathers.co/api.php?city=New+York', (err,res,body) => \"\") \n{'method': 'GET', 'uri': {'auth': None, 'path': '/api.php?city=New+York', 'host': 'weathers.co', 'hostname': 'weathers.co', 'hash': None, 'query': 'city=New+York', 'protocol': 'http:', 'port': 80, 'search': '?city=New+York', 'href': 'http://weathers.co/api.php?city=New+York', 'pathname': '/api.php', 'slashes': True}, 'headers': {'host': 'weathers.co'}}\n```\nAs we can see result of evaluation request function is object with request properties like href, headers, host etc. Zpy trying convert it to JSON format. If result of evaluation is `function` and this function has attribute `skip_print='zkip_'` zpy skip result of evaluation (it will be helpfull in async function calls). **Zpy do not return evaluation result if this is a func and func has properties `skip_print='zkip_'` or we use `sync`, `sync_err` function call.**\n#### `sync` function\n`sync` command will send data from **Async** function call and finish current chain. It's realy easy to use.\n```\n(Zpy) j request('http://weathers.co/api.php?city=New+York', (err,res,body) => sync(body)) | \"Python retreive requests results from js `%s`\" %z\nPython retreive requests results from js `{\"apiVersion\":\"1.0\", \"data\":{ \"location\":\"New York\", \"temperature\":\"-14\", \"skytext\":\"Light snow\", \"humidity\":\"64\", \"wind\":\"7.56 km/h\", \"date\":\"03-12-2017\", \"day\":\"Sunday\" } }`\n```\n#### `sync_err`\nThrow error from async function call.\n```\n(Zpy) j setTimeout(function(){ sync_err('SOME ERROR') },200)\nTraceback (most recent call last):\n File ....\n ...\n execjs._exceptions.ProgramError: SOME ERROR\n```\n\n\n## Chain Pool\nChain pool is programming language which have a lot of usefull functions inside Zpy. To start use functions like `[for]` just type this keyword after pipe character `|`, like `|[for]`. Square brackets` []` indicate *Chain pool* function `for`. Chain pool take **stdin** as input stdin, and do some work with stdin, what work you enter after `|[CHAIN_FUNCTION]` keyword, you can use your **favorite language** with Chain pool function.\n### `[for]` function\n`[for]` function iterate throught every item in *array* or *data splited by `\\n`* character as stdin and evaluate every iterated item by any other language.\n#### Syntax\n**`[`** `for` **`]`** `any other language command`, where `[]` is *Chain pool* syntax, `for` - for function. \n![Chain pool [for] function](https://raw.githubusercontent.com/albertaleksieiev/zpy/content/img/Chain%20Pool%20%5Bfor%5D%20function.jpg)\n\nHere we generate data by python, simply by typing array initialization keyword, after that we use `[for]` keyword, split this array to 2 stdin arguments, evaluate shell function `ls` for every argument ('folder1' and 'folder2') and finally join result into array, and send into next chain. And in the last chain we just concatenate array by `,` character.\n```\n(Zpy) ['.', '..'] |[for] ls $z | ','.join(z)\nLICENSE.txt\nREADME.md\nZpy ...., parent_folder content\n```\n\nCode for diagram above. Generate array, use *Chain pool* function `for` and join results by using ',' character.\n```\n(Zpy) ~import numpy as np\n(Zpy) np.arange(10).reshape(2,5).tolist() |[for] [for] z**2\n[[0, 1, 4, 9, 16], [25, 36, 49, 64, 81]]\n```\nIterate every row and column and change every value, by `power` function.\n\n\n#### Examples\n```\n(Zpy) ~import os\n(Zpy) pwd | os.listdir(z) | \"Files divided by commma %s\" % \",\".join(z)\nFiles divided by commma .idea,__pycache__,a.txt,index.py,linux-command-to-list-all-available-commands-and-aliases,README.md,Zpy\n```\nGet current directory using shell command, pipe into python code as z-variable and print result of last chain\n```\n(Zpy) ~from terminaltables import AsciiTable, SingleTable\n(Zpy) ls -lah | z.split('\\n') | [' '.join(x.split()).split(' ') for x in z] | SingleTable(z).table\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 total \u2502 8 \u2502 \u2502 \u2502 \u2502 \u2502 \u2502 \u2502 \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 drwxr-xr-x \u2502 4 \u2502 albert \u2502 staff \u2502 136B \u2502 Mar \u2502 4 \u2502 23:32 \u2502 . \u2502\n\u2502 drwxr-xr-x \u2502 10 \u2502 albert \u2502 staff \u2502 340B \u2502 Mar \u2502 4 \u2502 23:34 \u2502 .. \u2502\n\u2502 -rw-r--r-- \u2502 1 \u2502 albert \u2502 staff \u2502 0B \u2502 Mar \u2502 4 \u2502 23:32 \u2502 empty_file.txt \u2502\n\u2502 -rw-r--r-- \u2502 1 \u2502 albert \u2502 staff \u2502 9B \u2502 Mar \u2502 4 \u2502 23:32 \u2502 not_empy.txt \u2502\n\u2502 \u2502 \u2502 \u2502 \u2502 \u2502 \u2502 \u2502 \u2502 \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\nConvert ugly result after evaluation `ls -lah` to great table!\n**Note** This functionality available inside zpy module `ls -lah | zpy.as_table`\n\n```\n(Zpy) ['http://google.com','http://yandex.ru'] |[for] j request(z, (err,res,body) => sync(body))\n```\n\n```\n(Zpy) `wget -qO- http://example.com | z.split(\" \") | filter(lambda x : \"head\" in x,z) | list(z) \n['html>\\n\\n\\n', '\\n\\n\\n\\n
\\n']\n(Zpy) `wget -qO- http://example.com | z.split(\" \") | filter(lambda x : \"head\" in x,z) | list(z) | \"Total size : %s\" % len(z) \nTotal size : 2\n```\nDownload content from page and count current entrance word 'head'\n```\n(Zpy) find ./ -name \"*.py\" | z.split(\"\\n\")[:2]\n['.//index.py', './/Zpy/languages/LanguageAnalyzer.py']\n(Zpy) find ./ -name \"*.py\" | z.split(\"\\n\")[:2] | \"\\n\".join(z) |grep \"an\"\n.//Zppy/languages/LanguageAnalyzer.py\n```\nFirst evaluation will find file in current directory and get first 2 results. Second evaluation do the same plus filter results by shell command `grep`\n```\n(Zpy) ~import re\n(Zpy) \"https://www.reddit.com/r/books/\" | `wget -qO- $z | re.findall(r\"Book[^\\.].*?\",z,re.IGNORECASE) | \"COUNT : %s\" % len(z)\nCOUNT : 645\n```\n```\n(Zpy) ~import uuid\n(Zpy) uuid.uuid4() | str(z) | cat > random.file\n(Zpy) cat random.file\n7ff48f51-b31d-44c2-9aaf-428a63099739\n```\n\n### **Danger tricks** (Do not evaluate)\n```\n(Zpy) ~from Zpy.Utils import get_linux_commands\n\n(Zpy) ~import random,os\n\n(Zpy) get_linux_commands() | z[random.randint(0,len(z))] | os.system(z)\nstaff com.apple.sharepoint.group.1 everyone localaccounts _appserverusr admin _appserveradm _lpadmin _appstore _lpoperator _develope...\n```\nGet all shell commands declared in Zpy, and execute random one\n\n```\n(Zpy) ~import random,os\n\n(Zpy) ['you are lucky','displaysleepnow','lock'] | z[random.randint(0,len(z))] | os.system(\"pmset %s\" %z)\n0\n```\nIf you run on OSX, 33% nothing happens\n### License\nThe module is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/albertaleksieiev/zpy/archive/0.1.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://albertaleksieiev.github.io/zpy/", "keywords": "python,command,line,shell,unix,terminal", "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "zpyshell", "package_url": "https://pypi.org/project/zpyshell/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/zpyshell/", "project_urls": { "Download": "https://github.com/albertaleksieiev/zpy/archive/0.1.tar.gz", "Homepage": "https://albertaleksieiev.github.io/zpy/" }, "release_url": "https://pypi.org/project/zpyshell/0.1.2.0/", "requires_dist": null, "requires_python": null, "summary": "Command line shell with script languages, like python", "version": "0.1.2.0" }, "last_serial": 2914580, "releases": { "0.1.1.9": [ { "comment_text": "", "digests": { "md5": "948571250b7f2907099c7c401a4b15b1", "sha256": "60050480916f72f31ffff427dc6e278594aca00347b8d2c032cbe11108bfb3f2" }, "downloads": -1, "filename": "zpyshell-0.1.1.9.zip", "has_sig": false, "md5_digest": "948571250b7f2907099c7c401a4b15b1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 63074, "upload_time": "2017-05-31T19:44:53", "url": "https://files.pythonhosted.org/packages/82/78/fc0f44eb393ff163b2c05a69f7bd7e01c55562b6793c33d552a14f7d4ab7/zpyshell-0.1.1.9.zip" } ], "0.1.2.0": [ { "comment_text": "", "digests": { "md5": "68b29fc810c3848e2bb063c16a663142", "sha256": "66c0d52453713e2e48e21745bc93e7d671ff9916df6fceb4b038814bf8e9f88f" }, "downloads": -1, "filename": "zpyshell-0.1.2.0.zip", "has_sig": false, "md5_digest": "68b29fc810c3848e2bb063c16a663142", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 63116, "upload_time": "2017-05-31T19:59:51", "url": "https://files.pythonhosted.org/packages/b2/0b/825e0c607b495793ce38190adc2205d568a026eaec09bfc0b49e25c8914d/zpyshell-0.1.2.0.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "68b29fc810c3848e2bb063c16a663142", "sha256": "66c0d52453713e2e48e21745bc93e7d671ff9916df6fceb4b038814bf8e9f88f" }, "downloads": -1, "filename": "zpyshell-0.1.2.0.zip", "has_sig": false, "md5_digest": "68b29fc810c3848e2bb063c16a663142", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 63116, "upload_time": "2017-05-31T19:59:51", "url": "https://files.pythonhosted.org/packages/b2/0b/825e0c607b495793ce38190adc2205d568a026eaec09bfc0b49e25c8914d/zpyshell-0.1.2.0.zip" } ] }