Skip to main content

A successful sign for python setup

Project description

shutil_extra

extra utils

Build/Upload

# build
python setup.py sdist
# upload
twine upload ./dist/shutil_extra-x.x.x.tar.gz

Usage

dirtree

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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shutil_extra-0.0.6.tar.gz (3.5 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page