{ "info": { "author": "Dan Bradham", "author_email": "danielbradham@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "=====\r\nScrim\r\n=====\r\n.. image:: https://travis-ci.org/danbradham/scrim.svg?branch=master\r\n :target: https://travis-ci.org/danbradham/scrim\r\n\r\nA *scrim* is a piece of cloth that's opaque until lit from behind. Like a scrim, **Scrim** provides opaque scripts to wrap python command line tools and a transparent python api to send shell commands up to the user's shell.\r\n\r\n\r\nWhy would I need Scrim?\r\n=======================\r\nWhen writing command line tools in python, changes to--let's say--environment variables, don't persist when the python process exits. This means we can't write certain types of tools in pure python, we need to revert to our shell's scripting language instead. That's why tools like virtualenvwrapper are written in shell scripting languages instead of pure python. **Scrim** provides opaque shell scripts that wrap your python cli, so you can continue writing the interfaces for your python programs in python.\r\n\r\n\r\nHow does it work?\r\n=================\r\n.. image:: images/scrim_diagram.png\r\n\r\nIn this diagram the *Scrim Script* is the opaque shell script provided by the scrim package. Following along with the diagram, the *User* calls the cli command. This invokes the *Scrim Script* which sets these environment variables:\r\n\r\n - **SCRIM_SHELL** - name of the shell process (powershell.exe, cmd.exe)\r\n - **SCRIM_PATH** - path to temp script which python will write\r\n - **SCRIM_SCRIPT** - full path to the Scrim Script\r\n - **SCRIM_AUTO_WRITE** - whether or not to automatically write the temp script when python exits.\r\n\r\nThen the *Scrim Script* invokes the actual *Python CLI* passing all arguments from the *User*. The *Python CLI* can now use the scrim api to append commands to a list. When the python program exits, the list of commands is written to a temporary script file. The *Scrim Script* now continues and executes the temporary script file if it exists. Finally the *Scrim Script* removes any temporary files and unsets the above environment variables.\r\n\r\n\r\nQuickstart\r\n==========\r\nFirst add **Scrim** scripts to your project using **Scrim's** cli.\r\n\r\n::\r\n\r\n > cd mytool\r\n > scrim add --entry_point pymytool\r\n\r\n Creating scripts for: pymytool\r\n Created bin/mytool.bat\r\n Created bin/mytool.ps1\r\n Created bin/mytool.sh\r\n\r\n Add the following section to your package setup:\r\n\r\n scripts=[\r\n 'bin/mytool.bat',\r\n 'bin/mytool.ps1',\r\n 'bin/mytool.sh'\r\n ],\r\n\r\nAssume that *mytool* is a python project containing a setup.py file. Here we've provided `scrim add` with the name of the entry_point to our python cli. If you've got multiple entry_points already defined in your package you can use::\r\n\r\n > scrim add --all_entry_points\r\n ...\r\n\r\nThis will add *Scrim Scripts* to each console_script you've defined in entry_points.\r\n\r\nNow that you're project has Scrim added to it let's take a look at the python side.\r\n\r\n::\r\n\r\n import click\r\n from scrim import get_scrim\r\n scrim = get_scrim()\r\n\r\n @click.command()\r\n def mytool():\r\n scrim.set_env('MYTOOL', \"Hello World!\")\r\n\r\n if __name__ == '__main__':\r\n mytool()\r\n\r\nWe use `get_scrim` to get an instance of `Scrim`. Then we append commands to the scrim and those will be written to a shell script when python exits. After python exits the *scrim script* will check to see if a shell script exists and execute it. In this case the environment variable *MYTOOL* will be set to *Hello World!*.\r\n\r\n\r\nInstalling a library that uses Scrim\r\n====================================\r\n\r\nWindows\r\n-------\r\nA simple `pip install` will do you. The scrim scripts\r\nwill be picked up normally from your command line, you won't even know they\r\nare there!\r\n\r\nUnix Systems\r\n------------\r\nIn addition to your standard `pip install` you also have to source the scrim\r\nscript after installation. It usually ends up in one of these locations:\r\n\r\n - {virtualenv_path}/bin/{entry_point}.sh\r\n - /usr/local/bin/{entry_point}.sh\r\n\r\n\r\nSupported Shells\r\n================\r\n\r\n - bash\r\n - cmd\r\n - powershell\r\n\r\n\r\nTo Do\r\n=====\r\n\r\n - More tests...\r\n - Support more shells: fish, csh, zsh...\r\n - Add more commands to the `Scrim`\r\n - Extend scrim cli to better support a variety of entry_points scenarios\r\n\r\n - Currently we only capture `setup` entry_points when defined as a\r\n dict.\r\n - We also only support entry_points beginning with py.\r\n - Parse setup.cfg in addition to setup.py\r\n\r\n\r\nTests\r\n=====\r\nUse nose to manually run the scrim test suite.\r\n\r\n::\r\n\r\n > nosetests -v -s --with-doctest\r\n\r\n\r\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/danbradham/scrim.git", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "scrim", "package_url": "https://pypi.org/project/scrim/", "platform": "", "project_url": "https://pypi.org/project/scrim/", "project_urls": { "Homepage": "https://github.com/danbradham/scrim.git" }, "release_url": "https://pypi.org/project/scrim/0.1.0/", "requires_dist": [ "click (>=6.7)", "psutil (>=5.2)", "fstrings (>=0.1.0)", "six (>=1.10.0)" ], "requires_python": "", "summary": "Opaque Python CLI Wrapper", "version": "0.1.0" }, "last_serial": 3440831, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "6d86092fcca8bd8cef202b39a6219748", "sha256": "82163623653e568a99aae974fe3b89937390f5378cb911dbc315f3fff97bc7d6" }, "downloads": -1, "filename": "scrim-0.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "6d86092fcca8bd8cef202b39a6219748", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11424, "upload_time": "2017-03-12T23:17:39", "url": "https://files.pythonhosted.org/packages/b5/05/151d672bcf3eb419ba02f57126f2ab06898cc6a605363b7143ee8d55900f/scrim-0.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ba12332c944264e8c1b054e34d8248c0", "sha256": "1ba3fbf2fb46799f81d305d31da9602d0bd688d5e0131d52f530474ef4d82977" }, "downloads": -1, "filename": "scrim-0.0.1.tar.gz", "has_sig": false, "md5_digest": "ba12332c944264e8c1b054e34d8248c0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7095, "upload_time": "2017-03-12T23:17:40", "url": "https://files.pythonhosted.org/packages/cc/91/9199850d6ce6f2e00ec370bb3f95d3e314ba7ba70667a690391bc1c15a66/scrim-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "035f3ae14a606c6bd50ac3eff849b9fe", "sha256": "733ea4703747bdb10017a80cb703c9fcbc568180c208e176ac059ff079f245d8" }, "downloads": -1, "filename": "scrim-0.0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "035f3ae14a606c6bd50ac3eff849b9fe", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11438, "upload_time": "2017-03-12T23:57:16", "url": "https://files.pythonhosted.org/packages/80/22/03663c9694ee851f9b3f93f8f320b9ec4e0a14dc0c571667b913af8fe180/scrim-0.0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "31f6230f89084c0a8a5e2f2e320521f1", "sha256": "55b579282c2d82eec3ecbac82c89637fe50425d0ade54e1d53808b8ab62dd7db" }, "downloads": -1, "filename": "scrim-0.0.2.tar.gz", "has_sig": false, "md5_digest": "31f6230f89084c0a8a5e2f2e320521f1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7148, "upload_time": "2017-03-12T23:57:17", "url": "https://files.pythonhosted.org/packages/fb/25/26abd4077bdaad60f9d3f372499f19bc00e4eabe7c69f441eb44fe824f58/scrim-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "38ea4bfe7cd2734581d856983ab16556", "sha256": "8d7bc99730f5a249f51b94da7e9ee354451f86fad45f33d763084323397adac8" }, "downloads": -1, "filename": "scrim-0.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "38ea4bfe7cd2734581d856983ab16556", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 12576, "upload_time": "2017-03-13T00:13:11", "url": "https://files.pythonhosted.org/packages/93/38/134c8e70fb8af011337cdc3f0c78dfaed841ddc215191bc06d8d8745d077/scrim-0.0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "47f7b77973cd5064ee081fc58c0e622f", "sha256": "c430916cbda040515dff8ff18e21e058b5b838286c94aafb97aa651738845fd5" }, "downloads": -1, "filename": "scrim-0.0.3.tar.gz", "has_sig": false, "md5_digest": "47f7b77973cd5064ee081fc58c0e622f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7841, "upload_time": "2017-03-13T00:13:13", "url": "https://files.pythonhosted.org/packages/7e/92/cdc7a745671604b1aee4215906e92e73fee661f6581568e14ddf2a18c9ad/scrim-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "ac5ef3957b46a85f7dee7e417e429d90", "sha256": "206b45606e9f298006ffc2feff7ab711fbf6f6716b34e843f6d8f24d6ccd4697" }, "downloads": -1, "filename": "scrim-0.0.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ac5ef3957b46a85f7dee7e417e429d90", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 12628, "upload_time": "2017-03-13T01:30:40", "url": "https://files.pythonhosted.org/packages/41/df/ba6a1841e1af8511822b773a2eb06405ba5cfdf7d910488cfe998ea46f6a/scrim-0.0.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6b6e119ac78e0fa7ceb9895d708f92a0", "sha256": "95b14ba3bbffc119ff326e85b89abf5fbcc7b36c9598cc0de09fc5894baafb32" }, "downloads": -1, "filename": "scrim-0.0.4.tar.gz", "has_sig": false, "md5_digest": "6b6e119ac78e0fa7ceb9895d708f92a0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7879, "upload_time": "2017-03-13T01:30:41", "url": "https://files.pythonhosted.org/packages/8b/dd/ca7555959288cd305e38d0bee4363f36393320e54c8ef2222305cd1e76b6/scrim-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "f90afd30d4f9d20584a73a06b63ca9db", "sha256": "4a544e2f05d07859034c5f66769d4b2e75c2e120ee85f806313a16ab8b9b1420" }, "downloads": -1, "filename": "scrim-0.0.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f90afd30d4f9d20584a73a06b63ca9db", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11733, "upload_time": "2017-03-13T01:43:11", "url": "https://files.pythonhosted.org/packages/e2/f5/4aa3ea0eff6f77d6ea88e9772bcad5183261d06dc52328a67b5165cd973a/scrim-0.0.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3e9958a6416468fe36f4c1a48ce33cfe", "sha256": "f8e42f332ba2b9527b8b06b0194807b36d50eec6aee35703d5745c3452eba9ac" }, "downloads": -1, "filename": "scrim-0.0.5.tar.gz", "has_sig": false, "md5_digest": "3e9958a6416468fe36f4c1a48ce33cfe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7877, "upload_time": "2017-03-13T01:43:12", "url": "https://files.pythonhosted.org/packages/1a/f9/fc5b42920c875b8c32ec10d92822cdf8c49c98ea5b3293d6af357f8c989d/scrim-0.0.5.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "4c6e2da50aa7884ea399402f2398f75e", "sha256": "ef9c7abec2f1dc1db677bfddd9c57a2fc715276a24d121f582573ce1c014c421" }, "downloads": -1, "filename": "scrim-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "4c6e2da50aa7884ea399402f2398f75e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 15810, "upload_time": "2017-12-24T18:05:40", "url": "https://files.pythonhosted.org/packages/f5/37/f9d2eabfbb160a93b7d0141f846731498682b3d26c112da13bcc3c8e8cd9/scrim-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "525537d4a3445de5ab1f1a9dffd12fed", "sha256": "ce5b00742ea9245cb712e46b524ee81dc7b742636b4f89ee56e1547b080c05c9" }, "downloads": -1, "filename": "scrim-0.1.0.tar.gz", "has_sig": false, "md5_digest": "525537d4a3445de5ab1f1a9dffd12fed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12674, "upload_time": "2017-12-24T18:05:41", "url": "https://files.pythonhosted.org/packages/e3/ff/ecdd87d91753634da09eca8323f33fe8c8c460dd580656d687f4cc06e45c/scrim-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4c6e2da50aa7884ea399402f2398f75e", "sha256": "ef9c7abec2f1dc1db677bfddd9c57a2fc715276a24d121f582573ce1c014c421" }, "downloads": -1, "filename": "scrim-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "4c6e2da50aa7884ea399402f2398f75e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 15810, "upload_time": "2017-12-24T18:05:40", "url": "https://files.pythonhosted.org/packages/f5/37/f9d2eabfbb160a93b7d0141f846731498682b3d26c112da13bcc3c8e8cd9/scrim-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "525537d4a3445de5ab1f1a9dffd12fed", "sha256": "ce5b00742ea9245cb712e46b524ee81dc7b742636b4f89ee56e1547b080c05c9" }, "downloads": -1, "filename": "scrim-0.1.0.tar.gz", "has_sig": false, "md5_digest": "525537d4a3445de5ab1f1a9dffd12fed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12674, "upload_time": "2017-12-24T18:05:41", "url": "https://files.pythonhosted.org/packages/e3/ff/ecdd87d91753634da09eca8323f33fe8c8c460dd580656d687f4cc06e45c/scrim-0.1.0.tar.gz" } ] }