{ "info": { "author": "Colm O'Connor", "author_email": "colm.oconnor.github@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Quality Assurance", "Topic :: Software Development :: Testing" ], "description": "# Faketime\n\nFaketime is a thin python wrapper around the amazing C library [libfaketime](https://github.com/wolfcw/libfaketime), written\nby [Wolfgang Hommel](https://github.com/wolfcw) which you can use to lie to UNIX processes about what time and date it is.\n\n\n## Why does this wrapper exist?\n\n* It provides an interface that is convenient and pythonic that you can use to lie to subprocesses run with python.\n* It provides an python interface that is identical on both Mac OS X and Linux (libfaketime is used in a slightly different way on both).\n* It provides a self contained library that can be installed in a virtualenv that runs consistently in any environment - installing libfaketime from package manager can instead get you older, buggy versions on different operating systems and package managers.\n\n## Install\n\n```\npip install faketime\n```\n\n## Using\n\n```\n>>> from commandlib import Command\n>>> from faketime import Faketime\n>>> from datetime import datetime\n>>> faketime = Faketime(\"currenttime.txt\")\n>>> datecmd\n{'LD_PRELOAD': '/full/path/to/virtualenv/site-packages/faketime/libfaketime.so.1', 'FAKETIME_TIMESTAMP_FILE': '/full/path/to/currenttime.txt'}\n\n\n>>> datecmd = Command(\"date\").with_env(**faketime.env_vars)\n>>> datecmd.run()\n[ should print current time ]\n\n>>> faketime.change_time(datetime(2050, 6, 7, 10, 9, 22, 713689))\n>>> datecmd.run()\nTue 7 Jun 10:09:21 BST 2050\n```\n\nThis above example shows how to use faketime with [commandlib](https://hitchdev.com/commandlib/), although\nthe environment variables in the dict can be used with any command runner (e.g. Popen).\n\n## What's the story behind this library?\n\nThis library can be used for a number of purposes, but I mainly built it so that I could write\ntests with [hitchstory](https://hitchdev.com/hitchstory) that would lie to postgres,\ndjango and celery simultaneously about what date and time it was.\n\nInitially I tried using [freezegun](https://github.com/spulec/freezegun) to test the python code, but I realized that it only really\nworked on one snippet of code at a time. Moreover:\n\n* If that code executed a python process that contained other code that other code would get the *current* time, not the frozen time, breaking the test.\n* It was simply incapable of faking, say, postgres's time, so if an SQL query embedded a datetime query then that would break the test.", "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/hitchdev/faketime/", "keywords": "libfaketime faketime", "license": "GPLv2", "maintainer": "", "maintainer_email": "", "name": "faketime", "package_url": "https://pypi.org/project/faketime/", "platform": "", "project_url": "https://pypi.org/project/faketime/", "project_urls": { "Homepage": "https://github.com/hitchdev/faketime/" }, "release_url": "https://pypi.org/project/faketime/0.9.8/", "requires_dist": null, "requires_python": "", "summary": "Libfaketime wrapper.", "version": "0.9.8" }, "last_serial": 5964767, "releases": { "0.9.6.3": [ { "comment_text": "", "digests": { "md5": "955e1f550e709cbf99eacc9130b9798a", "sha256": "345d6325e4822672c165973249ed899865b522f1c823a97b35f0b5e4d5a29cc0" }, "downloads": -1, "filename": "faketime-0.9.6.3.tar.gz", "has_sig": false, "md5_digest": "955e1f550e709cbf99eacc9130b9798a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22277, "upload_time": "2015-06-07T06:10:41", "url": "https://files.pythonhosted.org/packages/e3/02/9dcbfde44ac43da7201f3235c7b390315fb12b9027e0dc0334f000af7497/faketime-0.9.6.3.tar.gz" } ], "0.9.6.4": [ { "comment_text": "", "digests": { "md5": "1b3b72849f64d0fd9f1c27eb974355a8", "sha256": "8bd17dcf4fb27ad77b22dae20095d30bec04876ce5c63924b351cf8a76ae7238" }, "downloads": -1, "filename": "faketime-0.9.6.4.tar.gz", "has_sig": false, "md5_digest": "1b3b72849f64d0fd9f1c27eb974355a8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22201, "upload_time": "2016-10-08T11:58:54", "url": "https://files.pythonhosted.org/packages/ff/13/6ca5bacff00300648c08ec055c3b8f1722554af5e54bc0f75ffd65189a22/faketime-0.9.6.4.tar.gz" } ], "0.9.6.5": [ { "comment_text": "", "digests": { "md5": "a297e258d826ebd5d0a6a32317e6e526", "sha256": "0b4abe31690f931ded05a5844f46a36d508128a0abf4f81aa39466e2552c303a" }, "downloads": -1, "filename": "faketime-0.9.6.5.tar.gz", "has_sig": false, "md5_digest": "a297e258d826ebd5d0a6a32317e6e526", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22208, "upload_time": "2016-10-08T13:18:12", "url": "https://files.pythonhosted.org/packages/42/6b/66060fc2a2e11a0724d6f5c578b6d3c62fc8fde6f678088bb394ac243444/faketime-0.9.6.5.tar.gz" } ], "0.9.6.6": [ { "comment_text": "", "digests": { "md5": "6c3ea0880abec7ad42fd910dae7b69dc", "sha256": "ce1cf769405b901cf3c7894fe87e96d8447ce900ae9a1ba9dab3412509955523" }, "downloads": -1, "filename": "faketime-0.9.6.6.tar.gz", "has_sig": false, "md5_digest": "6c3ea0880abec7ad42fd910dae7b69dc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22214, "upload_time": "2016-10-08T13:50:35", "url": "https://files.pythonhosted.org/packages/f2/79/f6344e2acc0735867133f4e5b9e43bd0aaee196f90c192186453ab4d840b/faketime-0.9.6.6.tar.gz" } ], "0.9.6.7": [ { "comment_text": "", "digests": { "md5": "6db3a888418f7805e03f07246557f761", "sha256": "1a042353ade5874e7fc3f644af8fa63636d9d3cad8ce88ba38bb41845572ffdb" }, "downloads": -1, "filename": "faketime-0.9.6.7.tar.gz", "has_sig": false, "md5_digest": "6db3a888418f7805e03f07246557f761", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 34603, "upload_time": "2017-05-18T18:51:55", "url": "https://files.pythonhosted.org/packages/19/9d/02d2f1c12690b9bbb64466b2972d6c59ce77ec6eae0a6d7dd37a9f60816d/faketime-0.9.6.7.tar.gz" } ], "0.9.6.8": [ { "comment_text": "", "digests": { "md5": "8ad2283b1bb36ddc0ee4dd82328b295f", "sha256": "d3bb6c249301c605a8f896a7a7f36add28a090a8466fbad4f85431ecba0660d7" }, "downloads": -1, "filename": "faketime-0.9.6.8.tar.gz", "has_sig": false, "md5_digest": "8ad2283b1bb36ddc0ee4dd82328b295f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 34620, "upload_time": "2017-05-19T09:03:27", "url": "https://files.pythonhosted.org/packages/72/20/f88660b6a19791db4f14a262cfdbb69472044ecfaaa9540c5d52c256253e/faketime-0.9.6.8.tar.gz" } ], "0.9.6.9": [ { "comment_text": "", "digests": { "md5": "570b2245777244aae86e37d2ec7d2a29", "sha256": "afaccbd5bde6e2acc262bce0d800171936341a19efe79a562fc1ea344d52799f" }, "downloads": -1, "filename": "faketime-0.9.6.9.tar.gz", "has_sig": false, "md5_digest": "570b2245777244aae86e37d2ec7d2a29", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 35526, "upload_time": "2019-10-12T16:15:44", "url": "https://files.pythonhosted.org/packages/0a/48/4d332492c743052b885a6c52b2f80a0d70f4d1cfb7b4f27f5e8d38d6b0ca/faketime-0.9.6.9.tar.gz" } ], "0.9.7.1": [ { "comment_text": "", "digests": { "md5": "45da295b937102cb5d1d8fd8b2b34cdd", "sha256": "f3de86c2e9150f9b1bd4c0cc16bd7a4642d464f783e8b5b2a26f0c29eed140ee" }, "downloads": -1, "filename": "faketime-0.9.7.1.tar.gz", "has_sig": false, "md5_digest": "45da295b937102cb5d1d8fd8b2b34cdd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 49058, "upload_time": "2018-05-03T12:11:10", "url": "https://files.pythonhosted.org/packages/de/66/3b8f0a917955b6fc341a912a3413c159c7a6b5c8e6b3ede5a8ac954a636a/faketime-0.9.7.1.tar.gz" } ], "0.9.8": [ { "comment_text": "", "digests": { "md5": "035bec2b60063d4008751ae825ab28e4", "sha256": "b12e43b355489b1938ed2b1db4ad2f2c83df5b2bd8c412a026965628669a2160" }, "downloads": -1, "filename": "faketime-0.9.8.tar.gz", "has_sig": false, "md5_digest": "035bec2b60063d4008751ae825ab28e4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 41777, "upload_time": "2019-10-12T16:19:07", "url": "https://files.pythonhosted.org/packages/2a/4f/14ae990f996f14c6b229938d1713a2ae067d3added78a2610c6baa65472e/faketime-0.9.8.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "035bec2b60063d4008751ae825ab28e4", "sha256": "b12e43b355489b1938ed2b1db4ad2f2c83df5b2bd8c412a026965628669a2160" }, "downloads": -1, "filename": "faketime-0.9.8.tar.gz", "has_sig": false, "md5_digest": "035bec2b60063d4008751ae825ab28e4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 41777, "upload_time": "2019-10-12T16:19:07", "url": "https://files.pythonhosted.org/packages/2a/4f/14ae990f996f14c6b229938d1713a2ae067d3added78a2610c6baa65472e/faketime-0.9.8.tar.gz" } ] }