fields
Container class boilerplate killer.
Decision gist · record as of 2026-08-14
No, not for new projects. While the package is stable and has no known vulnerabilities, it has been abandoned since 2016 with no maintenance or Python 3.8+ testing. Modern alternatives like dataclasses (standard library in Python 3.7+) or attrs are actively maintained, better integrated with type checkers, and offer richer features. Install only if you are maintaining legacy code that already depends on it.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Package is abandoned and untested on Python versions released after 2016; compatibility with modern Python (3.8+) is unverified.
- Installation is frictionless (pure Python wheel, no runtime dependencies).
- However, the package is abandoned—last release was 2016-04-13 and last commit 2021-11-11—so it will not receive bug fixes or support for modern Python versions beyond what was already compiled in.
License · maintenance · safety
BSD (permissive) — BSD license (permissive) imposes no significant restrictions on use, modification, or redistribution in most contexts.
last release 2016-04-13 (3775 days) · last repo commit 2021-11-11 · 137 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 78,769 downloads/mo, #14,411 on PyPI
Alternatives
Verify before relying
from fields import Fields
class Pizza(Fields.name.size):
pass
p = Pizza("Pepperoni", "large")
print(p) # Pizza(name='Pepperoni', size='large')- Whether the package works reliably on Python 3.8 and later without modification or workarounds.
- Whether the fluent attribute-chain syntax (e.g., `Fields.name.size`) works as documented in all Python implementations listed in classifiers.
What it is and what it does
Fields is a lightweight library for defining container classes—objects that hold a fixed set of named attributes—without writing repetitive `__init__`, `__repr__`, and comparison methods. You define a class by chaining attribute names as class attributes (e.g., `class Pizza(Fields.name.size)`), and Fields automatically generates the initialization logic, a readable string representation, and all comparison operators. It supports both positional and keyword arguments, optional fields with default values, and can generate tuple subclasses for immutable containers.
The package positions itself as a middle ground between namedtuple (which is verbose and inflexible) and decorator-based approaches like attrs or characteristic (which impose constraints on how you write `__init__`). Fields lets you override methods normally—including `__init__`—without the framework fighting you. However, the project has been abandoned since 2016 and is untested on modern Python versions, making it a legacy choice for new code.
Use it for
- Define simple immutable data structures (using Tuple base) as a more readable alternative to namedtuple for small projects.
- Create lightweight container classes for function return values or intermediate data without writing boilerplate comparison and repr methods.
- Build tree or graph node classes with optional fields and defaults (e.g., binary tree nodes with left/right children defaulting to None).
- Prototype data models quickly when you need a class with fields but don't want decorator syntax or external dependencies.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
No, not for new projects.
While the package is stable and has no known vulnerabilities, it has been abandoned since 2016 with no maintenance or Python 3.8+ testing. Modern alternatives like dataclasses (standard library in Python 3.7+) or attrs are actively maintained, better integrated with type checkers, and offer richer features. Install only if you are maintaining legacy code that already depends on it.
Install
fields on PyPI
Before you install
Installation is frictionless (pure Python wheel, no runtime dependencies). However, the package is abandoned—last release was 2016-04-13 and last commit 2021-11-11—so it will not receive bug fixes or support for modern Python versions beyond what was already compiled in.
Package is abandoned and untested on Python versions released after 2016; compatibility with modern Python (3.8+) is unverified.
License in practice
BSD license (permissive) imposes no significant restrictions on use, modification, or redistribution in most contexts.
Quickstart
from fields import Fields
class Pizza(Fields.name.size):
pass
p = Pizza("Pepperoni", "large")
print(p) # Pizza(name='Pepperoni', size='large')
Verify before relying
- Whether the package works reliably on Python 3.8 and later without modification or workarounds.
- Whether the fluent attribute-chain syntax (e.g., `Fields.name.size`) works as documented in all Python implementations listed in classifiers.
Package facts
| License | BSD permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Abandoned 3,775 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 78,769 / month, #14,411 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: Microsoft :: WindowsOperating System :: POSIXOperating System :: UnixProgramming Language :: PythonProgramming Language :: Python :: 2.6Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Utilities |
Evidence: fields-5.0.0-py2.py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “container class boilerplate”
- fieldsGenerates lightweight container classes with automatic `__repr__`,…
- injectProvides a lightweight dependency injection framework for Python that…
- kinkKink is a lightweight dependency injection container for Python that…
Give your agent the search over MCP, or paste the wish link into any chat.
More Utilities packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Detects and normalizes text encoding from unknown or ambiguous sources, supporting all IANA character sets that Python's core library provides codecs for, with the ability to register custom codecs.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Pygments is a syntax highlighter that colorizes source code and text in over 500 languages and formats, outputting to HTML, LaTeX, RTF, SVG, images, or ANSI terminal sequences.
Install it if you need to display or transform source code.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
See also cattrs · attrs · django-deprecate-fields · namedlist · optree · attr · cobble · tinsel · recordclass · desert