{ "info": { "author": "Joshua Fehler", "author_email": "jsfehler@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8" ], "description": "shibari\n=======\n\n.. image:: https://img.shields.io/pypi/v/shibari.svg\n :target: https://pypi.org/project/shibari\n :alt: PyPI\n\n.. image:: https://img.shields.io/pypi/pyversions/shibari.svg\n :alt: PyPI - Python Version\n :target: https://github.com/jsfehler/shibari\n\n.. image:: https://img.shields.io/github/license/jsfehler/shibari.svg\n :alt: GitHub\n :target: https://github.com/jsfehler/shibari/blob/master/LICENSE\n\n.. image:: https://travis-ci.org/jsfehler/stere.svg?branch=master\n :target: https://travis-ci.org/jsfehler/stere\n\nBind functions to only run once inside a desired scope.\n\nDocumentation\n-------------\n\nThe Rig class exposes two methods: `bind` and `free`. Bind takes one argument: A name for a scope to bind the function.\n\nFunctions wrapped with `bind` will be called only once until the scope it is inside is freed.\n\nFunctions wrapped with `free` will free all the bound functions in a specific scope after the function's execution.\n\nExample:\n\n.. code-block:: python\n\n import shibari\n\n\n rig = shibari.Rig('ebi')\n\n\n @rig.bind('ebi')\n def timestamp():\n return str(time.time())\n\n\n @rig.free('ebi')\n def finish():\n pass\n\n\n >>> t = timestamp()\n >>> t2 = timestamp()\n >>> assert t == t2\n\n >>> finish()\n\n >>> t3 = timestamp()\n >>> t4 == timestamp()\n >>> assert t != t3\n >>> assert t3 == t4\n\nFunctions that take arguments can be bound, but will always return the same result until they are freed.\n\nExample:\n\n.. code-block:: python\n\n import shibari\n\n\n rig = shibari.Rig('ebi')\n\n\n @rig.bind('ebi')\n def timestamp(a, b):\n return f'{a}_{str(time.time())}_{b}'\n\n\n >>> t = timestamp('goodbye', 'world')\n >>> t2 = timestamp('hello', 'space')\n >>> assert t == t2\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jsfehler/shibari", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "shibari", "package_url": "https://pypi.org/project/shibari/", "platform": "", "project_url": "https://pypi.org/project/shibari/", "project_urls": { "Homepage": "https://github.com/jsfehler/shibari" }, "release_url": "https://pypi.org/project/shibari/0.0.2/", "requires_dist": null, "requires_python": "", "summary": "Bind functions to run only once inside a desired scope.", "version": "0.0.2" }, "last_serial": 5758251, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "68c9b5ab291cd29038dc4bd770801f89", "sha256": "ef265a3d118f2e5a0d3d863e2feb9e8108b4656ccbfd9ff357e8dd25e3fbbf1b" }, "downloads": -1, "filename": "shibari-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "68c9b5ab291cd29038dc4bd770801f89", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3122, "upload_time": "2019-08-28T00:35:25", "url": "https://files.pythonhosted.org/packages/9d/bc/6d3d0f33985f16d1432abd922784f72e0359539ca4b01b5503031691a49c/shibari-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9632fbefd3fcbb84f62d39e209e78a9b", "sha256": "099b69eb7a1a9a7aa6b7fa7c157af7e13e29dedcea8ed3afcba1872d876eec99" }, "downloads": -1, "filename": "shibari-0.0.1.tar.gz", "has_sig": false, "md5_digest": "9632fbefd3fcbb84f62d39e209e78a9b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1743, "upload_time": "2019-08-28T00:35:28", "url": "https://files.pythonhosted.org/packages/6b/d0/4a989079d346dbbf01baaaba1145ea490382903d5e04dcd678ce8f2971ef/shibari-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "4093cd7335946154167217b41fe3fd6f", "sha256": "b38f837c9279b1e30c0c9a0d7dbd3f4086446008ba4bf2fc98d2f8f9b311f306" }, "downloads": -1, "filename": "shibari-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "4093cd7335946154167217b41fe3fd6f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3975, "upload_time": "2019-08-30T04:19:53", "url": "https://files.pythonhosted.org/packages/dd/f7/b78559506ecb906076bb5af72d9280d2b84f75c3455f5ff954f9e3250ed2/shibari-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a784e3a383ad88ccf207fcdfac78a511", "sha256": "53856bbd99b54acafa5ec0676cff1810a49233904610fce75969b591734a465c" }, "downloads": -1, "filename": "shibari-0.0.2.tar.gz", "has_sig": false, "md5_digest": "a784e3a383ad88ccf207fcdfac78a511", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2378, "upload_time": "2019-08-30T04:19:54", "url": "https://files.pythonhosted.org/packages/24/7a/f80bed4a35298ee0d0e7e4dd94c810386e1bd8c3f92f64b60b71129b1875/shibari-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4093cd7335946154167217b41fe3fd6f", "sha256": "b38f837c9279b1e30c0c9a0d7dbd3f4086446008ba4bf2fc98d2f8f9b311f306" }, "downloads": -1, "filename": "shibari-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "4093cd7335946154167217b41fe3fd6f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3975, "upload_time": "2019-08-30T04:19:53", "url": "https://files.pythonhosted.org/packages/dd/f7/b78559506ecb906076bb5af72d9280d2b84f75c3455f5ff954f9e3250ed2/shibari-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a784e3a383ad88ccf207fcdfac78a511", "sha256": "53856bbd99b54acafa5ec0676cff1810a49233904610fce75969b591734a465c" }, "downloads": -1, "filename": "shibari-0.0.2.tar.gz", "has_sig": false, "md5_digest": "a784e3a383ad88ccf207fcdfac78a511", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2378, "upload_time": "2019-08-30T04:19:54", "url": "https://files.pythonhosted.org/packages/24/7a/f80bed4a35298ee0d0e7e4dd94c810386e1bd8c3f92f64b60b71129b1875/shibari-0.0.2.tar.gz" } ] }