{ "info": { "author": "Steven Fernandez", "author_email": "steve@lonetwin.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries" ], "description": "expyre\n======\n\nA pythonic wrapper over `atd` to schedule deletion of files/directories.\n\nSource code: https://github.com/lonetwin/expyre\n\nInstall using pip ``pip install expyre`` or download from https://pypi.python.org/pypi/expyre\n\nWhat is expyre ?\n----------------\n\n``expyre`` is a python module that provides a command line as well as a\n``contextmanager`` which enables you to schedule files/directories for deletion\nat some point in the future. It does this by relying on the `atd(8)` service for\nthe scheduling of jobs.\n\nSince usually examples are better than a long README\n\nCommand line usage\n\n::\n\n # - schedule a file for deletion 2 days from now\n $ expyre -p path/to/file0 @now + 2days\n [212] /home/steve/src/venvs/expyre/path/to/file0 will expire at 2016-05-16 19:10\n\n # - schedule a file for deletion a minute befor new year 2018\n $ expyre --unless-modified -p path/to/file1 @23:59 2017-12-31\n [213] /home/steve/src/venvs/expyre/path/to/file1 will expire at 2017-12-31 23:59\n\n # - list the current expiry schedule\n $ expyre -l\n /home/steve/src/venvs/expyre/path/to/file1 scheduled to expire at 2017-01-01 19:07 unless modified after 19:07 2016-05-14\n /home/steve/src/venvs/expyre/path/to/file0 scheduled to expire at 2016-05-16 19:10\n\n # - remove a file from the expiry schedule\n $ expyre -r /home/steve/src/venvs/expyre/path/to/file0\n Successfully removed these paths from expiry list:\n /home/steve/src/venvs/expyre/path/to/file0\n\nPython usage\n\n.. code:: python\n\n from datetime import datetime, timedelta\n from expyre.helpers import open_expiring, expire_path, get_scheduled_jobs, remove_from_schedule\n\n # - as a contextmanager\n filename = '/path/to/file'\n with open_expiring(filename, 'w', at='now + 3days', unless_accessed=True) as fd:\n # - create a file with a scheduled deletion time exactly 3 days from\n # time of creation unless it has been accessed before the deletion time.\n pass # - do stuff with file\n\n # - schedule a file for deletion providing time as a string\n expire_path('./path/to/file0', 'now + 2days')\n JobSpec(job_id='216', path='/home/steve/src/venvs/expyre/path/to/file0', timestamp=datetime.datetime(2016, 5, 16, 19, 20), conditions='unless accessed after 19:20 2016-05-14 or unless modified after 19:20 2016-05-14')\n\n # - schedule a file for deletion providing time as a datetime object\n expire_path('./path/to/file1', (datetime.now() + timedelta(days=3)), unless_modified=True)\n JobSpec(job_id='217', path='/home/steve/src/venvs/expyre/path/to/file1', timestamp=datetime.datetime(2016, 5, 17, 19, 20), conditions='unless accessed after 19:20 2016-05-14 or unless modified after 19:20 2016-05-14')\n\n # - Get the expiry schedule as a dict\n get_scheduled_jobs()\n {'/home/steve/src/venvs/expyre/path/to/file0': JobSpec(job_id='216', path='/home/steve/src/venvs/expyre/path/to/file0', timestamp=datetime.datetime(2016, 5, 16, 19, 20), conditions='unless accessed after 19:20 2016-05-14 or unless modified after 19:20 2016-05-14'),\n '/home/steve/src/venvs/expyre/path/to/file1': JobSpec(job_id='217', path='/home/steve/src/venvs/expyre/path/to/file1', timestamp=datetime.datetime(2016, 5, 17, 19, 20), conditions='unless accessed after 19:20 2016-05-14 or unless modified after 19:20 2016-05-14')}\n\n # - remove a file from the expiry schedule\n remove_from_schedule(['/home/steve/src/venvs/expyre/path/to/file0'])\n (['/home/steve/src/venvs/expyre/path/to/file0'], [])\n\n\nA few things to note\n--------------------\n\n* This has only be tested on my local dev box (Fedora 23 with python 2.7).\n So, YMMV. Please do some cursory testing before relying on this tool.\n* Since (AFAICT), ``atd(8)`` has only minute level precision, the same\n limitation applies to ``expyre``.\n* Directories will be deleted with a ``rm -rf`` option ! So, you need to be\n careful when scheduling those for deletion.\n* The ``--unless_accessed`` and ``--unless_modified`` options to directories\n imply the access time and modification time for the *directory*, not the files\n under them.\n* Currently no checks are done to see whether there is already an existing job\n for a path being scheduled for deletion. I am not yet convinced that this is\n really necessary to be done as a default action.\n* Please, please, please do report bugs or send in suggestions for improvements\n if you can. This would be greatly appreciated.\n* Patches and code reviews would be even more appreciated.\n\n\nTODO\n----\n* More tests\n* Write docs\n\nUsage examples\n~~~~~~~~~~~~~~\n* Write a inotify based example of how you may set auto-expiry for files in the\n ``Downloads/`` folder.\n* Write an example file-upload web service with an expiry schedule.\n\n\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/lonetwin/expyre", "keywords": "atd,scheduled file deletion", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "expyre", "package_url": "https://pypi.org/project/expyre/", "platform": "", "project_url": "https://pypi.org/project/expyre/", "project_urls": { "Homepage": "https://github.com/lonetwin/expyre" }, "release_url": "https://pypi.org/project/expyre/0.1.4/", "requires_dist": null, "requires_python": "", "summary": "Python wrapper over `atd` to schedule deletion of files.", "version": "0.1.4" }, "last_serial": 3076963, "releases": { "0.1.0": [], "0.1.1": [ { "comment_text": "", "digests": { "md5": "af035a182769da9225ae08952e6ef249", "sha256": "38ce4c4468e02212594d297c350c0c3ca25fabf443adb76c587d60cdf5e32938" }, "downloads": -1, "filename": "expyre-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "af035a182769da9225ae08952e6ef249", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9450, "upload_time": "2016-05-14T17:31:59", "url": "https://files.pythonhosted.org/packages/cd/f5/81d5d11dc96e597a9da4abb057aea9261c8b967cbf48632bb2d59ad80efc/expyre-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5cb478049c018e22a10e1d013376a471", "sha256": "29753600ec32deddef36b6a1c8d4b1164fb5f08fdfde8ac0b753c05c04ddebe5" }, "downloads": -1, "filename": "expyre-0.1.1.tar.gz", "has_sig": false, "md5_digest": "5cb478049c018e22a10e1d013376a471", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6476, "upload_time": "2016-05-14T17:32:09", "url": "https://files.pythonhosted.org/packages/95/f3/5127ef9c574a55560c6acdee468b0297aa779f56ac57b8b9103a9792f037/expyre-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "a7aa67745fa460a4e660e5cab9c74117", "sha256": "4bc5f0937769a0405eb8b90ad34e236f86f84147f60da77805449ab33e7b2f2a" }, "downloads": -1, "filename": "expyre-0.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a7aa67745fa460a4e660e5cab9c74117", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9963, "upload_time": "2016-05-15T12:46:56", "url": "https://files.pythonhosted.org/packages/ff/f3/8135d43f0e327877d88bf793d1687e42d8b47b36153ea4191b3415904ea2/expyre-0.1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8b0bd0f3fc87792377ad61b9f67426cd", "sha256": "77aaa8240c1da7d811590ee31bfe2dcd71e52b646b9399c6341719f5bad953e2" }, "downloads": -1, "filename": "expyre-0.1.2.tar.gz", "has_sig": false, "md5_digest": "8b0bd0f3fc87792377ad61b9f67426cd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6809, "upload_time": "2016-05-15T12:47:06", "url": "https://files.pythonhosted.org/packages/28/f4/a1c75911628f201b9c8bfb0a58fdf3794f32b40f1339279b2d7b875e48c9/expyre-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "d40d90f38fb784c65a4d3e7826d1716b", "sha256": "3ca553c910237995c5bcaf1f3f44dc1d70a92f10dae13f0328e167abfef351a0" }, "downloads": -1, "filename": "expyre-0.1.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "d40d90f38fb784c65a4d3e7826d1716b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10124, "upload_time": "2016-06-02T18:10:36", "url": "https://files.pythonhosted.org/packages/62/d9/1f18be32e17f4b7641c86e8fa435027b50e01be2c07584b850c8d9816f59/expyre-0.1.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a5489514f34027a4dbf978476e03b046", "sha256": "82f552c3a98d264f4cb8aba0b215a9c4ebf67f8967711f0ed58d77c4616520d3" }, "downloads": -1, "filename": "expyre-0.1.3.tar.gz", "has_sig": false, "md5_digest": "a5489514f34027a4dbf978476e03b046", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7387, "upload_time": "2016-06-02T18:10:43", "url": "https://files.pythonhosted.org/packages/aa/93/c13000a633e0473a9141728ee275a31570c17cf75481c691c7caace60a71/expyre-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "fa970b33e7b113958b9486193f2be42b", "sha256": "22e2eb2aa61c450eae8ffb3942f20f15c89eb8abe840328ccbb2ec2a2c8c1a00" }, "downloads": -1, "filename": "expyre-0.1.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "fa970b33e7b113958b9486193f2be42b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10370, "upload_time": "2017-08-06T20:21:47", "url": "https://files.pythonhosted.org/packages/0d/20/3d2f9838ab460b13ee69a611ea530e38b9b842bba3ec93a36983a92aecc9/expyre-0.1.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "edf606b8e264ea774cfa7141aea481f5", "sha256": "f315f72fdea514fc8f0e5d7f05ce975a89721befd33eef027e951a91f6420827" }, "downloads": -1, "filename": "expyre-0.1.4.tar.gz", "has_sig": false, "md5_digest": "edf606b8e264ea774cfa7141aea481f5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7050, "upload_time": "2017-08-06T20:21:49", "url": "https://files.pythonhosted.org/packages/8b/58/1075fba4d57b9dafb987c66775513eddc451f300338e4f099f9114dfb63d/expyre-0.1.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "fa970b33e7b113958b9486193f2be42b", "sha256": "22e2eb2aa61c450eae8ffb3942f20f15c89eb8abe840328ccbb2ec2a2c8c1a00" }, "downloads": -1, "filename": "expyre-0.1.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "fa970b33e7b113958b9486193f2be42b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10370, "upload_time": "2017-08-06T20:21:47", "url": "https://files.pythonhosted.org/packages/0d/20/3d2f9838ab460b13ee69a611ea530e38b9b842bba3ec93a36983a92aecc9/expyre-0.1.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "edf606b8e264ea774cfa7141aea481f5", "sha256": "f315f72fdea514fc8f0e5d7f05ce975a89721befd33eef027e951a91f6420827" }, "downloads": -1, "filename": "expyre-0.1.4.tar.gz", "has_sig": false, "md5_digest": "edf606b8e264ea774cfa7141aea481f5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7050, "upload_time": "2017-08-06T20:21:49", "url": "https://files.pythonhosted.org/packages/8b/58/1075fba4d57b9dafb987c66775513eddc451f300338e4f099f9114dfb63d/expyre-0.1.4.tar.gz" } ] }