Skip to main content

A simple container for handling multiple tempfiles

Project description

A simple container for handling multiple tempfiles


>>> import tempstore
>>> s = tempstore.TempStore('somedata')
>>> s.create('banana')
>>> s.copy('./')
>>> s.cleanup()


Create a new TempStore.


Create a new tempfile. This returns the path to the tempfile, and it can be accessed again later with either TempStore.paths[name] or TempStore.objs[name].name.


Access the paths of items in the TempStore


Access the tempfile.NamedTemporaryFile objects of items in the TempStore


Remove all the temporary files in the TempStore

TempStore.copy(path=None, exist_ok=True)

Copy all items in the TempStore to a given path. If is not None, a new directory will be created in path with the name, and all files will be copied there.

exist_ok will be passed to os.makedirs if is not None

Project details

Download files

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

Files for tempstore, version 1.0.3
Filename, size File type Python version Upload date Hashes
Filename, size tempstore-1.0.3-py3-none-any.whl (3.9 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size tempstore-1.0.3.tar.gz (2.5 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page