recordtype
Similar to namedtuple, but instances are mutable.
What it is and what it does
recordtype is a factory function that generates mutable record classes—similar to collections.namedtuple but with write support and flexible default-value handling. Unlike namedtuple, instances are fully mutable, and you can specify per-field defaults, a global default for all unspecified fields, or both. It depends only on six and generates pure Python classes with introspection members like _fields, _asdict(), and _source.
The package is production-stable but abandoned; its author explicitly recommends that Python 3.7+ users use dataclasses instead, and points to namedlist and attrs as better-maintained alternatives. It remains useful for legacy codebases or Python 2 compatibility, but new projects should consider those alternatives.
Use it for:
- Migrating from namedtuple to a mutable variant when you need to modify field values after instantiation.
- Creating lightweight data containers with sensible field defaults to reduce boilerplate initialization code.
- Supporting Python 2.6+ codebases that predate dataclasses and need a simple mutable record type.
- Building configuration or state objects where fields have meaningful defaults and occasional mutation is expected.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
recordtype creates mutable record classes with optional per-field and global default values, similar to namedtuple but with write support and configurable defaults.
No, unless you are maintaining legacy Python 2 code or a codebase already using recordtype. For new projects on Python 3.7+, use dataclasses; for more advanced use cases, use attrs or namedlist. The package is abandoned and its author recommends against it.
Install
recordtype on PyPI
pip
pip install recordtypeuv
uv add recordtypepoetry
poetry add recordtypeInstalling recordtype
Before you install
Low install friction with a single pure-Python dependency (six). However, the package is abandoned as of 1422 days since its last release; the author explicitly recommends Python 3.7+ users switch to dataclasses, and points to namedlist and attrs as better-maintained alternatives.
License in practice
Licensed under Apache License Version 2.0 (permissive). You can use, modify, and distribute recordtype freely in commercial and private projects with minimal restrictions.
Quickstart
from recordtype import recordtype
Point = recordtype('Point', [('x', 0), ('y', 0)])
p = Point()
p.x = 5
print(p.x, p.y) # 5 0
Verify before relying
- Whether the package works reliably on Python 3.10+ despite the last update being in 2022.
- Performance characteristics compared to dataclasses or attrs in modern Python versions.
- Whether the mutable-default-value warning mentioned in the changelog is still active.
Package facts
| License | Apache License Version 2.0 (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — six |
| Maintenance | abandoned — 1,422 days since the last release |
| First released | |
| Downloads | 93,010/month — #13,407 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: recordtype-1.4-py2.py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
namedlistCreates mutable or immutable named tuple-like…
permissive · top 15,000 on PyPI
recordclassRecordclass provides memory-efficient, mutable…
permissive · top 15,000 on PyPI
historydictHistoryDict provides a persistent dictionary…
unclear · top 15,000 on PyPI
constantdictProvides an immutable dictionary class that…
permissive · top 15,000 on PyPI
tinselGenerates PySpark DataFrame schemas from Python…
permissive · top 15,000 on PyPI
aenumaenum provides advanced enumeration types…
permissive · top 1,000 on PyPI
typedloadLoads and dumps JSON-like data into typed…
copyleft · top 1,000 on PyPI
ordered-setOrderedSet is a mutable collection that…
permissive · top 1,000 on PyPI
fieldsGenerates lightweight container classes with…
permissive · top 15,000 on PyPI
pygtriepygtrie provides pure Python implementations of…
permissive · top 5,000 on PyPI