Skip to main content

Extends python `TemporaryDirectory` and make it even easier to use, as a decorator.

Project description

tmp-folder

black isort License downloads image-by


Documentation: https://jalvaradosegura.github.io/tmp-folder/


tmp-folder

Easily create a temporary folder. Put files in it and after you're done tmp-folder will delete the folder automatically.

Installation

Install from PyPI:

pip install tmp-folder

Usage

This is the minimum you need to get started with tmp-folder:

from pathlib import Path

from tmp_folder import use_tmp_folder


@use_tmp_folder
def foo(tmp_folder: Path):
    pass

Just decorate the function in which you need a temporary folder. Then add as first parameter, the variable that will hold the temporary folder path (it can be named however you want). Finally, after the function execution is completed, the folder will be deleted.

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

tmp_folder-0.2.0.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distribution

tmp_folder-0.2.0-py3-none-any.whl (3.4 kB view hashes)

Uploaded Python 3

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