{ "info": { "author": "Marko Ristin", "author_email": "marko@parquery.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.5" ], "description": "posixfs\n=======\n\nposixfs provides context managers and functions to manipulate files on a POSIX file system with atomicity and\ndurability. The module is intended to be simple and straightforward to use.\n\nThe module is written in Python 3 with types annotated and using ``pathlib.Path``.\n\nRelated Projects\n================\nThere are many modules and projects which already provide this functionality. We give below a non-exhaustive list:\n\n* https://github.com/abarnert/fatomic\n* https://github.com/untitaker/python-atomicwrites\n* https://github.com/mitsuhiko/python-atomicfile\n* https://github.com/sashka/atomicfile\n* https://boltons.readthedocs.io/en/latest/fileutils.html#boltons.fileutils.atomic_save\n\nUnfortunately, none of them provides durable writes (only atomic ones), they lack type annotations and they all use\n``str`` instead of ``pathlib.Path`` to deal with file paths.\n\nWe particularly found type annotations to be crucial for a\nmodule which is widely used, such as for writing and reading files, in a large code base that requires static checks and\ngood readability. Moreover, we do not want to give away the manipulation capabilities of ``pathlib`` and be forced to\nsprinkle ``.as_posix()`` all over the code.\n\nFor more information on atomic and durable writes on POSIX file systems, see\nhttp://blog.httrack.com/blog/2013/11/15/everything-you-always-wanted-to-know-about-fsync\n\nUsage\n=====\n.. code-block:: python\n\n import pathlib\n\n import posixfs\n\n # write bytes to a file atomically and durably\n pth = pathlib.Path(\"/some/file.txt\")\n posixfs.atomic_write_bytes(path=pth, data=b\"hello\", durable=True)\n\n # write text to a file atomically and durably\n posixfs.atomic_write_bytes(path=pth, text=\"hello\", durable=True)\n\n # use context manager\n with posixfs.AtomicWritingText(path=pth, durable=True) as file:\n file.write('hello\\n')\n file.write('how do you do?\\n')\n\nInstallation\n============\n\n* Create a virtual environment:\n\n.. code-block:: bash\n\n python3 -m venv venv3\n\n* Activate it:\n\n.. code-block:: bash\n\n source venv3/bin/activate\n\n* Install posixfs with pip:\n\n.. code-block:: bash\n\n pip3 install posixfs\n\nDevelopment\n===========\n\n* Check out the repository.\n\n* In the repository root, create the virtual environment:\n\n.. code-block:: bash\n\n python3 -m venv venv3\n\n* Activate the virtual environment:\n\n.. code-block:: bash\n\n source venv3/bin/activate\n\n* Install the development dependencies:\n\n.. code-block:: bash\n\n pip3 install -e .[dev]\n\n* We use tox for testing and packaging the distribution. Assuming that the virtual environment has been activated and\n the development dependencies have been installed, run:\n\n.. code-block:: bash\n\n tox\n\n* We also provide a set of pre-commit checks that lint and check code for formatting. Run them locally from an activated\n virtual environment with development dependencies:\n\n.. code-block:: bash\n\n ./precommit.py\n\n* The pre-commit script can also automatically format the code:\n\n.. code-block:: bash\n\n ./precommit.py --overwrite\n\nVersioning\n==========\nWe follow `Semantic Versioning `_. The version X.Y.Z indicates:\n\n* X is the major version (backward-incompatible),\n* Y is the minor version (backward-compatible), and\n* Z is the patch version (backward-compatible bug fix).", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Parquery/posixfs", "keywords": "posix file system atomic durable write", "license": "", "maintainer": "", "maintainer_email": "", "name": "posixfs", "package_url": "https://pypi.org/project/posixfs/", "platform": "", "project_url": "https://pypi.org/project/posixfs/", "project_urls": { "Homepage": "https://github.com/Parquery/posixfs" }, "release_url": "https://pypi.org/project/posixfs/1.0.1/", "requires_dist": null, "requires_python": "", "summary": "provides atomic and durable writes on a posix file system.", "version": "1.0.1" }, "last_serial": 5410393, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "3b70e3e4028f8988f22884301cddd1ed", "sha256": "17f6a91d246b7afe23f342704f0b27ceca5787df1dfeb1fe052761f9197708df" }, "downloads": -1, "filename": "posixfs-1.0.0.tar.gz", "has_sig": false, "md5_digest": "3b70e3e4028f8988f22884301cddd1ed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4047, "upload_time": "2018-05-05T06:34:38", "url": "https://files.pythonhosted.org/packages/1f/43/976d2938f902466729f43c64f5dcfc544367ff44f1d0ccfd2f7b4c8ae613/posixfs-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "1791a6c6791ff59503a07b1cc32734b1", "sha256": "059b7a7de8c98190f11a01c8aafa1f05991563658b8f5b8fa1f7ef6b0041b006" }, "downloads": -1, "filename": "posixfs-1.0.1.tar.gz", "has_sig": false, "md5_digest": "1791a6c6791ff59503a07b1cc32734b1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4244, "upload_time": "2018-08-03T15:05:30", "url": "https://files.pythonhosted.org/packages/e8/f4/2edb327e9ae00bb006207858175fcf5c40f583f2718129cd602a335477db/posixfs-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1791a6c6791ff59503a07b1cc32734b1", "sha256": "059b7a7de8c98190f11a01c8aafa1f05991563658b8f5b8fa1f7ef6b0041b006" }, "downloads": -1, "filename": "posixfs-1.0.1.tar.gz", "has_sig": false, "md5_digest": "1791a6c6791ff59503a07b1cc32734b1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4244, "upload_time": "2018-08-03T15:05:30", "url": "https://files.pythonhosted.org/packages/e8/f4/2edb327e9ae00bb006207858175fcf5c40f583f2718129cd602a335477db/posixfs-1.0.1.tar.gz" } ] }