Skip to main content

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()

Metadata

Release files for tempfolder 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tempfolder 0.4.1
File Size Uploaded
tempfolder-0.4.1.tar.gz 3.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tempfolder 0.4.1
File Interpreter ABI Platform
tempfolder-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 6.3 kB

Release files / tempfolder-0.4.1.tar.gz

Download URL tempfolder-0.4.1.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b646727bfb51a6c27bf7f1f89903795110dbdd8616fe4ce32c85fe1440a04612
BLAKE2b-256 checksum
How to use checksums
11fb78597bc54325b4871194d83062e438ca92b4559d7f95f29847dbce7fe6ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.7 CPython/3.8.0 Darwin/20.5.0

Release files / tempfolder-0.4.1-py3-none-any.whl

Download URL tempfolder-0.4.1-py3-none-any.whl
Size 3.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
886d7a5a29e43ddc53e489ea90363939e79eb29db773d81566ec57bf2ca029f4
BLAKE2b-256 checksum
How to use checksums
dfb53c35550536152f40aa2231ee60e94fef4329e8398b884b163a9826b6cd6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.7 CPython/3.8.0 Darwin/20.5.0

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.3.1

2 release files

0.3.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page