{ "info": { "author": "Corbin Simpson", "author_email": "cds@corbinsimpson.com", "bugtrack_url": null, "classifiers": [], "description": "==========\nbetterpath\n==========\n\nbetterpath, or \"bp\", is an adaptation of the classic Twisted ``FilePath`` type\nand interface. bp provides a simple, robust, well-tested object abstraction\nover file paths, generalizing the concept of file paths beyond filesystems.\n\nFile Paths\n==========\n\nbp exposes an interface, ``bp.abstract.IFilePath``, for file paths, and\nprovides the following concrete implementations:\n\n * ``bp.filepath.FilePath``, for the root filesystem\n * ``bp.zippath.ZipPath``, for ZIP archives\n * ``bp.memory.MemoryPath``, for in-memory temporary filesystems\n\nIn addition, there are combining abstract file paths which can be wrapped\naround other file paths:\n\n * ``bp.readonly.ReadOnlyPath``, for read-only filesystems\n\nAPI documentation is available at http://betterpath.rtfd.org/.\n\nVs. the Competition\n===================\n\nos.path\n-------\n\nThe venerable champ, ``os.path`` has been the cause of (and solution to) most\nof Python's path problems over the years.\n\nPros\n~~~~\n\n* In the standard library\n\nCons\n~~~~\n\n* Unsafe\n* Verbose\n* Operates on strs\n* No interfaces or ABCs for functionality\n* Only covers the root filesystem\n\npathlib\n-------\n\npathlib hopes to carve a path towards greatness through PEP 428.\n\nPros\n~~~~\n\n* Convenient ``__div__()`` overloading\n\nCons\n~~~~\n\n* No interfaces or ABCs for functionality\n* Only covers the root filesystem\n\nExamples\n========\n\nSaving Data to Disk\n-------------------\n\nThe Old Way\n~~~~~~~~~~~\n\n::\n\n def save(base, fragments, data):\n # `fragments` could contain unsafe paths!\n if \"..\" in fragments or \".\" in fragments:\n raise ValueError(\"Unsafe paths!\")\n path = os.path.join(os.path.abspath(base), os.sep.join(fragments))\n # Alternatively: path = os.path.join(os.path.abspath(base), *fragments)\n # I hope that this doesn't fail mid-write! Also, did the directories\n # exist? I think so, yes.\n with open(path, \"wb\") as handle:\n handle.write(data)\n\nThe New Way\n~~~~~~~~~~~\n\n::\n\n def save(base, fragments, data):\n path = base.descendant(fragments) \n path.parent().makeDirs()\n path.setContent(data)\n\nChangelog\n=========\n\n0.2\n---\n\n* Initial release", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/MostAwesomeDude/betterpath", "keywords": null, "license": "MIT/X11", "maintainer": null, "maintainer_email": null, "name": "betterpath", "package_url": "https://pypi.org/project/betterpath/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/betterpath/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/MostAwesomeDude/betterpath" }, "release_url": "https://pypi.org/project/betterpath/0.2.2/", "requires_dist": null, "requires_python": null, "summary": "Path manipulation library", "version": "0.2.2" }, "last_serial": 1417039, "releases": { "0.1.dev26": [], "0.2": [ { "comment_text": "", "digests": { "md5": "cb5b3eded1ce49667bc50d41d3c7c783", "sha256": "ca1f92a31733be158ac97c729b0f82181355ec9727493684f8a227d8797041ab" }, "downloads": -1, "filename": "betterpath-0.2.tar.gz", "has_sig": false, "md5_digest": "cb5b3eded1ce49667bc50d41d3c7c783", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33005, "upload_time": "2013-12-29T18:26:53", "url": "https://files.pythonhosted.org/packages/3c/60/9362a248c24527648cfc8fe1145ac258dcc8d584fee6daaf8a6e2f51df16/betterpath-0.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "eb125d8f366e9f9a838dd9b78d798954", "sha256": "c3524949c83d5cdf784c48df045da6fff236cc19fd0dbaa90228d39b43a5ed79" }, "downloads": -1, "filename": "betterpath-0.2.1.tar.gz", "has_sig": false, "md5_digest": "eb125d8f366e9f9a838dd9b78d798954", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33089, "upload_time": "2013-12-29T18:31:05", "url": "https://files.pythonhosted.org/packages/4a/e6/13250348def6504bd59274bf886e418208899987528fd42ab7e71f90457a/betterpath-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "f8242ab4477ef923a4996716fffa467b", "sha256": "e8d04e884d404dae3e622248e1b9c4b80876e21cd1fbdd76fd50ee0d2cb26fe4" }, "downloads": -1, "filename": "betterpath-0.2.2.tar.gz", "has_sig": false, "md5_digest": "f8242ab4477ef923a4996716fffa467b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 38073, "upload_time": "2015-02-10T01:36:15", "url": "https://files.pythonhosted.org/packages/74/60/be35047cf73c77b76aeee08de0a729b745f9f3e6c7393670115f52597e81/betterpath-0.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f8242ab4477ef923a4996716fffa467b", "sha256": "e8d04e884d404dae3e622248e1b9c4b80876e21cd1fbdd76fd50ee0d2cb26fe4" }, "downloads": -1, "filename": "betterpath-0.2.2.tar.gz", "has_sig": false, "md5_digest": "f8242ab4477ef923a4996716fffa467b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 38073, "upload_time": "2015-02-10T01:36:15", "url": "https://files.pythonhosted.org/packages/74/60/be35047cf73c77b76aeee08de0a729b745f9f3e6c7393670115f52597e81/betterpath-0.2.2.tar.gz" } ] }