cobble
Create data objects
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 on this page — 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
cobble on PyPI
pip
pip install cobbleuv
uv add cobblepoetry
poetry add cobbleInstalling 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 the current Python release (>=3.5) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | dormant — 804 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 15,618,177/month — #1,178 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: cobble-0.1.4-py3-none-any.whl
Keywords: data, object, case, class
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
visitorProvides a base Visitor class to implement the…
permissive · top 15,000 on PyPI
mulpyplexerMulpyplexer applies method calls and attribute…
permissive · top 15,000 on PyPI
fastlitefastlite wraps sqlite-utils to provide…
permissive · top 15,000 on PyPI
etuplesProvides S-expression emulation using…
permissive · top 5,000 on PyPI
renewGenerates reproducible string representations…
permissive · top 15,000 on PyPI
fieldsGenerates lightweight container classes with…
permissive · top 15,000 on PyPI
attrsattrs is a Python library that automatically…
permissive · top 100 on PyPI
class-resolverDynamically lookup and instantiate classes by…
permissive · top 15,000 on PyPI
dataclassesProvides the PEP 557 dataclasses module for…
permissive · top 5,000 on PyPI
boolean.pyParse, simplify, and compare boolean…
permissive · top 1,000 on PyPI