zope.size
Interfaces and simple adapter that give the size of an object
What it is and what it does
zope.size defines a simple interface (ISized) that applications can use to retrieve the size of objects in bytes, typically for display or sorting purposes. It provides a default adapter that expects objects to implement a getSize() method returning bytes; if the method is absent, the adapter gracefully returns 'not available' rather than crashing.
The package is part of the Zope ecosystem and is designed as a lightweight utility for standardizing how object sizes are exposed across applications. It depends on zope.interface for interface definitions and zope.i18nmessageid for internationalization support. The package is stable and actively maintained for current Python versions (3.9, 3.10, 3.11, 3.12, 3.13), though releases are infrequent.
Use it for:
- Display object sizes in web applications or admin interfaces without custom size-retrieval logic.
- Sort collections of objects by their size using a standardized interface.
- Provide a consistent interface for third-party libraries to query object sizes in Zope-based systems.
- Adapt legacy objects to expose size information through a common interface.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a standard interface and adapter for retrieving object sizes, with a fallback to 'not available' when the object lacks a getSize method.
Yes, if you are working within the Zope ecosystem or need a lightweight, stable interface for object sizing. The package has no known vulnerabilities, low install friction, and current Python support. However, verify that ZPL-2.1 is compatible with your project's license requirements before committing, and note that the aging maintenance status means updates are infrequent.
Install
zope-size on PyPI
pip
pip install zope-sizeuv
uv add zope-sizepoetry
poetry add zope-sizeInstalling zope.size
Before you install
Low install friction with a pure-wheel distribution. Maintenance status is aging—last release was 336 days ago—but the package remains in production/stable state with active repository and current Python version support.
License in practice
Licensed under ZPL-2.1 (Zope Public License 2.1), which is OSI-approved but marked as unclear in treatment. Verify compatibility with your project's license policy before adopting.
Quickstart
pip install zope.size
from zope.size import ISized
from zope.interface import implementer
@implementer(ISized)
class MyObject:
def getSize(self):
return size in bytes
Requires Python 3.9 or later; zope.interface and zope.i18nmessageid must be available at runtime.
Verify before relying
- Whether ZPL-2.1 license is compatible with common project licenses (GPL, MIT, Apache 2.0, etc.)
- Real-world usage patterns and adoption outside the Zope ecosystem
- Concrete example values for getSize() return to illustrate typical usage
Package facts
| License | ZPL-2.1 (unclear) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — setuptools, zope.interface, zope.i18nmessageid |
| Maintenance | aging — 336 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 148,174/month — #11,042 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: zope_size-6.0-py3-none-any.whl
Keywords: size, display, human, bytes
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
zope.componentImplements the core Zope Component Architecture…
unclear · top 5,000 on PyPI
zope.globalrequestProvides a function to retrieve the currently…
unclear · top 15,000 on PyPI
zope.filerepresentationDefines interfaces for representing objects as…
unclear · top 15,000 on PyPI
zope.traversingResolves object paths by traversing an object…
unclear · top 15,000 on PyPI
zope.containerProvides container interfaces and…
unclear · top 15,000 on PyPI
zope.configurationZope.configuration provides an extensible…
unclear · top 5,000 on PyPI
zope.exceptionsProvides general-purpose exception classes and…
unclear · top 15,000 on PyPI
zope.annotationStores additional metadata on objects without…
unclear · top 15,000 on PyPI
zope.dottednameConverts dotted name strings (like…
unclear · top 15,000 on PyPI
zope.deferredimportDefers module imports until they are actually…
unclear · top 15,000 on PyPI