skillfed

zope.size

Interfaces and simple adapter that give the size of an object

zope-size v6.0 148.2K downloads/30d#11,042 on PyPI2
License unclear ZPL-2.1 AGING released

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-size

uv

uv add zope-size

poetry

poetry add zope-size

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Zope Public LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Internet :: WWW/HTTPTopic :: Software Development

Tags

object size interfaceget object size byteszope size adapterobject size displaysize sorting interface
zope-ecosysteminterface-adapter

More Software Development packages