{ "info": { "author": "Dario Varotto", "author_email": "dario.varotto@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "sing\n====\n\n|pypi| |build| |Documentation Status| |Updates|\n\nEnsure a single process is running. Using lockfile and process checking.\n\nWhy?\n----\n\nSometime you want that a process runs at most once, for example a\nscheduled cron job that should always finish before starting again. That\nwas my case.\n\nInstall\n-------\n\n.. code:: bash\n\n pip install sing\n\nExamples\n--------\n\nNormally, at the beginning of the file, you may want to declare, that\nyou want to be the single instance:\n\n.. code:: python\n\n from sing import single\n\n assert single()\n\nThat's it, for most of the use case, you don't need anything else. The\nassert will fail if the lock is already taken.\n\nThis uses a pid lockfile, in a temporary folder to ensure this. More on\nthat in ``sing.py``\n\nYou may want to grant all the lock from the same process, in that case\nyou'll need.\n\n.. code:: python\n\n assert single(allow_all_from_this_process=True)\n\nYou may have different subsections, and you want to have different\nlocks, even if you're on the same process, both of them will return\nTrue:\n\n.. code:: python\n\n single(flavor='first')\n single(flavor='second')\n\nFinally, if a PID file is there, but the process died, you may want to\ngrant the lock. Use the ``ensure_process_running`` to check it.\n\nNotes\n-----\n\n- Free software: MIT license\n- Documentation: https://python-sing.readthedocs.io.\n\nCredits\n-------\n\nThis package was created with\n`Cookiecutter `__ and the\n`audreyr/cookiecutter-pypackage `__\nproject template.\n\nLot of inspiration comes from\n`pycontribs/tendo `__ that serves\nthe same purpose. I needed PID file, and allow same process grants, so I\nmade this package.\n\n.. |pypi| image:: https://img.shields.io/pypi/v/sing.svg\n :target: https://pypi.python.org/pypi/sing\n.. |build| image:: https://img.shields.io/travis/dariosky/python-sing.svg\n :target: https://travis-ci.org/dariosky/python-sing\n.. |Documentation Status| image:: https://readthedocs.org/projects/python-sing/badge/?version=latest\n :target: https://python-sing.readthedocs.io/en/latest/?badge=latest\n.. |Updates| image:: https://pyup.io/repos/github/dariosky/python-sing/shield.svg\n :target: https://pyup.io/repos/github/dariosky/sing/\n\n\n=======\nHistory\n=======\n\n0.1.0 (2018-02-25)\n------------------\n\n* First release on PyPI.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/dariosky/python-sing", "keywords": "sing", "license": "MIT license", "maintainer": "", "maintainer_email": "", "name": "sing", "package_url": "https://pypi.org/project/sing/", "platform": "", "project_url": "https://pypi.org/project/sing/", "project_urls": { "Homepage": "https://github.com/dariosky/python-sing" }, "release_url": "https://pypi.org/project/sing/0.1.4/", "requires_dist": null, "requires_python": "", "summary": "Ensure a single process is running. Using lockfile and process checking.", "version": "0.1.4" }, "last_serial": 3617143, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "4e7ec1ccbeaf1db995d096bb15f443d1", "sha256": "f0ea2468909afeae1d39075547efedf2c4d1c297ea5f115170efc5c9edff5a0e" }, "downloads": -1, "filename": "sing-0.1.0.tar.gz", "has_sig": false, "md5_digest": "4e7ec1ccbeaf1db995d096bb15f443d1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8918, "upload_time": "2018-02-25T13:35:38", "url": "https://files.pythonhosted.org/packages/cd/7d/d13e2784e2dd0e3b575749db8d453161d1f8afac0b794e4ee828caaba682/sing-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "b7118e54b2baf124476e650c87a11184", "sha256": "9367f85cbe324cba3f0abadf7c1fe647d738d83ee98746494d7902181117fdb1" }, "downloads": -1, "filename": "sing-0.1.1.tar.gz", "has_sig": false, "md5_digest": "b7118e54b2baf124476e650c87a11184", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9579, "upload_time": "2018-02-25T14:03:30", "url": "https://files.pythonhosted.org/packages/ca/a7/a0ab361ccb874d09ecbf45c250f4c0705fe745e94a7fcd4da901915189c4/sing-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "cbc1b658b2f1b583ecfcf229266fe46f", "sha256": "229b06a52d7b962736cf2aa933a23e90a513b2dbac37773996cecf3a19899ddb" }, "downloads": -1, "filename": "sing-0.1.2.tar.gz", "has_sig": false, "md5_digest": "cbc1b658b2f1b583ecfcf229266fe46f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9586, "upload_time": "2018-02-25T14:20:44", "url": "https://files.pythonhosted.org/packages/74/ad/5d088ce83efebfcf5623b1c059cd53aceb40c9347e47646abe64ec0c3750/sing-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "fbdabe7b328709c8107ebb37e166b6cf", "sha256": "639b07de797130db1268236b5fbe311e80f227e3d09eb539925b6515ada2d568" }, "downloads": -1, "filename": "sing-0.1.3.tar.gz", "has_sig": false, "md5_digest": "fbdabe7b328709c8107ebb37e166b6cf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9643, "upload_time": "2018-02-26T10:01:35", "url": "https://files.pythonhosted.org/packages/80/55/1f6fc060bbc4bed8b9b50742ce6621a0e68c642e02aff75b40c1cea1f952/sing-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "9874be432fba8b19d4124c7e3b999322", "sha256": "c701ce0fe97d25dfd3f365b19dac5ab053bb459ca518e4be1c6da622124a6029" }, "downloads": -1, "filename": "sing-0.1.4.tar.gz", "has_sig": false, "md5_digest": "9874be432fba8b19d4124c7e3b999322", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9904, "upload_time": "2018-02-26T12:55:39", "url": "https://files.pythonhosted.org/packages/3b/8d/02dc7737292ef97d2330e30f6f60644b898d0d9a4416b69133baad3b8c72/sing-0.1.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9874be432fba8b19d4124c7e3b999322", "sha256": "c701ce0fe97d25dfd3f365b19dac5ab053bb459ca518e4be1c6da622124a6029" }, "downloads": -1, "filename": "sing-0.1.4.tar.gz", "has_sig": false, "md5_digest": "9874be432fba8b19d4124c7e3b999322", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9904, "upload_time": "2018-02-26T12:55:39", "url": "https://files.pythonhosted.org/packages/3b/8d/02dc7737292ef97d2330e30f6f60644b898d0d9a4416b69133baad3b8c72/sing-0.1.4.tar.gz" } ] }