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)
| File | Size | Uploaded | |
|---|---|---|---|
| tempstore-1.0.6.tar.gz | 2.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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 |