🗂 Easily create temporary folders, add files into them and don't worry about deleting them, tempfolder will take care
Project description
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()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tempfolder-0.4.1.tar.gz.
File metadata
- Download URL: tempfolder-0.4.1.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.7 CPython/3.8.0 Darwin/20.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b646727bfb51a6c27bf7f1f89903795110dbdd8616fe4ce32c85fe1440a04612
|
|
| MD5 |
265a47e070ceb9d0739c5b933a782927
|
|
| BLAKE2b-256 |
11fb78597bc54325b4871194d83062e438ca92b4559d7f95f29847dbce7fe6ee
|
File details
Details for the file tempfolder-0.4.1-py3-none-any.whl.
File metadata
- Download URL: tempfolder-0.4.1-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.7 CPython/3.8.0 Darwin/20.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
886d7a5a29e43ddc53e489ea90363939e79eb29db773d81566ec57bf2ca029f4
|
|
| MD5 |
180193a76507fad7e1aabd82119efee6
|
|
| BLAKE2b-256 |
dfb53c35550536152f40aa2231ee60e94fef4329e8398b884b163a9826b6cd6b
|