Skip to main content

A simple container for handling multiple tempfiles

Example:

>>> import tempstore
>>> s = tempstore.TempStore('somedata')
>>> s.create('banana')
'/var/folders/ng/c57k6x7n1qn9f6hw_hw4zrlcnxhmy8/T/tmpsvzuj4bd/tmp3gh1vid9'
>>> s.copy('./')
>>> s.cleanup()
>>>

tempstore.TempStore(name=None)

Create a new TempStore.

TempStore.create(name)

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.

TempStore.paths

Access the paths of items in the TempStore

TempStore.objs`

Access the tempfile.NamedTemporaryFile objects of items in the TempStore

TempStore.cleanup()

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 TempStore.name 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 TempStore.name is not None

Release files for tempstore 1.0.6

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

Source distribution (sdist)

Source distribution for tempstore 1.0.6
File Size Uploaded
tempstore-1.0.6.tar.gz 2.6 kB Details

Built distribution (wheel)

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

Total release size: 6.6 kB

Release files / tempstore-1.0.6.tar.gz

Download URL tempstore-1.0.6.tar.gz
Size 2.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f821a6ed53fc767fd3286fcb6712954956af11109e046914681e53825d63fae2
BLAKE2b-256 checksum
How to use checksums
8e5ae90cda11b9e725ee62b62bd56e5d8e5d5c44c5ef08e10f70eabc7eee3410
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / tempstore-1.0.6-py3-none-any.whl

Download URL tempstore-1.0.6-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ea2034435d6aed04a25d9d623c77b0c6c933ad9f8a978fd700843d3f38cfd09d
BLAKE2b-256 checksum
How to use checksums
5207ac6b321d95df17ca975f2ab62af5f86020c3d661847d536a93d4d6508b02
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.6 This release

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.1

2 release files

1.0.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