{"categories":[{"label":"Python Modules","url":"https://skillfed.io/packages/category/software-development-libraries-python-modules/19"}],"enrichment":{"capability":"Recordclass provides memory-efficient, mutable alternatives to namedtuple and dataclass by creating record types that skip Python's garbage collection overhead, reducing instance size by 16\u201332 bytes depending on Python version.","skillfed_tags":["memory-optimization","data-structures","performance-tuning"],"use_cases":["Store millions of coordinate or vector records (x, y, z) in memory-intensive scientific or graphics applications.","Build compact data structures for machine learning feature vectors where memory footprint directly impacts cache performance.","Replace namedtuple in high-throughput data pipelines where object creation speed and size matter.","Create immutable or mutable tuple-like containers (litetuple, mutabletuple) for collections that will never form cycles.","Define strongly-typed record classes with type hints that consume less memory than standard dataclass instances."],"what_it_does":"Recordclass is a library for creating lightweight, mutable record types in Python that avoid the memory overhead of standard dataclasses and namedtuples by opting out of cyclic garbage collection. It provides three main interfaces: a `recordclass` factory (namedtuple-like), a `dataobject` base class (dataclass-like), and lightweight container types (`litetuple`, `mutabletuple`) designed for scenarios where you are certain your objects will never participate in reference cycles.\n\nThe library is built on a custom metaclass that skips the `PyGC_Head` prefix normally added to Python objects, reducing per-instance memory by 16\u201332 bytes depending on Python version. This is most useful for applications that create many small, short-lived objects with simple field types (int, float, str, date/time), such as coordinate records, scientific data points, or compact data structures in memory-constrained environments. The trade-off is that you must manually ensure no circular references are created; the library does not enforce this at runtime.","worth_installing":"Yes, if you are building memory-sensitive applications with many small objects and can guarantee no circular references. The active maintenance, permissive license, and support for modern Python versions (3.8\u20133.14) make it reliable. However, the high install friction (source compilation required) and narrow use case (only beneficial when memory overhead of PyGC_Head is a real bottleneck) mean it is not a general-purpose replacement for dataclass or namedtuple\u2014install only when profiling shows memory is a constraint."},"id":"recordclass","links":{"html":"https://skillfed.io/packages/recordclass","md":"https://skillfed.io/packages/recordclass.md","pypi":"https://pypi.org/project/recordclass/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-01-05","license_spdx":null,"license_treatment":"permissive","name":"recordclass","python_support":"supports_current","summary":"Mutable variant of namedtuple -- recordclass, which support assignments, compact dataclasses and other memory saving variants."},"popularity":{"monthly_downloads":126365,"position":11778,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"0.24"}
