# shutil_extra
extra utils
# Build/Upload
```sh
# build
python setup.py sdist
# upload
twine upload ./dist/shutil_extra-x.x.x.tar.gz
```
# Usage
## dirtree
```python
from shutil_extra import dirtree
tree_cnf = f'''
folder1
folder2_1,folder2_2
folder3_1->folder4
folder3_2->folder4->folder5_1,folder5_2
folder3_3->folder4
folder3_4->folder4
'''
# without post_handle
dirtree.makedirs('./folder_tree', tree_cnf)
# with post_handle
def post_handle(dirname, dirpath):
# do something after dir generated
if dirname == 'folder4':
with open(os.path.join(dirpath, 'data.txt'), 'w') as f:
f.writelines('hello world')
dirtree.makedirs('./folder_tree', tree_cnf, post_handle=post_handle)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/novawei/shutil_extra",
"name": "shutil-extra",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "pip,shutil extra,dir tree",
"author": "novawei",
"author_email": "913252732@qq.com",
"download_url": "https://files.pythonhosted.org/packages/f2/46/f71cf2c82470a282034af1b6084547d115b17dd90c34a4da9026880fae9e/shutil_extra-0.0.6.tar.gz",
"platform": "any",
"description": "# shutil_extra\r\nextra utils\r\n\r\n# Build/Upload\r\n```sh\r\n# build\r\npython setup.py sdist\r\n# upload\r\ntwine upload ./dist/shutil_extra-x.x.x.tar.gz\r\n```\r\n\r\n# Usage\r\n\r\n## dirtree\r\n```python\r\nfrom shutil_extra import dirtree\r\n\r\ntree_cnf = f'''\r\nfolder1\r\n folder2_1,folder2_2\r\n folder3_1->folder4\r\n folder3_2->folder4->folder5_1,folder5_2\r\n folder3_3->folder4\r\n folder3_4->folder4\r\n'''\r\n\r\n# without post_handle\r\ndirtree.makedirs('./folder_tree', tree_cnf)\r\n\r\n# with post_handle\r\ndef post_handle(dirname, dirpath):\r\n # do something after dir generated\r\n if dirname == 'folder4':\r\n with open(os.path.join(dirpath, 'data.txt'), 'w') as f:\r\n f.writelines('hello world')\r\n\r\ndirtree.makedirs('./folder_tree', tree_cnf, post_handle=post_handle)\r\n```\r\n",
"bugtrack_url": null,
"license": "MIT Licence",
"summary": "A successful sign for python setup",
"version": "0.0.6",
"split_keywords": [
"pip",
"shutil extra",
"dir tree"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f246f71cf2c82470a282034af1b6084547d115b17dd90c34a4da9026880fae9e",
"md5": "db93b31fa76c05726cd67134d131800c",
"sha256": "c04eddfb2b38134878146bb681301631eb24b671ce6082dec60e519e2a176ec1"
},
"downloads": -1,
"filename": "shutil_extra-0.0.6.tar.gz",
"has_sig": false,
"md5_digest": "db93b31fa76c05726cd67134d131800c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 3545,
"upload_time": "2023-03-29T04:51:35",
"upload_time_iso_8601": "2023-03-29T04:51:35.455812Z",
"url": "https://files.pythonhosted.org/packages/f2/46/f71cf2c82470a282034af1b6084547d115b17dd90c34a4da9026880fae9e/shutil_extra-0.0.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-03-29 04:51:35",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "novawei",
"github_project": "shutil_extra",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "shutil-extra"
}