{ "info": { "author": "Kris Dorosz", "author_email": "cypreess@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# snipty [![CircleCI](https://circleci.com/gh/cypreess/snipty/tree/master.svg?style=svg)](https://circleci.com/gh/cypreess/snipty/tree/master)\n\n\nSnipty is a handy \"like a package manager\" tool that helps you to keep track of code snippets in a codebase.\n\nThe motivation behind Snipty is to make \nsnippets DRY again. There is a lot of good code too small to be legitimate packages on their own, that you \nend up copying over and over again to your codebase. Snipty wants to:\n\n* automate the process of downloading snippets from remote snippet websites,\n* manage a `snipty.yml` file to explicitly enumerate your snippet dependencies in the code,\n* allow easy tracking of snippets changes when they are made in your codebase and/or in the snippet source.\n\nYou can read about [how Snipty was born and what problem it tries to address](https://medium.com/@krisdorosz/how-to-use-code-snippets-and-stay-sane-987a2a54c571) in the Medium post.\n\n## Quickstart\n\n### Snippet installation\n\nWe assume you store snippets somewhere in the snippets websites (like Github gist or ghostbin).\nTo install snippet in your code base go to the codebase root and type:\n\n $ snipty install helpers/example_1.py https://ghostbin.com/paste/egbue\n \u2714\ufe0f Snippet helpers/example_1 installed from https://ghostbin.com/paste/egbue\n\n $ ls helpers\n __init__.py example_1.py\n\nSnipty detects that this is python snippet (by given extension) \nand automatically creates `__init__.py` on all subdirectories up to the project root path,\nso your snippet will be importable from python.\n\n\nAt this point a special file `snipty.yml` was created in your codebase. You should track this file in your\ncode versioning system.\n\n\n### Snippets with multiple files inside\n\nSome snippet sites - like gist - allows you to define multiple files under a single URL. Snipty handles this by creating \na directory (rather than a single file) and places all snippet files inside this directory.\n\nInstall snippets that have multiple files inside:\n\n $ snipty install helpers/django https://gist.github.com/cypreess/6670a99b2c1cd7b52b24057f68a1debd \n \u2714\ufe0f Snippet helpers/django installed from https://gist.github.com/cypreess/6670a99b2c1cd7b52b24057f68a1debd\n\n $ ls helpers/django\n __init__.py left_pad.py middleware.py\n\n\n### Deleting and moving snippets\n\nOnce snippet is installed it cannot be installed again to different location as snipty will warn you about \npossible code duplication.\n\n $ snipty install snippets/a https://gist.github.com/cypreess/bc7b4d7c46b9a4cf1411c87b5c65d3d5 \n \u2714\ufe0f Snippet snippets/a installed from https://gist.github.com/cypreess/bc7b4d7c46b9a4cf1411c87b5c65d3d5\n\n $ snipty install snippets/a https://gist.github.com/cypreess/bc7b4d7c46b9a4cf1411c87b5c65d3d5 \n Snippet 'snippets/a' has been already installed.\n\n\n### Snippets maintenance\n\nTo check if your snippets in your codebase differ from the remote links type:\n\n $ snipty check \n \u2714 Snippet snippets/left_pad present and up to date.\n\nor for single package:\n\n $ snipty check snippets/left_pad\n \u2714 Snippet snippets/left_pad present and up to date.\n\nYou can turn on diff displaying by adding argument `--diff`:\n\n snipty check --diff snippets/left_pad\n \u274c Snippet snippets/left_pad file left_pad.py is not present.\n \u274c Snippet snippets/left_pad file middleware.py has changed.\n class EmptyMiddleware:\n + middleware_empty = True\n - pass\n\nCheck will produce exit status of 0 if all snippets are unchanged, otherwise exit status will be equal to number of \nchanged snippets count.\n\n## Helpful environment variables:\n\n* `SNIPTY_PYTHON` - python interpreter that snipty should use to run itself\n* `SNIPTY_ROOT_PATH` - default snipty behaviour is to treat all relative paths according to current directory; \nit can be ovveriden using this path or `-p`/`--path` argument\n* `SNIPTY_TMP` - ovveride temporary directory for downloading snippets\n\n## Help needed\n\nPull requests are very welcome.\n\n- More downloaders needed\n- Tests needed!\n- Docs needed\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/cypreess/snipty", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "snipty", "package_url": "https://pypi.org/project/snipty/", "platform": "", "project_url": "https://pypi.org/project/snipty/", "project_urls": { "Homepage": "https://github.com/cypreess/snipty" }, "release_url": "https://pypi.org/project/snipty/0.9.1/", "requires_dist": [ "requests (>=2.18)", "termcolor (>=1.1.0)", "PyYAML (>=3.13)" ], "requires_python": ">3.6", "summary": "Track snippets use in your codebase with ease", "version": "0.9.1" }, "last_serial": 4436087, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "ab77ba03151b8acdfd133e6532556247", "sha256": "da59b052edf119ac0c6cbaf91f2a364417f3bcb73cb8f0997cf1b0a1b850909b" }, "downloads": -1, "filename": "snipty-0.1.tar.gz", "has_sig": false, "md5_digest": "ab77ba03151b8acdfd133e6532556247", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5008, "upload_time": "2018-06-06T21:04:19", "url": "https://files.pythonhosted.org/packages/77/0b/9c9a3c89d00e37cd9da135aab4d71cc517ba9ea39e0675f21222224d72f6/snipty-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "5a47cf56774c2be98ea192d203eddd1b", "sha256": "97c1d0ef83cda06d3913fee8d4f3aed2bda2cf1941c68d1458df5b064e2c9034" }, "downloads": -1, "filename": "snipty-0.2.tar.gz", "has_sig": false, "md5_digest": "5a47cf56774c2be98ea192d203eddd1b", "packagetype": "sdist", "python_version": "source", "requires_python": ">3.6", "size": 5118, "upload_time": "2018-06-06T21:40:42", "url": "https://files.pythonhosted.org/packages/b5/b6/5aec43b23b0e6aa1cf2a9bc133538dec449511d842fca42845939f9e11aa/snipty-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "d1106ba790c79beb40e214f43754571a", "sha256": "4d0c0f390be48c42e1cf0d1afb0b785be23788155df6c7718708d124f81f4e01" }, "downloads": -1, "filename": "snipty-0.3.tar.gz", "has_sig": false, "md5_digest": "d1106ba790c79beb40e214f43754571a", "packagetype": "sdist", "python_version": "source", "requires_python": ">3.6", "size": 7620, "upload_time": "2018-06-09T13:17:36", "url": "https://files.pythonhosted.org/packages/e4/f0/66135335b244f203cc8b31673a82c2349014323e07d93d1187e0db622f55/snipty-0.3.tar.gz" } ], "0.9.1": [ { "comment_text": "", "digests": { "md5": "0ef8be6af491a00265fbfbcdd4c89189", "sha256": "d131afd72630e973875276394da77a50df69d3d73b825ef53411fdabfdf43727" }, "downloads": -1, "filename": "snipty-0.9.1-py3-none-any.whl", "has_sig": false, "md5_digest": "0ef8be6af491a00265fbfbcdd4c89189", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">3.6", "size": 10388, "upload_time": "2018-10-31T14:32:55", "url": "https://files.pythonhosted.org/packages/5b/42/a5570933fb3f379c47e06f33bdfe13a54153d207ff1be0ae53aeeaecdd5d/snipty-0.9.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "76f9c16c832801cf760ff03acbf715eb", "sha256": "dabd1e2dfacf6ba0ba3f128436874af7b9796fb9709e02964db8d37ad7052dad" }, "downloads": -1, "filename": "snipty-0.9.1.tar.gz", "has_sig": false, "md5_digest": "76f9c16c832801cf760ff03acbf715eb", "packagetype": "sdist", "python_version": "source", "requires_python": ">3.6", "size": 9693, "upload_time": "2018-10-31T14:32:56", "url": "https://files.pythonhosted.org/packages/66/cf/bfe824d33ff84b3d0cda8bbf6b79636a1c5d5ecc487122a65d4b5345067f/snipty-0.9.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0ef8be6af491a00265fbfbcdd4c89189", "sha256": "d131afd72630e973875276394da77a50df69d3d73b825ef53411fdabfdf43727" }, "downloads": -1, "filename": "snipty-0.9.1-py3-none-any.whl", "has_sig": false, "md5_digest": "0ef8be6af491a00265fbfbcdd4c89189", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">3.6", "size": 10388, "upload_time": "2018-10-31T14:32:55", "url": "https://files.pythonhosted.org/packages/5b/42/a5570933fb3f379c47e06f33bdfe13a54153d207ff1be0ae53aeeaecdd5d/snipty-0.9.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "76f9c16c832801cf760ff03acbf715eb", "sha256": "dabd1e2dfacf6ba0ba3f128436874af7b9796fb9709e02964db8d37ad7052dad" }, "downloads": -1, "filename": "snipty-0.9.1.tar.gz", "has_sig": false, "md5_digest": "76f9c16c832801cf760ff03acbf715eb", "packagetype": "sdist", "python_version": "source", "requires_python": ">3.6", "size": 9693, "upload_time": "2018-10-31T14:32:56", "url": "https://files.pythonhosted.org/packages/66/cf/bfe824d33ff84b3d0cda8bbf6b79636a1c5d5ecc487122a65d4b5345067f/snipty-0.9.1.tar.gz" } ] }