Registry / web-framework / zope-filerepresentation

zope-filerepresentation

JSON →
library7.0pypypi✓ verified 84d ago

Provides interfaces and utilities for representing filesystem objects (files, directories) in Zope applications. Version 7.0 requires Python >=3.9. Maintenance release cadence is low; updates occur as needed.

pip install zope.filerepresentation
INSTALL
IMPORT
SIG · ZOPE-FILEREPRESENT
Z
zope-filerepresentation
web-frameworkpythonv7.0
Install
2.3s avg
Import
105ms
Disk
23MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v7.0 · 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.106s · 20.7MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.3s · import 0.104s · 21MB
23MB installed
● package 23MB
Code
Verified usage

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

IFileFactory
from zope.filerepresentation.interfaces import IFileFactory
from zope.filerepresentation import IFileFactory
IFileFactory is defined in the interfaces submodule.
readFile
from zope.filerepresentation import readFile
from zope.filerepresentation.interfaces import readFile
readFile is a module-level utility function, not an interface.

Demonstrates providing the IFileFactory interface and using a factory to create file representations.

from zope.filerepresentation.interfaces import IFileFactory from zope.interface import directlyProvides class MyFileFactory: def __call__(self, name, data): return {'name': name, 'data': data} directlyProvides(MyFileFactory, IFileFactory) def test_factory(): factory = MyFileFactory() result = factory('test.txt', b'hello') print(result) # {'name': 'test.txt', 'data': b'hello'} test_factory()
Debug
Known issues
breakingVersion 7.0 dropped support for Python versions older than 3.9. Upgrade your Python environment if you are using Python < 3.9.
fix
Ensure Python 3.9 or later is used.
affects: >=7.0
deprecatedThe `IFileRepresentation` interface has been deprecated in favor of `IFileFactory` and `IDirectoryFactory`. Use the new interfaces for new code.
fix
Replace usage of `IFileRepresentation` with `IFileFactory` and `IDirectoryFactory` as appropriate.
affects: >=5.0
gotchaUtility functions like `readFile` and `writeFile` are not available via top-level import; you must import them from `zope.filerepresentation` module. Do not attempt to import from `interfaces`.
fix
Use `from zope.filerepresentation import readFile`.
affects: all
Errors
Common errors & fixes
ImportError: cannot import name 'IFileRepresentation' from 'zope.filerepresentation.interfaces'
The interface IFileRepresentation was removed in a newer version.
fix
Use IFileFactory and IDirectoryFactory instead, and ensure you are using version 5.0+ interfaces.
ModuleNotFoundError: No module named 'zope.filerepresentation'
The package is not installed.
fix
Run `pip install zope.filerepresentation`.
TypeError: 'MyFileFactory' object is not callable
The factory object must implement __call__ method.
fix
Define a __call__ method that accepts (name, data) parameters.
Upgrade
Version history
7.0latest on PyPI · released Sep 12, 2025
Audit
Dependencies
zope.interfacerequiredRequired for interface definitions
zope.schemarequiredRequired for field definitions in interfaces
Agent activity
44 hits · last 30 days
node
36
Amazon
1
OpenAI (training)
1
Resources
zope-filerepresentation — pip install zope-filerepresentation · libregistry