{ "info": { "author": "Matt Yan", "author_email": "syan4@ualberta.ca", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Build Tools" ], "description": "# Dark Python\n![travis-badge](https://travis-ci.org/Madoshakalaka/dark-python.svg?branch=master)\n\nPatch python built-in functions and libraries!\n\nCreate your own python!\n\nDo dangerous things in python you've never dreamed of!\n\n## What it does\n\n- patch built-in function\n\n`$ dpython config beautify.py`\n\n```python \n# beautify.py\nfrom pprint import pprint\nprint = pprint\n```\nand just use `$ dpython` as python command line for the rest of your life, every `print` is guaranteed to be pretty.\n\n- patch any package, built-in or not\n\n`$ dpython config troll_packages/random`\n\n```\nrandom\n\u2514\u2500\u2500 __init__.py\n```\n```python\n#__init__.py\ndef randint(a,b):\n return a\n```\n\nAnd now ssh into some production server. `$ sudo alias python3=dpython` and watch the world burn.\n\n## Use case\n\nCombined with [the forbidden fruit](https://github.com/clarete/forbiddenfruit). You can do anything, including:\n\n1. Customize your python however you like. Are you a data scientist who find it impossible to do anything with python vanilla list? No problem! Extend built-in list with numpy array functionality!\n\n2. Patch a shit ton of python code without doing any refactoring\n\n3. Create python **patch package** for other packages\n\n## How to use\n\n`pip install dpython`\n\nBy default, pip creates command line shortcut `$ dpython`. If it does not work, (You're using stupid Windows or something), you can always use `> python -m dpython`\n\n`dpython` by itself works exactly the same as `python` command line.\n\ne.g.:\n\n`$ dpython test.py` runs `test.py`\n\n`$ dpython` opens interactive shell\n\n`$ dpython -m my_module` runs folder `my_module` as a python module\n#\ndpython only has one reserved sub-command which is different from python: `'config'`. You can supply the following instructions:\n\n`$ dpython config [something.py|folder]`. Register either a single `.py` file or a folder containing a python package.\n\n- In the case of `py` file. The supplied file will effectively be executed prior to future `$ dpython` calls. You can call it a startup script.\n- In the case of a package, imports in other code will use the supplied package instead of ones with duplicate names.\n- You can register as many as packages as you like. But only one `.py` startup script.\n\n\n`$ dpython config inspect-script` Print the saved startup script\n\n`$ dpython config clear-script` Reset the saved startup script\n\n`$ dpython config inspect-package` Print registered packages\n\n```shell\n# example output\npatch packages:\nrandom\nnumpy\nargparse\n```\n\n`$ dpython config clear-package` Clear registered packages, won't delete real file.\n```shell\n# example output\nrandom removed\nnumpy removed\nargparse removed\n```\n`$ dpython -h|--help` to print help\n\n## More Examples\n\n- example 1\n\n ```python\n # leEtH4ck3r.py\n oldprint = print\n def print(*args, **kwargs):\n oldprint('Pwned by Dark Python!!!')\n oldprint(*args, **kwargs)\n ```\n `$ dpython register leEtH4ck3r.py`\n\n- example 2\n\n ```python\n # ilovetqdm.py\n from tqdm import trange\n range = trange\n ```\n `$ dpython register ilovetqdm.py`\n\n\n\n## My Stupid Fantasies (todos)\n\n- Write a package called `gwrap` that internally uses `dpython` to extend built-in `argparse`.\n \n `$ gwrap any_cmd_utility.py`\n\n As long as the script uses `argparse`, gwrap will create a GUI, with check boxes replacing boolean arguments. Drop down menus replacing argument choices. Hovering tooltips for argument help. And store command history for autocompletion.\n\n- Install `dpython` on my coworkers computer, screw up the most usual functions like `range()`, `list()`. Alias python=dpython just for fun.", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Madoshakalaka/dark-python", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "dpython", "package_url": "https://pypi.org/project/dpython/", "platform": "", "project_url": "https://pypi.org/project/dpython/", "project_urls": { "Bug Reports": "https://github.com/Madoshakalaka/dark-python/issues", "Funding": "https://github.com/Madoshakalaka/dark-python", "Homepage": "https://github.com/Madoshakalaka/dark-python", "Say Thanks!": "https://github.com/Madoshakalaka/dark-python", "Source": "https://github.com/Madoshakalaka/dark-python" }, "release_url": "https://pypi.org/project/dpython/1.0.5/", "requires_dist": null, "requires_python": ">=3.5", "summary": "Modify python built-in functions and libraries", "version": "1.0.5" }, "last_serial": 5583011, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "9b09905ce5e318568a64a47b65ace71c", "sha256": "38103816f09c0a5314610c250a86d0d6206a1ed2420c391bd430f62faf2d4b20" }, "downloads": -1, "filename": "dpython-1.0.0.tar.gz", "has_sig": false, "md5_digest": "9b09905ce5e318568a64a47b65ace71c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 7381, "upload_time": "2019-07-25T12:00:28", "url": "https://files.pythonhosted.org/packages/7d/bd/2c68995e09dc04fc9dd4ce2fce5422717a0317ae09784875f17878bae7fd/dpython-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "a1698b5fd0a5cc16fec82ed49f5276d8", "sha256": "769926d941b45c11f3af07b012d8518f9b0c23e4bde4c55cd4a967eee3313192" }, "downloads": -1, "filename": "dpython-1.0.1.tar.gz", "has_sig": false, "md5_digest": "a1698b5fd0a5cc16fec82ed49f5276d8", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 7410, "upload_time": "2019-07-25T12:08:44", "url": "https://files.pythonhosted.org/packages/c0/74/87c01e9d76bed87c0efb22be0cf1db40dc9f133148f0bb8937c7390373c0/dpython-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "e74df6cf331c0a2240683b7d7771fe5c", "sha256": "889362160f0bdfbd7f6a4c83641a3552d3cb12ae3471ba96ba889b684bee9e5b" }, "downloads": -1, "filename": "dpython-1.0.2.tar.gz", "has_sig": false, "md5_digest": "e74df6cf331c0a2240683b7d7771fe5c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 7413, "upload_time": "2019-07-25T12:16:31", "url": "https://files.pythonhosted.org/packages/9f/1e/d4e4352a1c9572d1dc2f7feaaa96a138e702a927cab8348f81aa28bd7afb/dpython-1.0.2.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "4fe0186e1336b2d8ae390fa313fbd9ce", "sha256": "859cd892f76cf28c3a0540900cae9cdef511dbf3fb83e46e6b195b441175bf88" }, "downloads": -1, "filename": "dpython-1.0.5.tar.gz", "has_sig": false, "md5_digest": "4fe0186e1336b2d8ae390fa313fbd9ce", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 7402, "upload_time": "2019-07-25T12:31:23", "url": "https://files.pythonhosted.org/packages/ad/3b/f7bebe215f7ab39e88ccc999d2b6672c64dc28cfbb490c5c824cfef14f2c/dpython-1.0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4fe0186e1336b2d8ae390fa313fbd9ce", "sha256": "859cd892f76cf28c3a0540900cae9cdef511dbf3fb83e46e6b195b441175bf88" }, "downloads": -1, "filename": "dpython-1.0.5.tar.gz", "has_sig": false, "md5_digest": "4fe0186e1336b2d8ae390fa313fbd9ce", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 7402, "upload_time": "2019-07-25T12:31:23", "url": "https://files.pythonhosted.org/packages/ad/3b/f7bebe215f7ab39e88ccc999d2b6672c64dc28cfbb490c5c824cfef14f2c/dpython-1.0.5.tar.gz" } ] }