asynctempfile
Async interface for the standard tempfile module. Implements the following 4 classes:
- TemporaryFile
- NamedTemporaryFile
- SpooledTemporaryFile
- TemporaryDirectory
Blocking methods are delegated to threadpools using loop.run_in_executor(). Non-blocking methods and properties retain a sync interface. SpooledTemporaryFile only delegates if the in-memory stream is rolled to disk. New instances of the above classes return wrapped with a context manager allowing use with async with and async for.
Installation
pip install asynctempfile
Credit
An extension of github.com/Tinche/aiofiles
Examples
import asynctempfile
async with asynctempfile.TemporaryFile('wb+') as f:
await f.write(b'Hello, World!')
import asynctempfile
async with asynctempfile.NamedTemporaryFile('wb+') as f:
await f.write(b'Line1\n Line2')
await f.seek(0)
async for line in f:
print(line)
Dependencies
aiofiles
Release Notes
0.5.0
- Adjusted TemporaryDirectory to return its path as opposed to the object when used with a context manager, aligning behaviour with the sync library (thank you to hellocoldworld).
- Fixed name attribute for TemporaryFile as this property is now included in the aiofiles wrapper.
Metadata
Release files for asynctempfile 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| asynctempfile-0.5.0.tar.gz | 4.3 kB | Without provenance | Details for asynctempfile-0.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| asynctempfile-0.5.0-py3-none-any.whl | Python 3 | none | any | Details for asynctempfile-0.5.0-py3-none-any.whl |
Total release size: 21.3 kB
Release files / asynctempfile-0.5.0.tar.gz
| Download URL | asynctempfile-0.5.0.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4a647c747357e8827397baadbdfe87f3095d30923fa789e797111eb02160884a
|
|
BLAKE2b-256 checksum How to use checksums |
2360ec51c5e926f4879a6f6817b2d73a775ebc968a555499ff2f6565b3607a7d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.0
|
Release files / asynctempfile-0.5.0-py3-none-any.whl
| Download URL | asynctempfile-0.5.0-py3-none-any.whl |
|---|---|
| Size | 17.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cec59bdb71c850e3de9bb4415f88998165c364709696240eea9ec5204a7439af
|
|
BLAKE2b-256 checksum How to use checksums |
2069d9119d7ebd3af8a111605453982b7c107f28cbccac5ce068104b25437afc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.0
|
Security for asynctempfile 0.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.