{ "info": { "author": "mhaisham", "author_email": "mhaisham79@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "### fstool\n\ninstall using pip\n\n```python\npython3 -m pip install fstool\n```\n\nCommand line tool\n```bash\npython3 -m fstool -h\n\nusage: __main__.py [-h] [-p PATH] [-c CONFIG] [-v] [-m] [-o] [-s START] [-e END]\n{restructure}\n\nformat file directory files\n\npositional arguments:\n {restructure}\n\noptional arguments:\n -h, --help show this help message and exit\n -p PATH, --path PATH home path\n -c CONFIG, --config CONFIG\n config file location. default is config.json\n -v, --verbose increase output verbosity\n -m, --move moves files instead of default copy\n -o, --overwrite ovewrites the file if it exists\n -s START, --start START\n start depth of file search\n -e END, --end END end depth of file search\n\n```\n\n#### Documentation\n\nExposes three functions to the public\n* restructure\n```python\nrestructure(\n home: str,\n files: list,\n config: dict,\n *,\n move: bool = True,\n overwrite: bool = False,\n verbose: bool = False,\n):\n```\n\n`config` is a dictionary of instructions on how to restructure the `files`, an example of which would be\n```json\n{ \n \".+\\\\.txt\":{ \n \"dir\":\"aiml\",\n \"file\":\".+\\\\.txt\"\n },\n \"(.+)\\\\.properties\":{ \n \"dir\":\"config\",\n \"file\":\"\\\\1.txt\"\n }\n}\n```\n\nThis is inefficient to write so `fstool` comes with a built in parser (`parse_config`) so that the above json can be written as\n```json\n{\n \"aiml\": [\n \".+\\\\.txt\"\n ],\n \"config\": [{\n \"old\": \"(.+)\\\\.properties\",\n \"new\": \"\\\\1.txt\"\n }],\n}\n```\n\nwhere the `key` is the directory and maps to a list of regex patterns or if you want to rename the file an object with keys `new` and `old`\n\n`old` - file to move\n\n`new` - file to be moved to\n\n* crawl\n```python\ncrawl(\n path: str,\n start_depth: int = 0,\n end_depth: int = -1,\n *,\n skip_permission_error: bool = True) -> tuple:\n```\n\n```python\n iterates through directores starting with path\n\n :return: (files, dirs) from start_depth(inclusive) to end_depth(exclusive)\n\n default start_depth is 0\n default end_depth is -1 (till all paths exhausted)\n\n :param skip_permission_error: when true skips through all directores that requires elevated privilages\n\n *note: if start_depth equals end_depth lists will be empty\n```\n\nTo default parameters left to it would iterate through all the subdirectories\n\n###### depth 0\n`start_depth` - 0\n\n`start_depth` - 1\n\n###### depth 1\n`start_depth` - 1\n\n`start_depth` - 2\n\n`etc`\n\n* parse_config\n\n```python\nparse_config(config: dict) -> dict:\n```\n\nCompiles input json to a more efficient version which can be used by the `restructure` function\n\n\n", "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/mHaisham/fstool", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "fstool", "package_url": "https://pypi.org/project/fstool/", "platform": "", "project_url": "https://pypi.org/project/fstool/", "project_urls": { "Homepage": "https://github.com/mHaisham/fstool" }, "release_url": "https://pypi.org/project/fstool/0.1.8/", "requires_dist": null, "requires_python": ">=3.6", "summary": "file system tool extension", "version": "0.1.8" }, "last_serial": 5874358, "releases": { "0.1.5": [ { "comment_text": "", "digests": { "md5": "a60980e552af48273843b90ad4c2e0ad", "sha256": "d66c2b2b3050c3f10825563b877c94efe7efb550cdfffe810b65915336ecf896" }, "downloads": -1, "filename": "fstool-0.1.5-py3-none-any.whl", "has_sig": false, "md5_digest": "a60980e552af48273843b90ad4c2e0ad", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 8739, "upload_time": "2019-09-21T14:46:13", "url": "https://files.pythonhosted.org/packages/a6/74/190bfa612acf054b6ff171f3436eef1f98bccfa6c0136203ef9ad81b2ed5/fstool-0.1.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "70f79bd90b1d7e3613b9934594ad2b0c", "sha256": "b3e3a4aefd41bf516870238822666fc0922603ec74c9d11ee9ab48061567587a" }, "downloads": -1, "filename": "fstool-0.1.5.tar.gz", "has_sig": false, "md5_digest": "70f79bd90b1d7e3613b9934594ad2b0c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 3479, "upload_time": "2019-09-21T14:46:16", "url": "https://files.pythonhosted.org/packages/82/4e/7c4bd77660f5a6cde5c9b2e48dc819b189afc67c0a285ee38abc12221c02/fstool-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "d5ca047f3f4cfc13f494b182d39c6a15", "sha256": "17e70538fb91dd46c6fdf830d974e38fe7819e8ab61790efd59a4b3fe9c34a79" }, "downloads": -1, "filename": "fstool-0.1.6-py3-none-any.whl", "has_sig": false, "md5_digest": "d5ca047f3f4cfc13f494b182d39c6a15", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 9818, "upload_time": "2019-09-21T15:20:54", "url": "https://files.pythonhosted.org/packages/57/7d/3bea8ee8b547a90fa15feed2fb582732d2e7b05d6a494d0d157b7a095789/fstool-0.1.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "43423b54056c8e6af34bd95424a9b6f8", "sha256": "bc8171a7f213b823dba92d03684b9fec47c9040b14cc438966db5827cf19426c" }, "downloads": -1, "filename": "fstool-0.1.6.tar.gz", "has_sig": false, "md5_digest": "43423b54056c8e6af34bd95424a9b6f8", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 4606, "upload_time": "2019-09-21T15:20:56", "url": "https://files.pythonhosted.org/packages/99/16/08c8f6d205ae415f159b4c28665864dd5156c83b7841a91f3b0d80f952f9/fstool-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "29b9f4cf3db0f9fd4979b57e819848cb", "sha256": "78badf5e430318c1fd7e9270e75e4033b782d25c55dcd2d40810b6bb4b1d1866" }, "downloads": -1, "filename": "fstool-0.1.7-py3-none-any.whl", "has_sig": false, "md5_digest": "29b9f4cf3db0f9fd4979b57e819848cb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 12270, "upload_time": "2019-09-22T16:15:49", "url": "https://files.pythonhosted.org/packages/ac/25/f1759e47ac7088db43e8183c835dd9b9766d1816e6a5b76e78008c86544d/fstool-0.1.7-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ca687650b9d2d294638fda0010448383", "sha256": "64b3ac2f170c7505cac5d89d2b88924528b0c84e7b7a1835c9b0d4aeeafc623e" }, "downloads": -1, "filename": "fstool-0.1.7.tar.gz", "has_sig": false, "md5_digest": "ca687650b9d2d294638fda0010448383", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 6621, "upload_time": "2019-09-22T16:15:52", "url": "https://files.pythonhosted.org/packages/99/90/a013372d28e48ecdaa37cc952e918c14a1ae102b9191bde3e651f0471bc9/fstool-0.1.7.tar.gz" } ], "0.1.8": [ { "comment_text": "", "digests": { "md5": "2107d02b3b98aea55ca7a9af47f45b0a", "sha256": "07ded01e50dbee924fff718493cfe0696f700434d3a3ebb6c9f1b126dfae5ac7" }, "downloads": -1, "filename": "fstool-0.1.8-py3-none-any.whl", "has_sig": false, "md5_digest": "2107d02b3b98aea55ca7a9af47f45b0a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 12399, "upload_time": "2019-09-23T15:38:42", "url": "https://files.pythonhosted.org/packages/6c/77/3df6ff7efb8811cc3f3c7db6a5c94dbdcf7f06fac4e00fcccfec7c61d6f9/fstool-0.1.8-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7fcd7e1f513c3f415e38220ba8106bc9", "sha256": "761f2755643c0e0ecf91e478996e769fc458421b562edeb2a6d4a048fe13a1f9" }, "downloads": -1, "filename": "fstool-0.1.8.tar.gz", "has_sig": false, "md5_digest": "7fcd7e1f513c3f415e38220ba8106bc9", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 7105, "upload_time": "2019-09-23T15:38:47", "url": "https://files.pythonhosted.org/packages/c3/6d/8f691bfc5448324315c7ab8e5d5cfb9a8e1b308b1dd40445b37158745baf/fstool-0.1.8.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2107d02b3b98aea55ca7a9af47f45b0a", "sha256": "07ded01e50dbee924fff718493cfe0696f700434d3a3ebb6c9f1b126dfae5ac7" }, "downloads": -1, "filename": "fstool-0.1.8-py3-none-any.whl", "has_sig": false, "md5_digest": "2107d02b3b98aea55ca7a9af47f45b0a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 12399, "upload_time": "2019-09-23T15:38:42", "url": "https://files.pythonhosted.org/packages/6c/77/3df6ff7efb8811cc3f3c7db6a5c94dbdcf7f06fac4e00fcccfec7c61d6f9/fstool-0.1.8-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7fcd7e1f513c3f415e38220ba8106bc9", "sha256": "761f2755643c0e0ecf91e478996e769fc458421b562edeb2a6d4a048fe13a1f9" }, "downloads": -1, "filename": "fstool-0.1.8.tar.gz", "has_sig": false, "md5_digest": "7fcd7e1f513c3f415e38220ba8106bc9", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 7105, "upload_time": "2019-09-23T15:38:47", "url": "https://files.pythonhosted.org/packages/c3/6d/8f691bfc5448324315c7ab8e5d5cfb9a8e1b308b1dd40445b37158745baf/fstool-0.1.8.tar.gz" } ] }