Registry / testing / empty-files

empty-files

JSON →
library0.0.9pypypi✓ verified 86d ago

Provides empty (placeholder) files in many formats (images, documents, archives, etc.) for testing and development. Current version 0.0.9, active development on GitHub.

pip install empty-files
INSTALL
IMPORT
SIG · EMPTY-FILES
E
empty-files
testingpythonv0.0.9
Install
2.1s avg
Import
13ms
Disk
19MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.0.9 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.014s · 21MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.1s · import 0.012s · 21MB
19MB installed
● package 19MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

empty_files
from empty_files import empty_files
import empty_files
The module and function share the same name; use the explicit from import.
AllEmptyFiles
from empty_files import AllEmptyFiles

Fetch empty file bytes for any supported extension. See AllEmptyFiles().ALL_FILES for full list.

from empty_files import empty_files # Get empty PNG file content (bytes) png_bytes = empty_files('png') print(f'Got {len(png_bytes)} bytes of empty PNG') # Get all supported extensions from empty_files import AllEmptyFiles extensions = list(AllEmptyFiles().ALL_FILES.keys()) print(extensions[:5])
Debug
Known issues
gotchaOn Python 3.7, if OpenSSL is not configured correctly for urllib3, the library silently falls back to writing 0-byte files instead of proper placeholders. Always verify the content length > 0 if using placeholder integrity.
fix
Upgrade Python to 3.8+ or set SSL_CERT_FILE environment variable. Alternatively, check returned bytes length.
affects: <=0.0.9
gotchaThe function name `empty_files` is also the module name. If you do `import empty_files`, you must call `empty_files.empty_files()` or alias it. Many new users forget the module prefix.
fix
Use `from empty_files import empty_files` and then call `empty_files('pdf')`.
affects: all
deprecatedPython 3.6 support was dropped in v0.0.4. Installing on 3.6 will get an older, unmaintained version.
fix
Upgrade to Python 3.7+.
affects: >=0.0.4
Errors
Common errors & fixes
AttributeError: module 'empty_files' has no attribute 'empty_files'
Using `import empty_files` then trying `empty_files('png')` without qualifying the module.
fix
Use `from empty_files import empty_files` and then `empty_files('png')`.
requests.exceptions.SSLError: HTTPSConnectionPool(host='...', port=443): Max retries exceeded with url: /... (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed')))
The library attempts to fetch placeholder definitions from a remote URL (GitHub). On Python 3.7 with misconfigured OpenSSL, this fails and falls back to zero-byte files.
fix
Set environment variable SSL_CERT_FILE to a valid CA bundle, or upgrade Python to 3.8+.
Upgrade
Version history
0.0.9latest on PyPI · released Jul 30, 2023
Audit
Dependencies
urllib3requiredUsed internally for OpenSSL handling; may cause startup errors on Python 3.7
Agent activity
4 hits · last 30 days
node
4
Resources
empty-files — pip install empty-files · libregistry