{ "info": { "author": "Khan Academy", "author_email": "opensource+pypi@khanacademy.org", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7" ], "description": "Slicker: A Tool for Moving Things in Python\n-------------------------------------------\n\n[![Build Status](https://travis-ci.org/Khan/slicker.svg?branch=master)](https://travis-ci.org/Khan/slicker)\n\nIf you've ever tried to move a function or class in python, you'll find it's\nkind of a pain: you have to not only move the definition (and its imports,\netc.) but also update references across the codebase. Slicker is a tool for\ndoing just that!\n\n## Installation\n\n`pip install slicker`\n\n## Usage\n\nTo move a function `myfunc` defined in `foo/bar.py` to `foo/baz.py`:\n```\nslicker foo.bar.myfunc foo.baz.myfunc\n```\n\nThe same syntax works if `myfunc` is instead a constant or class (although I\nsure hope you didn't name a class `myfunc`!). It also works if you want to\nchange the name of `myfunc`:\n```\nslicker foo.bar.myfunc foo.bar.new_name_for_myfunc\n```\n(And you can also make both changes at once, in the natural way.)\n\nTo move an entire module `foo/bar.py` to `foo/baz.py` you can do similarly:\n```\nslicker foo.bar foo.baz\n```\nor use filenames like:\n```\nslicker foo/bar.py foo/baz.py\n```\n\nYou can also move a symbol into an existing module, or a module into an\nexisting directory, just like `mv`. So this is equivalent to the first\nexample:\n```\nslicker foo.bar.myfunc foo.baz\n```\nAnd to move `foo/bar.py` to a new file `newfoo/bar.py` in an existing directory\n`newfoo/`, you could do\n```\nslicker foo.bar newfoo # (or slicker foo/bar.py newfoo/)\n```\nUsing this syntax, you can also specify multiple things to move, so you could\nmove both `foo/bar.py` and `foo/baz.py` to `newfoo/` with\n```\nslicker foo/bar.py foo/baz.py newfoo/\n```\n\nYou can tell slicker to use an alias when adding imports using `-a`/`--alias`:\n```\nslicker foo.bar.myfunc foo.baz.myfunc --alias baz\n```\nin which case slicker will add `from foo import baz` everywhere instead of\n`import foo.baz`. (You could also have used `--alias foobaz` in which case\nwe would have done `import foo.baz as foobaz`.)\n\nIf you prefer to move the actual definition yourself, and just have slicker\nupdate the references, you can pass `--no-automove`. It's probably best to run\n`slicker` after doing said move.\n\nFor a full list of options, run `slicker --help`.\n\n\n## Frequently and Infrequently Asked Questions\n\n### What does slicker mean if it says \"This import may be used implicitly.\"?\n\nIf you do `import foo.bar`, and some other file (perhaps another one you\nimport) does `import foo.baz`, then your `foo` now also has a `foo.baz`, and so\nyou can do `foo.baz.func()` with impunity, even though no import in your file\ndirectly mentions that module. (This is because `foo` in both files refers to\nthe same object -- a.k.a. `sys.modules['foo']` -- and so when the other file\ndoes `import foo.baz` it attaches `baz` to that shared object.) So if you've\nasked slicker to move `foo.bar` to `newfoo.bar`, when updating this file, it\nwould like to replace the `import foo.bar` with `import newfoo.bar`, but it\ncan't -- you're actually still using the import. So it will warn you of this\ncase, and let you sort things out by hand.\n\n### Slicker left me with a bunch of misindented or long lines!\n\nYep, we don't fix these correctly (yet). Your linter should tell you what to\nfix, though.\n\n### Why is it called slicker?\n\nBecause pythons slither to move around, but this way is, uh, slicker. Which is\nto say: it seemed like a good idea at the time and as far as I could tell the\nname wasn't already taken.\n\n### How does it work?\n\nSee the [blog post](http://engineering.khanacademy.org/posts/slicker.htm) for\nan overview. If that's not enough, bug the authors or read the source!\n\n### Why don't you just use [PyCharm](https://www.jetbrains.com/pycharm/) or [rope](https://github.com/python-rope/rope)?\n\nGood question -- we tried! Both are great projects and do a lot of things\nslicker doesn't; if they work for you then definitely use them. But for us,\nthey were a little buggy and didn't fit our workflow. For more details, see\nthe [blog post](http://engineering.khanacademy.org/posts/slicker.htm).\n\n### Why don't you just use `codemod` or `sed`/`perl`?\n\nGood question -- we tried! But it takes a lot of gluing things together to\nfigure out all the right references to fix up in each file. And there's\nbasically no hope of doing the right thing when fixing up string-references.\nWe needed something that knew what python imports mean and could handle their\nspecial cases.\n\n## Changelog\n\n### 0.9.2\n\n- Fix description on PyPI, again\n\n### 0.9.2\n\n- Fix description on PyPI\n\n### 0.9.1\n\n- Handle relative imports correctly\n- Lots of internal refactoring\n\n### 0.9\n\n- Initial release to PyPI\n\n\n", "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/Khan/slicker", "keywords": "codemod,refactor,refactoring", "license": "", "maintainer": "", "maintainer_email": "", "name": "slicker", "package_url": "https://pypi.org/project/slicker/", "platform": "", "project_url": "https://pypi.org/project/slicker/", "project_urls": { "Homepage": "https://github.com/Khan/slicker" }, "release_url": "https://pypi.org/project/slicker/0.9.3/", "requires_dist": [ "asttokens (==1.1.8)", "tqdm (==4.19.5)", "fix-includes (==0.2)" ], "requires_python": "", "summary": "A tool for moving python files.", "version": "0.9.3" }, "last_serial": 3728046, "releases": { "0.9": [ { "comment_text": "", "digests": { "md5": "1404e929698265d529c487fd612a47a8", "sha256": "652f1f0d6ab19c2a361b984df6f04639533da7bda779bacd65f81ee8188d4b97" }, "downloads": -1, "filename": "slicker-0.9-py2.7.egg", "has_sig": false, "md5_digest": "1404e929698265d529c487fd612a47a8", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 73101, "upload_time": "2018-02-02T22:13:31", "url": "https://files.pythonhosted.org/packages/ae/57/f4c8c2b7f08bf3026d2180e3539e25881190d644648b6bd3b342984a33d4/slicker-0.9-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "1961cbeabd7909c7c8602eb162de4819", "sha256": "30c9bac636183020c3ad6369f21ab418e3b435a9a479ff082e53f086e80952b0" }, "downloads": -1, "filename": "slicker-0.9-py2-none-any.whl", "has_sig": false, "md5_digest": "1961cbeabd7909c7c8602eb162de4819", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 37562, "upload_time": "2018-02-02T22:13:29", "url": "https://files.pythonhosted.org/packages/79/cd/4f6e970570a3d46c8042091b6c4f447fdc817e2aa7fbd2b64e064db1c8d9/slicker-0.9-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "de74d1336f9e8039ac1ffa5a66b4aab9", "sha256": "8febc9b9a6c8f7f4821875d57b8e705b9137cb5910c7ddfc584434f277a5c5fc" }, "downloads": -1, "filename": "slicker-0.9.tar.gz", "has_sig": false, "md5_digest": "de74d1336f9e8039ac1ffa5a66b4aab9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 35377, "upload_time": "2018-02-02T22:13:32", "url": "https://files.pythonhosted.org/packages/1f/12/04e856a825dde9d9e127d7b4616a0ecca2d11e6cdda3d544f5ad19871a57/slicker-0.9.tar.gz" } ], "0.9.1": [ { "comment_text": "", "digests": { "md5": "e6510118f1fe2fb3bc2bf225a2c16d0c", "sha256": "5196f3d92be644de68b0e889346bf6171ee074eb80304fb535685f85d9b751fa" }, "downloads": -1, "filename": "slicker-0.9.1-py2-none-any.whl", "has_sig": false, "md5_digest": "e6510118f1fe2fb3bc2bf225a2c16d0c", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 43366, "upload_time": "2018-04-02T23:31:37", "url": "https://files.pythonhosted.org/packages/23/a8/2c4e98c417a090396eaf18dad4d5ab657a8ed477c24304a12efa1e2aff27/slicker-0.9.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "34ae1c485babed9744a38307add58e6c", "sha256": "67c99c089a4f7ce1b24335239602bf255bd889439f256c11def48c9f2f1c6c5c" }, "downloads": -1, "filename": "slicker-0.9.1.tar.gz", "has_sig": false, "md5_digest": "34ae1c485babed9744a38307add58e6c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 38083, "upload_time": "2018-04-02T23:31:39", "url": "https://files.pythonhosted.org/packages/f5/e1/6dc3bb1430880330f11ed3f15b455a15ba8a5f590a38fc556bd7e698ba28/slicker-0.9.1.tar.gz" } ], "0.9.2": [ { "comment_text": "", "digests": { "md5": "94f07e0427d13da5d2c91b679d1273de", "sha256": "1370f7f50a725c289fffbeaae709d22943558930e218f621f91130facb15a692" }, "downloads": -1, "filename": "slicker-0.9.2-py2-none-any.whl", "has_sig": false, "md5_digest": "94f07e0427d13da5d2c91b679d1273de", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 43365, "upload_time": "2018-04-02T23:45:07", "url": "https://files.pythonhosted.org/packages/af/9f/b6fab65f7b18bffb4ea8f406d0a7fd196589e9bdc98273f235e6c2d42e6f/slicker-0.9.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a48560ff0619dc6d31dfdf84359002af", "sha256": "cb0a275bed5b0c2f7eb50d1fcec0605547135383fe6cb43d7100341c463cf629" }, "downloads": -1, "filename": "slicker-0.9.2.tar.gz", "has_sig": false, "md5_digest": "a48560ff0619dc6d31dfdf84359002af", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 38110, "upload_time": "2018-04-02T23:45:08", "url": "https://files.pythonhosted.org/packages/b0/88/6651db80aa10063488124efb417cd17852fb85532d7936d79b21d0a7ba75/slicker-0.9.2.tar.gz" } ], "0.9.3": [ { "comment_text": "", "digests": { "md5": "d7830eb2e6b4db2c30b59bda54e66ee0", "sha256": "bf55ace75a453be01c6bc160559002dfe91ceddf1e6aae01df9f378fc984ef76" }, "downloads": -1, "filename": "slicker-0.9.3-py2-none-any.whl", "has_sig": false, "md5_digest": "d7830eb2e6b4db2c30b59bda54e66ee0", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 44464, "upload_time": "2018-04-03T00:09:40", "url": "https://files.pythonhosted.org/packages/51/e5/0b26c32fe825451c294715710db41abefff05fd18bbe32bab2a351603576/slicker-0.9.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0a073bb680d67614aee425d12b479339", "sha256": "b2e23ab053c1d32175d61b8544b633f12e211b00c1e82d79003587ae2625bbbb" }, "downloads": -1, "filename": "slicker-0.9.3.tar.gz", "has_sig": false, "md5_digest": "0a073bb680d67614aee425d12b479339", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 38622, "upload_time": "2018-04-03T00:09:41", "url": "https://files.pythonhosted.org/packages/e2/6b/11b22ec0f46a60c7e81fcdac2bdc11bee4edf4d6730ed0973a7ab7578b28/slicker-0.9.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d7830eb2e6b4db2c30b59bda54e66ee0", "sha256": "bf55ace75a453be01c6bc160559002dfe91ceddf1e6aae01df9f378fc984ef76" }, "downloads": -1, "filename": "slicker-0.9.3-py2-none-any.whl", "has_sig": false, "md5_digest": "d7830eb2e6b4db2c30b59bda54e66ee0", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 44464, "upload_time": "2018-04-03T00:09:40", "url": "https://files.pythonhosted.org/packages/51/e5/0b26c32fe825451c294715710db41abefff05fd18bbe32bab2a351603576/slicker-0.9.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0a073bb680d67614aee425d12b479339", "sha256": "b2e23ab053c1d32175d61b8544b633f12e211b00c1e82d79003587ae2625bbbb" }, "downloads": -1, "filename": "slicker-0.9.3.tar.gz", "has_sig": false, "md5_digest": "0a073bb680d67614aee425d12b479339", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 38622, "upload_time": "2018-04-03T00:09:41", "url": "https://files.pythonhosted.org/packages/e2/6b/11b22ec0f46a60c7e81fcdac2bdc11bee4edf4d6730ed0973a7ab7578b28/slicker-0.9.3.tar.gz" } ] }