Skip to content

๐Ÿ—‚ Easily create temporary folders, add files into them and don't worry about deleting them, tempfolder will take care

License

Notifications You must be signed in to change notification settings

jalvaradosegura/tempfolder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

8 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Coverage Status Code style: black Imports: isort basic-quality-check GitHub license

tempfolder

๐Ÿ—‚ Easily create temporary folders, add files into them and don't worry about deleting them, tempfolder will take care


Documentation: https://jalvaradosegura.github.io/tempfolder/

Installation

tempfolder is published on PyPI and can be installed from there:

pip install tempfolder

Quick example

For a deeper explanation, please check the docs...

Run this and see if you spot the magic, if you don't, please check the docs:

from pathlib import Path

from tempfolder import use_temp_folder


def add_config_file_to_folder(folder: str):
    with open(f'{folder}/config.cfg', 'w') as f:
        f.write('I_love=tempfolder')


@use_temp_folder('some_folder')
def test_add_config_file_to_folder():
    add_config_file_to_folder('some_folder')
    assert Path('some_folder').exists()
    assert Path('some_folder/config.cfg').exists()


def test_look_for_the_folder_and_the_file():
    assert not Path('some_folder').exists()
    assert not Path('some_folder/config.cfg').exists()


test_add_config_file_to_folder()
test_look_for_the_folder_and_the_file()

About

๐Ÿ—‚ Easily create temporary folders, add files into them and don't worry about deleting them, tempfolder will take care

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages