--- id: cobble version: "0.1.4" license: unclear license_treatment: permissive maintenance: dormant --- # cobble — Create data objects License: permissive · Maintenance: dormant · Downloads: 15.6M/mo ## What it is and what it does Cobble is a decorator-based library for defining data classes with minimal boilerplate. It provides the `@cobble.data` decorator to automatically generate `__eq__`, `__repr__`, and other common methods for classes, along with a `cobble.field()` mechanism for declaring attributes with optional defaults. The library also includes a visitor pattern implementation via `@cobble.visitor` and `@cobble.visitable` decorators, allowing you to traverse and process hierarchies of related objects—useful for building interpreters, AST walkers, or other tree-based algorithms. The package has no runtime dependencies and supports Python 3.5 through 3.12. It occupies a niche between manual class definition and more comprehensive solutions like the standard library's dataclasses module or third-party libraries like attrs. The dormant maintenance status (last release in June 2024, repository unarchived) suggests the library is stable but not actively developed. Use it for: - Define immutable or semi-immutable data structures with automatic equality and string representation without writing boilerplate methods. - Build expression trees or abstract syntax trees where you need to traverse nodes using the visitor pattern. - Create domain objects in a domain-driven design context where you want minimal ceremony and automatic serialization-friendly representations. - Implement interpreters or evaluators that walk object hierarchies using the visitor pattern to dispatch behavior. - Prototype data models quickly without committing to a heavier framework or dataclass library. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Cobble is a Python library for creating data classes with automatic implementations of common methods like `__eq__` and `__repr__`, and for building visitor patterns over object hierarchies. Yes, if you need a lightweight visitor pattern implementation or prefer decorator-based data class generation over Python 3.7+ dataclasses. The zero-dependency install and broad Python version support make it low-risk. However, if you are on Python 3.7+ and do not need the visitor pattern, the standard library's dataclasses module or attrs may be more actively maintained alternatives. The dormant maintenance status is not a blocker for stable code, but verify that the feature set meets your needs before adopting. ## Install pip install cobble uv add cobble poetry add cobble ## Installing cobble Before you install: Installation is frictionless with no runtime dependencies. The package is dormant (last release 2024-06-01, 804 days ago) but the repository remains active and unarchived, suggesting stable maintenance rather than abandonment. License in practice: Cobble is licensed under the 2-Clause BSD license, a permissive open-source license that allows commercial and private use with minimal restrictions, requiring only attribution and inclusion of the license text. Quickstart: pip install cobble import cobble @cobble.data class Song(object): name = cobble.field() artist = cobble.field() album = cobble.field(default=None) song = Song("MFEO", artist="Jack's Mannequin") print(song) Verify before relying: - Whether cobble's visitor pattern implementation offers advantages over Python's built-in approaches or other visitor libraries - Performance characteristics compared to dataclasses (standard library in Python 3.7+) or attrs - Active maintenance status given dormancy classification despite recent repository activity ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 15.6M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags python data class generator, automatic __repr__ __eq__ implementation, visitor pattern library, data object creation, python dataclass alternative, class decorator for data objects, object hierarchy traversal, data-class-decorator, visitor-pattern, code-generation [View on SkillFed](https://skillfed.io/packages/cobble) · [View on PyPI](https://pypi.org/project/cobble/)